aweisberg commented on code in PR #3395:
URL: https://github.com/apache/cassandra/pull/3395#discussion_r1707918402
##########
src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:
##########
@@ -85,11 +87,17 @@ ConsensusRoutingDecision decisionFor(TransactionalMode
transactionalMode)
private static TableMetadata metadata(ClusterMetadata cm, String keyspace,
String table)
{
- KeyspaceMetadata ksm = cm.schema.getKeyspaceMetadata(keyspace);
- TableMetadata tbm = ksm != null ? ksm.getTableOrViewNullable(table) :
null;
-
+ Optional<KeyspaceMetadata> ksm =
cm.schema.maybeGetKeyspaceMetadata(keyspace);
+ if (ksm.isEmpty())
+ {
+ KeyspaceMetadata ksm2 =
Schema.instance.getKeyspaceMetadata(keyspace);
+ if (ksm2 == null)
Review Comment:
Paxos racing is acceptable because Paxos (and even non-SERIAL) can misroute.
The ClusterMetadata check itself is inherently racy and could miss the fact
that other nodes have adopted this table as an Accord table.
I'll add a few more checks to confirm the keyspace we find is actually
local, but they don't eliminate this race and we can still pick paxos on the
coordinator when the `ClusterMetadata` has been updated to claim it's an Accord
table.
--
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]