Skip to content

wait_for_schema_agreement() too slow? #453

@mykaul

Description

@mykaul

Resuming a discussion from @nyh and @Lorak-mmk from scylladb/scylladb#23138 on why schema agreement may be slow (and for the sake of discussion, let's also assume we are dealing with a multiple AZ, multiple DC, large cluster, say 100 nodes):

  1. There's a 0.2 seconds sleep between cycles of trying to get an agreed upon schema -
    self._time.sleep(0.2)
    - is that a real issue?
  2. def _get_schema_mismatches(self, peers_result, local_result, local_address):
    maybe is an overkill - creating an populating a dictionary from all peers, just to see if there's a mismatch? Not sure it's a real issue, but clearly could be done better
  3. Is the query that _get_peers_query() is using ( see
    def _get_peers_query(self, peers_query_type, connection=None):
    ) optimal for this use case? What do we need other than the schema_version ? Seem there are 3 options:
_SELECT_PEERS = "SELECT * FROM system.peers"
_SELECT_PEERS_NO_TOKENS_TEMPLATE = "SELECT host_id, peer, data_center, rack, rpc_address, {nt_col_name}, release_version, schema_version FROM system.peers"
_SELECT_SCHEMA_PEERS_TEMPLATE = "SELECT peer, host_id, {nt_col_name}, schema_version FROM system.peers"

I think (just from reading the code) we use _SELECT_SCHEMA_PEERS_TEMPLATE , which seems reasonable.

Anything else? Do we even have an issue?

Metadata

Metadata

Assignees

No one assigned

    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