adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1186386170
##########
src/java/org/apache/cassandra/db/rows/Cell.java:
##########
@@ -59,16 +70,37 @@
public interface Factory<V>
{
- Cell<V> create(ColumnMetadata column, long timestamp, int ttl, int
localDeletionTime, V value, CellPath path);
+ Cell<V> create(ColumnMetadata column, long timestamp, int ttl, long
localDeletionTime, V value, CellPath path);
}
protected Cell(ColumnMetadata column)
{
super(column);
}
+ public static int deletionTimeLongToUnsignedInteger(long deletionTime)
+ {
+ return deletionTime == NO_DELETION_TIME ?
NO_DELETION_TIME_UNSIGNED_INTEGER : CassandraUInt.fromLong(deletionTime);
+ }
+
+ public static long deletionTimeUnsignedIntegerToLong(int
deletionTimeUnsignedInteger)
+ {
+ return deletionTimeUnsignedInteger ==
NO_DELETION_TIME_UNSIGNED_INTEGER ? NO_DELETION_TIME :
CassandraUInt.toLong(deletionTimeUnsignedInteger);
+ }
+
+ public static long getVersionedMaxDeletiontionTime()
+ {
+ if (BigFormat.ttlMode.equals(TTL_MODE.EXTENDED_TTL_2106))
+ // The whole cluster is 2016, we're out of the 2038/2106 mixed
clusters scenario. Short cut to avoid the 'minClusterVersion' volatile read
Review Comment:
Agree on both things. Trying to infer the behaviour should only be done
during upgrades, and the avoidance on the version read will miss the `MAX_TTL`
case.
However, I still think that the property can easily be more generic, so we
don't merge code that will need to be undone by
[CASSANDRA-18301](https://issues.apache.org/jira/browse/CASSANDRA-18301). The
compatibility mode property can be generalized to cover any similar features
with minimal changes. It can also be put on its own class and made accessible
through `DatabaseDescriptor`, so we don't overload `BigFormat` nor we have
messaging, commitlog, hints, etc. depending on that particular sstable format.
I gave it a go here:
https://github.com/adelapena/cassandra/commit/bfbbb449b2645cef80d7ed040593ff07492610ec
It's basically the same approach but with some minor refactoring and a new
rolling upgrade test.
--
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]