bdeggleston commented on code in PR #4708:
URL: https://github.com/apache/cassandra/pull/4708#discussion_r3439236300
##########
src/java/org/apache/cassandra/locator/SatelliteReplicationStrategy.java:
##########
@@ -497,6 +567,54 @@ public boolean isDisabled(String dc)
return disabledDCs.contains(dc);
}
+ @Override
+ public Paxos.Participants paxosParticipants(ClusterMetadata metadata,
+ TableMetadata table,
+ Token token,
+ ConsistencyLevel
consistencyForConsensus,
+ Predicate<Replica>
isReplicaAlive)
+ {
+ // Reject paxos operations during TRANSITION_ACK to prevent
conflicting paxos operations
+ // across different full DCs. The temporary gap in paxos availability
ensures that the old
+ // primary has no in-flight proposals before the new primary begins
serving paxos operations.
+ SatelliteFailoverState.FailoverInfo failoverInfo =
getFailoverInfo(token, metadata);
+ if (failoverInfo.getState() ==
SatelliteFailoverState.State.TRANSITION_ACK)
+ throw UnavailableException.create(consistencyForConsensus, 1, 0);
+
+ KeyspaceMetadata keyspaceMetadata =
metadata.schema.getKeyspaceMetadata(table.keyspace);
+ ReplicaLayout.ForTokenWrite fullLayout =
ReplicaLayout.forTokenWriteLiveAndDown(metadata, keyspaceMetadata, token);
+
+ // Paxos consensus operates entirely within the primary DC
+ Predicate<Replica> inPrimaryDC = rp ->
metadata.locator.location(rp.endpoint()).datacenter.equals(primaryDC);
+ ReplicaLayout.ForTokenWrite primaryAll =
fullLayout.filter(inPrimaryDC);
+ ReplicaLayout.ForTokenWrite primaryElectorate = primaryAll;
+
+ // Satellite/secondary DC endpoints for reads during prepare and
writes during commit.
+ // Only include the primary DC's satellite and other full DCs — not
satellites of other DCs.
+ String primarySatellite = getSatelliteForDC(primaryDC);
+ Predicate<Replica> isParticipatingNonPrimary = rp -> {
Review Comment:
Paxos operations are only ever conducted against the active primary, which
can't be disabled
--
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]