Skip to content

Commit

Permalink
Clean update info during node group checkpoint (#4895)
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 authored Feb 14, 2025
1 parent a88d57e commit 46f2f37
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/storage/store/node_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ std::unique_ptr<ChunkedNodeGroup> NodeGroup::checkpointInMemAndOnDisk(MemoryMana
std::make_unique<ChunkedNodeGroup>(*chunkedGroups.getGroup(lock, 0), state.columnIDs);
KU_ASSERT(checkpointedChunkedGroup->getResidencyState() == ResidencyState::ON_DISK);
checkpointedChunkedGroup->resetNumRowsFromChunks();
checkpointedChunkedGroup->resetVersionAndUpdateInfo();
return checkpointedChunkedGroup;
}

Expand Down
1 change: 0 additions & 1 deletion src/storage/store/update_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "common/exception/runtime.h"
#include "common/vector/value_vector.h"
#include "storage/buffer_manager/memory_manager.h"
#include "storage/storage_utils.h"
#include "storage/store/column_chunk_data.h"
#include "transaction/transaction.h"
Expand Down
11 changes: 11 additions & 0 deletions test/storage/node_update_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,16 @@ TEST_F(NodeUpdateTest, UpdateSameRow) {
ASSERT_EQ(res->getNext()->getValue(0)->val.int64Val, 300);
}

TEST_F(NodeUpdateTest, UpdateSameRowRedundtanly) {
ASSERT_TRUE(
conn->query("CREATE NODE TABLE test (id SERIAL PRIMARY KEY, name STRING, prop STRING);")
->isSuccess());
for (auto i = 0u; i < 100; i++) {
ASSERT_TRUE(conn->query("MERGE (s:test {name: 'chunkFileNames'}) ON MATCH SET "
"s.prop=lpad('sss', 1000000, 'x');")
->isSuccess());
}
}

} // namespace testing
} // namespace kuzu

0 comments on commit 46f2f37

Please sign in to comment.