Skip to content

wait_for_schema_agreement fails when connection is closed #604

@sylwiaszunejko

Description

@sylwiaszunejko

wait_for_schema_agreement picks connection from control connection without handling control connection reconnection so it is possible to pick closed connection.

if not connection:
connection = self._connection

It can be a problem if wait_for_schema_agreement is used as a public API e.g. in scylladb's tests:
https://github.com/scylladb/scylla-dtest/blob/d4b534021036503fdcc3400ab5da9f3407c81cf3/dtest_class.py#L220

There is an optional connection argument in wait_for_schema_agreement, it is currently used only in case when we received RESULT_KIND_SCHEMA_CHANGE to ensure wait_for_schema_agreement is ran on the same host where the statement was executed.

Maybe instead of connection we can hand over a connectionpool or session to ensure correctness even if one particular connection is closed for some reason.

Refs: scylladb/scylladb#25966

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions