Skip to content

Commit 84e6256

Browse files
CNDB-14167: Set jvector_version on disk file format to 2 (#1757) (#1760)
### What is the issue Fixes: riptano/cndb#14167 ### What does this PR fix and why was it fixed We upgraded to jvector 4 too soon. We need to use jvector 2 for a release cycle and then when we upgrade next, we can go to jvector 4. We needed a two phase release. CNDB test PR: riptano/cndb#14196 Co-authored-by: Michael Marshall <[email protected]>
1 parent 90080e7 commit 84e6256

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/java/org/apache/cassandra/index/sai/disk/v3/V3OnDiskFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class V3OnDiskFormat extends V2OnDiskFormat
5353
public static boolean JVECTOR_USE_PRUNING_DEFAULT = Boolean.parseBoolean(System.getProperty("cassandra.sai.jvector.use_pruning_default", "true"));
5454

5555
// These are built to be backwards and forwards compatible. Not final only for testing.
56-
public static int JVECTOR_VERSION = Integer.parseInt(System.getProperty("cassandra.sai.jvector_version", "4"));
56+
public static int JVECTOR_VERSION = Integer.parseInt(System.getProperty("cassandra.sai.jvector_version", "2"));
5757
static
5858
{
5959
// JVector 3 is not compatible with the latest jvector changes, so we fail fast if the config is enabled.

test/unit/org/apache/cassandra/index/sai/cql/VectorDotProductWithLengthTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public void setup() throws Throwable
3434
{
3535
super.setup();
3636
// we are testing unit vector detection which is part of the v3 changes, but continues in all subsequent versions
37-
assert V3OnDiskFormat.JVECTOR_VERSION >= 3 : "This test assumes JVector version 3 or greater";
37+
if (V3OnDiskFormat.JVECTOR_VERSION < 4)
38+
V3OnDiskFormat.JVECTOR_VERSION = 4;
3839
}
3940

4041
// This tests our detection of unit-length vectors used with dot product and PQ.

0 commit comments

Comments
 (0)