Skip to content

Commit a8809ad

Browse files
chiangchenghsin-hashadsharma
authored andcommitted
fix(vector): use real transaction in OnDiskHNSWIndex::finalize (not DUMMY_CHECKPOINT_TRANSACTION)
1 parent 05baf20 commit a8809ad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vector/src/index/hnsw_index.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,11 @@ void OnDiskHNSWIndex::update(Transaction* transaction, const common::ValueVector
669669

670670
void OnDiskHNSWIndex::finalize(main::ClientContext* context) {
671671
auto& hnswStorageInfo = storageInfo->cast<HNSWStorageInfo>();
672-
const auto numTotalRows = nodeTable.getNumTotalRows(&DUMMY_CHECKPOINT_TRANSACTION);
672+
auto transaction = Transaction::Get(*context);
673+
const auto numTotalRows = nodeTable.getNumTotalRows(transaction);
673674
if (numTotalRows == hnswStorageInfo.numCheckpointedNodes) {
674675
return;
675676
}
676-
auto transaction = Transaction::Get(*context);
677677
auto [nodeTableEntry, upperRelTableEntry, lowerRelTableEntry] =
678678
getIndexTableCatalogEntries(catalog::Catalog::Get(*context), transaction, indexInfo);
679679
const auto embeddingDim = typeInfo.constPtrCast<common::ArrayTypeInfo>()->getNumElements();

0 commit comments

Comments
 (0)