aweisberg commented on code in PR #3395:
URL: https://github.com/apache/cassandra/pull/3395#discussion_r1707863493
##########
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:
CAS is supported on non-distributed keyspace (ya really) so this is all
about preserving support for it. Since it's not distributed and Accord doesn't
support non-distributed keyspaces this is letting Paxos continue to provide
that support.
There was a bug where we could try to route to keyspaces that are not
distributed and we would not return the right error here so this is
differentiating between when it's an error and the keyspace doesn't exist and
when it's just that it's not a distributed keyspace. I tried to standardize on
this `metadata` and `getTableMetadata` method so we consistently perform this
check.
--
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]