Skip to content

Commit

Permalink
clean update info during node group checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed Feb 14, 2025
1 parent 4ddee1b commit 07e058e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
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
19 changes: 16 additions & 3 deletions test/storage/node_update_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class NodeUpdateTest : public EmptyDBTest {
};

TEST_F(NodeUpdateTest, UpdateSameRow) {
ASSERT_TRUE(conn->query("CREATE NODE TABLE IF NOT EXISTS Product (item STRING, price INT64, "
"PRIMARY KEY (item))")
->isSuccess());
ASSERT_TRUE(
conn->query("CREATE NODE TABLE IF NOT EXISTS Product (item STRING, price INT64, "
"PRIMARY KEY (item))")
->isSuccess());
ASSERT_TRUE(conn->query("CREATE (n:Product {item: 'watch'}) SET n.price = 100")->isSuccess());
ASSERT_TRUE(
conn->query("MATCH (n:Product) WHERE n.item = 'watch' SET n.price = 200")->isSuccess());
Expand All @@ -27,5 +28,17 @@ 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 07e058e

Please sign in to comment.