3.3.0: REBUILD INDEX on a large DiskANN (I8, 4096-dim) index fails with TransactionConflict; CONCURRENTLY leaves compacting:true with KNN ~270x slower
Environment
- SurrealDB 3.3.0 (macOS arm64 binary,
surreal start rocksdb:<dir>), single node - Data created on 3.2.4 (build 93ab219), same RocksDB directory opened by 3.3.0 (in-place upgrade path)
SURREAL_ROCKSDB_MAX_OPEN_FILES=1024, 64 GB RAM host, no other load on the DB
Index
DEFINE INDEX fact_vec_diskann ON fact FIELDS embedding_qwen_i8
DISKANN DIMENSION 4096 DIST COSINE TYPE I8 DEGREE 64 L_BUILD 100 ALPHA 1.2f;Table fact: 318,519 rows, SCHEMAFULL, plus 5 FULLTEXT indexes and several b-tree indexes.
Before rebuild (3.3.0 opening the 3.2.4 files)
KNN SELECT id, vector::distance::knn() AS d FROM fact WHERE embedding_qwen_i8 <|20,80|> $v ORDER BY d LIMIT 20;
→ p50 10 ms, 20 rows (same as 3.2.4: 9 ms).
1. Plain rebuild fails, and the index is left silently empty
REBUILD INDEX fact_vec_diskann ON TABLE fact; → after 504 s:
There was a problem with the key-value store: Transaction conflict: Operation failed. Try again
Afterwards INFO FOR INDEX reports {"building":{"status":"ready","initial":318519,"pending":0,"compacting":false}}
but the KNN query above returns 0 rows.
2. CONCURRENTLY completes, but stays "compacting" and is very slow
REBUILD INDEX fact_vec_diskann ON TABLE fact CONCURRENTLY; → status ready after ~111 s, KNN returns 20 rows,
but compacting: true never clears (observed > 30 min, server process idle: no CPU, no disk growth), and
KNN p50 = 2,463 ms (was 10 ms). With a b-tree-covered pre-filter (state = 'active' AND … <|20,80|>): 1,507 ms.
EXPLAIN shows KnnScan on fact_vec_diskann, so the index is used.
Control
The same REBUILD on a small DiskANN index with identical definition (2,961 rows) completes in ~3 s and KNN stays at ~11 ms.
Expected
Rebuild of a large DiskANN index either completes with KNN latency comparable to the original build, or fails without
leaving an index that reports ready while returning no results.
Repro notes
Data is private (cannot share). Happy to run diagnostics or a debug build against a scratch copy.
Source: surrealdb/surrealdb