bereng commented on code in PR #3610:
URL: https://github.com/apache/cassandra/pull/3610#discussion_r1798805515


##########
src/java/org/apache/cassandra/db/LivenessInfo.java:
##########
@@ -360,15 +360,10 @@ public void digest(Digest digest)
         {
             super.digest(digest);
 
-            // Nodes on versions prior to 5.0 always update the digest with an 
int, and we will not need a long
-            // anyway until we move storage compatibility mode to NONE and 
extended TTLs are possible. If the local
-            // expiration time fits in an int, update the digest with one to 
avoid false digest mismatches on read.
-            int intLocalExpirationTime = (int) localExpirationTime;
-            if (intLocalExpirationTime == localExpirationTime)
-                digest.updateWithInt(intLocalExpirationTime);
-            else
-                digest.updateWithLong(localExpirationTime);
-
+            // As of 5.0, local expiration times are encoded as unsigned 
integers on disk, so we can do the
+            // same thing here to populate the digest. This supports extended 
TTLs, but also maintains digest
+            // compatibility with previous versions, avoiding false digest 
mismatches during upgrades.
+            
digest.updateWithInt(Cell.deletionTimeLongToUnsignedInteger(localExpirationTime));

Review Comment:
   Yep :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to