yifan-c commented on code in PR #4431:
URL: https://github.com/apache/cassandra/pull/4431#discussion_r2600635894
##########
test/unit/org/apache/cassandra/db/marshal/AbstractTypeTest.java:
##########
@@ -960,17 +960,31 @@ public void testAssumedCompatibility()
@Test
public void testBackwardCompatibility()
{
+ // Fix for CASSANDRA-20979 altered behaviour of SimpleDateType and
TimeType by correctly
+ // returning the fix-length size in valueLengthIfFixed(). This change
impacted logic of
+ // isSerializationCompatibleWith(), which as a result complains about
backward compatibility of:
+ // 1) [SimpleDateType isSerializationCompatibleWith Int32Type, {}]
expected:<[fals]e> but was:<[tru]e>
+ // 2) [TimeType isSerializationCompatibleWith LongType, {}]
expected:<[fals]e> but was:<[tru]e>
+ // 3) [BytesType isSerializationCompatibleWith SimpleDateType, {}]
expected:<[tru]e> but was:<[fals]e>
+ // 4) [BytesType isSerializationCompatibleWith TimeType, {}]
expected:<[tru]e> but was:<[fals]e>
+ ImmutableMap<AbstractType, Set<AbstractType>> exclusions =
ImmutableMap.<AbstractType, Set<AbstractType>>builder()
+
.put(SimpleDateType.instance, ImmutableSet.of(Int32Type.instance))
+
.put(TimeType.instance, ImmutableSet.of(LongType.instance))
+
.put(BytesType.instance, ImmutableSet.of(SimpleDateType.instance,
TimeType.instance))
+
.build();
+
Review Comment:
Instead of excluding the pairs from test, would it be correct if we mark
those pairs with the previous compatibility values? The method
`isSerializationCompatibleWith` is used to determine whether a dropped column
can be re-added with a different type. If the value is still readable, we
should be good with marking the types explicitly.
--
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]