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


##########
src/java/org/apache/cassandra/db/Memtable.java:
##########
@@ -387,9 +397,16 @@ public Partition getPartition(DecoratedKey key)
         return partitions.get(key);
     }
 
+    /**
+     * Returns the minTS if one available, otherwise -1.
+     *
+     * EncodingStats uses a synthetic epoch TS at 2015. We don't want to leak 
that (CASSANDRA-18118) so we return -1 instead.
+     *
+     * @return The minTS or -1 if none available
+     */
     public long getMinTimestamp()
     {
-        return minTimestamp;
+        return minTimestamp != EncodingStats.NO_STATS.minTimestamp ? 
minTimestamp : -1;

Review Comment:
   Hi @maedhroz 
   
   thx for reply. I am currently on xmas holidays so advanced apologies for 
delayed responses.
   
   That is an option but ``Memtable.getMinTimestamp()` is a public method so 
any future new consumer could easily be leaking the 2015 TS again. I am 
thinking along the lines of leaving the 2015 TS as an encapsulated 
implementation detail.
   
   If we found a better way to prevent future leaks that'd be perfect.



-- 
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