Skip to content

schema-agreement: add session fallback#842

Draft
dkropachev wants to merge 17 commits intomasterfrom
dk/schema-agreement-session-fallback
Draft

schema-agreement: add session fallback#842
dkropachev wants to merge 17 commits intomasterfrom
dk/schema-agreement-session-fallback

Conversation

@dkropachev
Copy link
Copy Markdown
Collaborator

Summary:

  • add Session.wait_for_schema_agreement() that polls local session hosts via system.local
  • fall back from control-connection schema agreement to a live session when the control connection is unavailable or closed
  • fall back to the session API after DDL schema-refresh agreement fails

Fixes #604

Testing:

  • python -m py_compile cassandra/cluster.py tests/unit/test_control_connection.py tests/unit/test_cluster.py tests/unit/test_response_future.py
  • direct probes for modified control/response-future tests
  • repo_ci fast: workflow-build, workflow-prepare, and workflow-test passed; workflow-build-2 timed out after 300s in cibuildwheel

@Lorak-mmk
Copy link
Copy Markdown

fall back to the session API after DDL schema-refresh agreement fails

I don't think this is correct. The purpose of after-DDL schema agreement is to make sure that all the nodes acknowledged the new schema notification.
If you perform the schema agreement check on a different node, it is possible that it is the node that didn't get the schema change yet, and will get a false-positive schema agreement.

After-DDL schema agreement should be performed on the node we used for DDL. We can use different connection, but not different node.

@dkropachev
Copy link
Copy Markdown
Collaborator Author

fall back to the session API after DDL schema-refresh agreement fails

I don't think this is correct. The purpose of after-DDL schema agreement is to make sure that all the nodes acknowledged the new schema notification. If you perform the schema agreement check on a different node, it is possible that it is the node that didn't get the schema change yet, and will get a false-positive schema agreement.

After-DDL schema agreement should be performed on the node we used for DDL. We can use different connection, but not different node.

It does it on all active nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wait_for_schema_agreement fails when connection is closed

2 participants