You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by if...@apache.org on 2025/05/12 07:58:14 UTC
(cassandra-accord) branch trunk updated (7a053792 -> 4918bd61)
This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
omit 7a053792 Accord: On restart, while replying the journal the linearizability check logic found incorrect ordering and rejected startup (#191)
new 0f9f201f Accord: On restart, while replying the journal the linearizability check logic found incorrect ordering and rejected startup
new 4918bd61 Fix durableBefore check on replay
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (7a053792)
\
N -- N -- N refs/heads/trunk (4918bd61)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/accord/utils/ReducingIntervalMap.java | 30 ++++++----------------
1 file changed, 8 insertions(+), 22 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
(cassandra-accord) 02/02: Fix durableBefore check on replay
Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
commit 4918bd6109c79a47e82d95aa85cc37cbfbb15d65
Author: Alex Petrov <ol...@gmail.com>
AuthorDate: Mon May 12 09:57:32 2025 +0200
Fix durableBefore check on replay
Root cause of the failure is durable before being loaded into command store before replay, later conflicting with topology replay. We want to relax invariant to allow replay.
ERROR 09:52:32 Exception in thread Thread[node3_isolatedExecutor:1,5,isolatedExecutor]
java.lang.IllegalStateException: null
at accord.utils.Invariants.createIllegalState(Invariants.java:77)
at accord.utils.Invariants.illegalState(Invariants.java:82)
at accord.utils.Invariants.illegalState(Invariants.java:92)
at accord.utils.Invariants.require(Invariants.java:218)
at accord.local.Node.addNewRangesToDurableBefore(Node.java:276)
at accord.local.CommandStores.updateTopology(CommandStores.java:518)
at accord.local.CommandStores.updateTopology(CommandStores.java:843)
at accord.local.Node.onTopologyUpdateInternal(Node.java:333)
Patch by Alex Petrov, reviewed by David Capwell for CASSANDRA-20641
---
.../src/main/java/accord/local/DurableBefore.java | 21 ++++++++++++++++++++-
accord-core/src/main/java/accord/local/Node.java | 4 +++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/accord-core/src/main/java/accord/local/DurableBefore.java b/accord-core/src/main/java/accord/local/DurableBefore.java
index b0c5df90..b4135028 100644
--- a/accord-core/src/main/java/accord/local/DurableBefore.java
+++ b/accord-core/src/main/java/accord/local/DurableBefore.java
@@ -23,9 +23,10 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import accord.api.RoutingKey;
-import accord.primitives.Status.Durability;
import accord.primitives.AbstractRanges;
import accord.primitives.Participants;
+import accord.primitives.Ranges;
+import accord.primitives.Status.Durability;
import accord.primitives.TxnId;
import accord.primitives.Unseekables;
import accord.utils.Invariants;
@@ -155,6 +156,24 @@ public class DurableBefore extends ReducingRangeMap<DurableBefore.Entry>
}
}
+ public boolean fullyContainedIn(DurableBefore other)
+ {
+ if (values == NO_OBJECTS)
+ return true;
+
+ for (int i = 0 ; i < values.length; i++)
+ {
+ if (values[i] != null &&
+ !other.foldlWithDefault(Ranges.of(starts[i].rangeFactory().newRange(starts[i], starts[i + 1])),
+ (v, a) -> a || v != null,
+ null,
+ false,
+ a -> a))
+ return false;
+ }
+ return true;
+ }
+
public static DurableBefore create(AbstractRanges ranges, @Nonnull TxnId majority, @Nonnull TxnId universal)
{
if (ranges.isEmpty())
diff --git a/accord-core/src/main/java/accord/local/Node.java b/accord-core/src/main/java/accord/local/Node.java
index fd789527..954cedc8 100644
--- a/accord-core/src/main/java/accord/local/Node.java
+++ b/accord-core/src/main/java/accord/local/Node.java
@@ -273,7 +273,9 @@ public class Node implements ConfigurationService.Listener, NodeCommandStoreServ
DurableBefore newDurableBefore = DurableBefore.merge(durableBefore, addDurableBefore);
// TODO (required): it is possible for this invariant to be breached if topologies are received out of order.
// We should not update min past the max known epoch.
- Invariants.require(newDurableBefore.min.majorityBefore.compareTo(durableBefore.min.majorityBefore) >= 0);
+ Invariants.require(newDurableBefore.min.majorityBefore.compareTo(durableBefore.min.majorityBefore) >= 0 || durableBefore.fullyContainedIn(newDurableBefore),
+ "Previous durable before: %s, new: %s", durableBefore, newDurableBefore);
+
minDurableBefore = DurableBefore.merge(minDurableBefore, addDurableBefore);
durableBefore = newDurableBefore;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
(cassandra-accord) 01/02: Accord: On restart, while replying the journal the linearizability check logic found incorrect ordering and rejected startup
Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
commit 0f9f201f047dbb7780797d018dffef244dc7ea17
Author: Benedict Elliott Smith <be...@apache.org>
AuthorDate: Fri May 9 13:39:08 2025 -0700
Accord: On restart, while replying the journal the linearizability check logic found incorrect ordering and rejected startup
patch by Benedict Elliott Smith; reviewed by Alex Petrov and David Capwell for CASSANDRA-20641
---
accord-core/src/main/java/accord/local/Commands.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/accord-core/src/main/java/accord/local/Commands.java b/accord-core/src/main/java/accord/local/Commands.java
index a1abe351..cf48d228 100644
--- a/accord-core/src/main/java/accord/local/Commands.java
+++ b/accord-core/src/main/java/accord/local/Commands.java
@@ -557,12 +557,12 @@ public class Commands
}
}
- protected static void postApply(SafeCommandStore safeStore, TxnId txnId, long t0)
+ protected static void postApply(SafeCommandStore safeStore, TxnId txnId, long t0, boolean forceApply)
{
SafeCommand safeCommand = safeStore.get(txnId);
Command command = safeCommand.current();
logger.trace("{} applied, setting status to Applied and notifying listeners", command);
- if (command.hasBeen(Applied))
+ if (command.hasBeen(Applied) && !forceApply)
return;
safeCommand.applied(safeStore);
@@ -595,7 +595,7 @@ public class Commands
return command.writes().apply(safeStore, executes, command.partialTxn())
// TODO (expected): once we guarantee execution order KeyHistory can be ASYNC
.flatMap(unused -> unsafeStore.build(contextFor(txnId, executes, SYNC), ss -> {
- postApply(ss, txnId, t0);
+ postApply(ss, txnId, t0, false);
return null;
}));
}
@@ -612,7 +612,7 @@ public class Commands
TxnId txnId = command.txnId();
return command.writes().apply(safeStore, executes, command.partialTxn())
.flatMap(unused -> unsafeStore.build(context, ss -> {
- postApply(ss, txnId, -1);
+ postApply(ss, txnId, -1, true);
return null;
}));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org