Skip to content

Commit 0ced680

Browse files
committed
CNDB-14657: disable synthetic score for older versions in FeaturesVersionSupportTester
1 parent 166292f commit 0ced680

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/distributed/org/apache/cassandra/distributed/test/sai/features/FeaturesVersionSupportTester.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ protected static void initCluster(Version version) throws IOException
6161

6262
FeaturesVersionSupportTester.version = version;
6363
cluster = init(Cluster.build(2)
64-
.withInstanceInitializer((cl, n) -> BB.install(cl, n, version))
64+
.withInstanceInitializer((cl, n) -> {
65+
// Disable synthetic score to ensure compatibility between ED and older versions.
66+
// ED enables it by default but older versions don't support it.
67+
// Note: In 5.0, Ordering.useSyntheticScore() uses CassandraRelevantProperties
68+
// which caches values at class loading time, so we must set this property before
69+
// the classes are loaded. In the main branch, Ordering uses System.getProperty() directly,
70+
// which is why this workaround isn't needed there.
71+
System.setProperty("cassandra.sai.ann_use_synthetic_score", "false");
72+
BB.install(cl, n, version);
73+
})
6574
.withConfig(config -> config.with(GOSSIP).with(NETWORK))
6675
.start(), 1);
6776

0 commit comments

Comments
 (0)