jacek-lewandowski commented on code in PR #2843:
URL: https://github.com/apache/cassandra/pull/2843#discussion_r1373167445
##########
src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:
##########
@@ -53,19 +54,22 @@ public final Commit.Result commit(Entry.Id entryId,
Transformation transform, fi
{
while (!retryPolicy.reachedMax())
{
- ClusterMetadata previous = log.waitForHighestConsecutive();
- if
(!previous.fullCMSMembers().contains(FBUtilities.getBroadcastAddressAndPort()))
+ long timestampMicros = -1;
+ log.waitForHighestConsecutive();
+ LocalLog.CommittedValue prevCommitted = log.committedValue();
+ if
(!prevCommitted.metadata.fullCMSMembers().contains(FBUtilities.getBroadcastAddressAndPort()))
throw new IllegalStateException("Node is not a member of CMS
anymore");
Transformation.Result result;
if
(!CassandraRelevantProperties.TCM_ALLOW_TRANSFORMATIONS_DURING_UPGRADES.getBoolean()
&&
!transform.allowDuringUpgrades() &&
- previous.metadataSerializationUpgradeInProgress())
+
prevCommitted.metadata.metadataSerializationUpgradeInProgress())
{
result = new Transformation.Rejected(ExceptionCode.INVALID,
"Upgrade in progress, can't commit " + transform);
}
else
{
- result = transform.execute(previous);
+ while ((timestampMicros = nextUnixMicros()) <=
prevCommitted.timestampMicros);
Review Comment:
Indeed, we can either wait or assume the previous epoch timestamp + 1 in
case the current timestamp is lower than the last epoch timestamp. In both
cases we can warn that clocks of CMS nodes have diverged too much.
--
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]