Due to the distributed nature of Cassandra, schema changes made on one node might not be immediately visible to others. Under certain circumstances, the driver waits until all nodes agree on a common schema version (namely: before a schema refresh, before repreparing all queries on a newly up node, and before completing a successful schema-altering query). To do so, it queries system tables to find out the schema version of all nodes that are currently UP. If all the versions match, the check succeeds, otherwise it is retried periodically, until a given timeout.
A schema agreement failure is not fatal, but it might produce unexpected results (for example, getting an "unconfigured table" error for a table that you created right before, just because the two queries went to different coordinators).
Note that schema agreement never succeeds in a mixed-version cluster (it would be challenging because the way the schema version is computed varies across server versions); the assumption is that schema updates are unlikely to happen during a rolling upgrade anyway.
- Value parameters:
- interval
The interval between each attempt.
- timeout
The timeout after which schema agreement fails. If this is set to 0, schema agreement is skipped and will always fail.
- warnOnFailure
Whether to log a warning if schema agreement fails. You might want to change this if you've set the timeout to 0.
- Companion:
- object