You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2024/10/11 13:51:15 UTC

(cassandra) branch cep-15-accord updated: disable TableId interning

This is an automated email from the ASF dual-hosted git repository.

benedict pushed a commit to branch cep-15-accord
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cep-15-accord by this push:
     new f269fd27de disable TableId interning
f269fd27de is described below

commit f269fd27debcedc3615942b1583ea5cccf67658a
Author: Benedict Elliott Smith <be...@apache.org>
AuthorDate: Fri Oct 11 14:51:08 2024 +0100

    disable TableId interning
---
 src/java/org/apache/cassandra/service/accord/AccordService.java     | 2 +-
 .../apache/cassandra/service/accord/CommandsForRangesLoader.java    | 2 +-
 .../org/apache/cassandra/service/accord/api/AccordRoutingKey.java   | 6 +++---
 src/java/org/apache/cassandra/service/accord/api/PartitionKey.java  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/java/org/apache/cassandra/service/accord/AccordService.java b/src/java/org/apache/cassandra/service/accord/AccordService.java
index 308e575a53..084baf08f8 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 40ee83e937..992867a9e2 100644
--- a/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java
+++ b/src/java/org/apache/cassandra/service/accord/CommandsForRangesLoader.java
@@ -249,7 +249,7 @@ public class CommandsForRangesLoader implements AccordStateCache.Listener<TxnId,
         if (cmd.partialTxn() == null)
             return null;
 
-        var keysOrRanges = cmd.partialTxn().keys();
+        var 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 <V> PartitionKey deserialize(V src, ValueAccessor<V> 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);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org