diff --git a/src/java/org/apache/cassandra/service/accord/AccordService.java b/src/java/org/apache/cassandra/service/accord/AccordService.java index ae45577e14..95188cddd4 100644 --- a/src/java/org/apache/cassandra/service/accord/AccordService.java +++ b/src/java/org/apache/cassandra/service/accord/AccordService.java @@ -890,7 +890,7 @@ public class AccordService implements IAccordService, Shutdownable asyncTxnResult.tryFailure(newTimeout(txnId, txn.isWrite(), consistencyLevel)); return; } - if (cause instanceof Preempted) + if (cause instanceof Preempted || cause instanceof Invalidated) { metrics.preempted.mark(); //TODO need to improve diff --git a/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java b/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java index 02e492f3c6..dca807e171 100644 --- a/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java +++ b/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java @@ -35,13 +35,13 @@ import accord.local.Command; import accord.local.KeyHistory; import accord.local.RedundantBefore; import accord.primitives.PartialDeps; +import accord.primitives.Participants; import accord.primitives.Routable.Domain; import accord.primitives.SaveStatus; import accord.primitives.Status; import accord.primitives.Range; import accord.primitives.Ranges; import accord.primitives.Routables; -import accord.primitives.Seekables; import accord.primitives.Timestamp; import accord.primitives.TxnId; import accord.utils.async.AsyncChains; @@ -252,7 +252,7 @@ public class CommandsForRangesLoader implements AccordStateCache.Listener> keysOrRanges = cmd.partialTxn().keys(); + Participants keysOrRanges = cmd.participants().touches(); if (keysOrRanges.domain() != Domain.Range) throw new AssertionError(String.format("Txn keys are not range for %s", cmd.partialTxn())); Ranges ranges = (Ranges) keysOrRanges; diff --git a/src/java/org/apache/cassandra/service/accord/api/AccordRoutingKey.java b/src/java/org/apache/cassandra/service/accord/api/AccordRoutingKey.java index deec2b21ab..6d8d2b8184 100644 --- a/src/java/org/apache/cassandra/service/accord/api/AccordRoutingKey.java +++ b/src/java/org/apache/cassandra/service/accord/api/AccordRoutingKey.java @@ -185,7 +185,7 @@ public abstract class AccordRoutingKey extends AccordRoutableKey implements Rout @Override public SentinelKey deserialize(DataInputPlus in, int version) throws IOException { - TableId table = TableId.deserialize(in).tryIntern(); + TableId table = TableId.deserialize(in); boolean isMin = in.readBoolean(); return new SentinelKey(table, isMin); } @@ -287,14 +287,14 @@ public abstract class AccordRoutingKey extends AccordRoutableKey implements Rout @Override public TokenKey deserialize(DataInputPlus in, int version) throws IOException { - TableId table = TableId.deserialize(in).tryIntern(); + TableId table = TableId.deserialize(in); Token token = Token.compactSerializer.deserialize(in, getPartitioner(), version); return new TokenKey(table, token); } public TokenKey fromBytes(ByteBuffer bytes, IPartitioner partitioner) { - TableId tableId = TableId.deserialize(bytes, ByteBufferAccessor.instance, 0).tryIntern(); + TableId tableId = TableId.deserialize(bytes, ByteBufferAccessor.instance, 0); bytes.position(tableId.serializedSize()); Token token = Token.compactSerializer.deserialize(bytes, partitioner); return new TokenKey(tableId, token); diff --git a/src/java/org/apache/cassandra/service/accord/api/PartitionKey.java b/src/java/org/apache/cassandra/service/accord/api/PartitionKey.java index aaa1264ea0..fc78fe6692 100644 --- a/src/java/org/apache/cassandra/service/accord/api/PartitionKey.java +++ b/src/java/org/apache/cassandra/service/accord/api/PartitionKey.java @@ -154,7 +154,7 @@ public final class PartitionKey extends AccordRoutableKey implements Key @Override public PartitionKey deserialize(DataInputPlus in, int version) throws IOException { - TableId tableId = TableId.deserialize(in).tryIntern(); + TableId tableId = TableId.deserialize(in); IPartitioner partitioner = Schema.instance.getExistingTablePartitioner(tableId); DecoratedKey key = partitioner.decorateKey(ByteBufferUtil.readWithShortLength(in)); return new PartitionKey(tableId, key); @@ -162,7 +162,7 @@ public final class PartitionKey extends AccordRoutableKey implements Key public PartitionKey deserialize(V src, ValueAccessor accessor, int offset) throws IOException { - TableId tableId = TableId.deserialize(src, accessor, offset).tryIntern(); + TableId tableId = TableId.deserialize(src, accessor, offset); offset += tableId.serializedSize(); TableMetadata metadata = Schema.instance.getTableMetadata(tableId); int numBytes = accessor.getShort(src, offset);