Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASSANDRA-19805: ExclusiveSyncPoints should execute on all intersecting epochs #107

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

belliottsmith
Copy link
Contributor

No description provided.

@belliottsmith belliottsmith force-pushed the exclusive-sync-point-fix branch 5 times, most recently from 04ca16f to 1c8b89d Compare August 2, 2024 13:05
@@ -68,17 +77,79 @@ public void start()
}
}

public static class ExecuteExclusiveSyncPoint extends ExecuteSyncPoint<Ranges>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I migrated ListStore to use this and it fails with

java.lang.IllegalArgumentException: No intersection
		at accord.messages.TxnRequest.computeScope(TxnRequest.java:287)
		at accord.messages.ReadData.<init>(ReadData.java:116)
		at accord.messages.WaitUntilApplied.<init>(WaitUntilApplied.java:51)
		at accord.coordinate.ExecuteSyncPoint$ExecuteExclusiveSyncPoint.lambda$start$0(ExecuteSyncPoint.java:96)
		at accord.local.Node.lambda$send$10(Node.java:501)
		at java.base/java.lang.Iterable.forEach(Iterable.java:75)
		at accord.local.Node.send(Node.java:501)
		at accord.local.Node.send(Node.java:494)
		at accord.coordinate.ExecuteSyncPoint$ExecuteExclusiveSyncPoint.start(ExecuteSyncPoint.java:96)
		at accord.impl.list.ListStore$Await.start(ListStore.java:528)
		at accord.impl.list.ListStore.awaitSyncPoint(ListStore.java:502)

I moved Await.coordinate into a awaitSyncPoint method to make it easier for plug out for me... and with that I have

private static AsyncChain<SyncPoint<Ranges>> awaitSyncPoint(Node node, SyncPoint<Ranges> exclusiveSyncPoint)
    {
        Await e = new Await(node, exclusiveSyncPoint);
        e.addCallback(() -> node.configService().reportEpochRedundant(exclusiveSyncPoint.keysOrRanges, exclusiveSyncPoint.syncId.epoch()));
        e.start();
        return e.recover(t -> {
            if (t.getClass() == SyncPointErased.class)
                return AsyncChains.success(null);
            if (t instanceof Timeout ||
                // TODO (expected): why are we not simply handling Insufficient properly?
                t instanceof RuntimeException && "Insufficient".equals(t.getMessage()) ||
                t instanceof SimulatedFault)
                return awaitSyncPoint(node, exclusiveSyncPoint);
            // cannot loop indefinitely
            if (t instanceof RuntimeException && "Redundant".equals(t.getMessage()))
                return AsyncChains.success(null);
            return null;
        });
    }

    private static class Await extends ExecuteSyncPoint.ExecuteExclusiveSyncPoint
    {
        public Await(Node node, SyncPoint<Ranges> syncPoint)
        {
            super(node, syncPoint, AppliedTracker::new);
        }

        @Override
        public void start()
        {
            super.start();
        }
    }

This doesn't include table removal, this is just ranges leaving the local node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants