Reputation: 31
I am trying to drop a materialized view on Cassandra and facing the below issue:
> drop materialized view XXXXXXXXXXXXXXXX;
OperationTimedOut: errors={'10.10.101.10': 'Request timed out while waiting for
schema agreement. See Session.execute[_async](timeout) and
Cluster.max_schema_agreement_wait.'}, last_host=10.10.101.10
Warning: schema version mismatch detected; check the schema versions of your nodes
in system.local and system.peers.
Upvotes: 3
Views: 10596
Reputation: 3266
You can check your cluster with nodetool describecluster
which gives you some output about every nodes schema version. I guess you will see one or a few nodes out of the majority.
Most often this can be easily fixed by restarting this nodes.
Here an example of one of my clusters (without any error in schema versions):
Cluster Information:
Name: TestCluster
Snitch: org.apache.cassandra.locator.DynamicEndpointSnitch
Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
Schema versions:
50219260-24ad-320f-9bd3-9ed0b207e2c6: [x.x.x.9, x.x.x.9, x.x.x.168, x.x.x.14, x.x.x.23, x.x.x.11, x.x.x.180, x.x.x.240, x.x.x.80, x.x.x.136, x.x.x.209, x.x.x.151]
Upvotes: 2
Reputation: 57808
To investigate schema disagreement, try running nodetool describecluster
:
$ nodetool describecluster
Cluster Information:
Name: StackOverflowTest
Snitch: org.apache.cassandra.locator.DynamicEndpointSnitch
Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
Schema versions:
276ea081-1204-3bee-a92a-2171a68bd3a9: [10.1.2.3, 10.1.2.4, 10.6.1.4, 10.1.8.2, 10.1.8.7, 10.6.1.3]
1f7d8b47-22d3-3210-b385-b2cdeb9c69e6: [10.6.1.5]
Notice that most of my nodes agree on the first schema version, but 10.6.1.5
has its own schema version. In this case, try to do a graceful restart of the offending node's Cassandra process (10.6.1.5
in this case). When the node comes back up, it will negotiate schema version which should resolve the issue.
Upvotes: 5