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

iamaleksey pushed a commit to branch cassandra-6.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-6.0 by this push:
     new ef6367ed10 Fix ReadCommand serializedSize() using incorrect epoch
ef6367ed10 is described below

commit ef6367ed102cbf1cee0fb2302d9122160d8a3cec
Author: Aleksey Yeshchenko <[email protected]>
AuthorDate: Mon Jun 1 12:57:01 2026 +0100

    Fix ReadCommand serializedSize() using incorrect epoch
    
    patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-21438
---
 CHANGES.txt                                       | 1 +
 src/java/org/apache/cassandra/db/ReadCommand.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index cf7a3f4f53..a9850a4a9e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 6.0-alpha2
+ * Fix ReadCommand serializedSize() using incorrect epoch (CASSANDRA-21438)
  * Allocation improvements in ProtocolVersion, StorageProxy and MerkleTree 
(CASSANDRA-21199)
  * Don’t leave autocompaction disabled during bootstrap and replace 
(CASSANDRA-21236)
  * Make nodetool abortbootstrap more robust (CASSANDRA-21235)
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java 
b/src/java/org/apache/cassandra/db/ReadCommand.java
index e1c0a21834..53ad6b3d1b 100644
--- a/src/java/org/apache/cassandra/db/ReadCommand.java
+++ b/src/java/org/apache/cassandra/db/ReadCommand.java
@@ -1520,7 +1520,7 @@ public abstract class ReadCommand extends 
AbstractReadQuery
             return 2 // kind + flags
                    + (command.isDigestQuery() ? 
TypeSizes.sizeofUnsignedVInt(command.digestVersion()) : 0)
                    + command.metadata().id.serializedSize()
-                   + (version >= MessagingService.VERSION_60 ? 
Epoch.serializer.serializedSize(command.metadata().epoch) : 0)
+                   + (version >= MessagingService.VERSION_60 ? 
Epoch.serializer.serializedSize(command.serializedAtEpoch) : 0)
                    + TypeSizes.INT_SIZE // command.nowInSec() is serialized as 
uint
                    + 
ColumnFilter.serializer.serializedSize(command.columnFilter(), version)
                    + RowFilter.serializer.serializedSize(command.rowFilter(), 
version)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to