tolbertam commented on code in PR #4558:
URL: https://github.com/apache/cassandra/pull/4558#discussion_r2836710274
##########
src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:
##########
@@ -197,7 +210,20 @@ private static TableMetadata.Builder parse(String table,
String description, Str
public static KeyspaceMetadata metadata()
{
- return
KeyspaceMetadata.create(SchemaConstants.DISTRIBUTED_KEYSPACE_NAME,
KeyspaceParams.simple(Math.max(DEFAULT_RF,
DatabaseDescriptor.getDefaultKeyspaceRF())), Tables.of(RepairHistory,
ParentRepairHistory, ViewBuildStatus, PartitionDenylistTable,
AutoRepairHistory, AutoRepairPriority));
+ Tables tables;
+ if (CassandraRelevantProperties.AUTOREPAIR_ENABLE.getBoolean())
Review Comment:
I was curious what would happen if I made a schema change while all nodes
have not picked up the flag to enable auto repair. Functionally it appears
similar to what would happen during a major version upgrade where new system
tables were added, and I think that's ok, but just something folks will need to
be mindful of, which is that schema can never agree while in an inconsistent
state of this feature being enabled cluster wide.
I tested with a 3 node cluster, 1 node having
`-Dcassandra.autorepair.enabled=true` and the other 2 not.
I made a simple schema change via creating a keyspace and after doing so,
the schema disagreed. between the instance with the props and the others that
didn't:
```
cqlsh> create KEYSPACE simple with replication = {'class':
'NetworkTopologyStrategy', 'replication_factor': 3};
OperationTimedOut: errors={'Connection defunct by heartbeat': 'Client
request timeout. See Session.execute[_async](timeout)'},
last_host=127.0.0.1:9042
Warning: schema version mismatch detected; check the schema versions of your
nodes in system.local and system.peers.
cqlsh> select schema_version from system.peers;
schema_version
--------------------------------------
348a7c3b-22e5-38e5-852a-a198f276d241
348a7c3b-22e5-38e5-852a-a198f276d241
(2 rows)
cqlsh> select schema_version from system.local;
schema_version
--------------------------------------
d3d0e052-79b0-3ff4-bb4f-f71a9ce0c8f8
```
After bringing the other two nodes with the flag, everything converged to
`d3d0e052-79b0-3ff4-bb4f-f71a9ce0c8f8`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]