jakubzytka commented on code in PR #2843:
URL: https://github.com/apache/cassandra/pull/2843#discussion_r1373097136
##########
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:
Could we do something better than active wait? like sleep?
perhaps it makes sense to `WARN` if the difference is too big?
--
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]