fix: Introduce Drop() for MMapContainer and fix checkpoint related bugs#306
Closed
zhanglei1949 wants to merge 1 commit into
Closed
fix: Introduce Drop() for MMapContainer and fix checkpoint related bugs#306zhanglei1949 wants to merge 1 commit into
zhanglei1949 wants to merge 1 commit into
Conversation
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes checkpoint-related correctness issues (per #293) by ensuring dropped tables/CSRs actually release persisted state and by expanding coverage for drop/recreate and checkpoint recovery scenarios.
Changes:
- Add new Python and C++ regression tests for DROP/RECREATE and post-checkpoint visibility.
- Refactor C++ checkpoint tests into typed suites over memory levels, with shared helpers/fixtures.
- Implement
drop()paths for property columns/CSR/indexer and update graph table open semantics to avoid loading from checkpoint on newly created tables.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/python_bind/tests/test_db_query.py | Adds Python regressions for DROP/RECREATE and delete-then-reinsert visibility around checkpointing. |
| tests/storage/test_checkpoint.cc | Introduces typed checkpoint test suites and adds new DROP TABLE / edge-table checkpoint scenarios. |
| src/utils/property/table.cc | Implements Table::drop() by dropping column storage and clearing state. |
| src/storages/graph/vertex_table.cc | Extends VertexTable::Open to optionally skip loading from checkpoint. |
| src/storages/graph/property_graph.cc | Uses the new “don’t load from checkpoint” open mode for newly created tables; handles tombstoned labels. |
| src/storages/graph/edge_table.cc | Extends EdgeTable::Open similarly and adds explicit Close()/Drop() helpers. |
| src/storages/csr/mutable_csr.cc | Adds drop() implementations to delete backing files and release resources; makes snapshot open path conditional. |
| include/neug/utils/property/column.h | Adds pure-virtual drop() to columns and implements it for concrete column types. |
| include/neug/utils/id_indexer.h | Resets additional state on close() and implements file deletion in drop(). |
| include/neug/storages/graph/vertex_table.h | Adds a default ctor and extends Open() signature with load_from_checkpoint. |
| include/neug/storages/graph/edge_table.h | Extends Open() and adds Close()/Drop() declarations. |
| include/neug/storages/csr/mutable_csr.h | Declares drop() on CSR implementations. |
| include/neug/storages/csr/csr_base.h | Adds default drop() implementation delegating to close(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add Drop() to MMapContainer fix
This was referenced May 22, 2026
Member
Author
|
Will be resolved by #399 |
zhanglei1949
added a commit
that referenced
this pull request
May 25, 2026
… (#399) ## Summary Fixes #293 and implements the refactor tracked in #398. Replaces the earlier PR #306 approach with a tighter Drop/checkpoint contract that keeps file-system mutation out of the container layer. - **Drop()** at every layer releases in-memory state only; `checkpoint_dir` is touched exclusively by `Dump()`. This preserves the implicit crash-rollback semantics for DROP-before-CHECKPOINT. - **`Open()` split into `Open()` (restore from checkpoint) and `Initialize()` (fresh table).** Replaces the leaky `bool load_from_checkpoint = true` parameter. - **`Initialize()` sweeps `tmp_dir` for files keyed on the same label name/triple** before opening fresh containers. This is what unsticks the same-session DROP+CREATE stale-data path — schema reuses the numeric `label_t` for a same-name CREATE, but tmp filenames key on the string name. - **`DeleteVertexType` and `DeleteEdgeType` call `Drop()` before erasing**, making the two paths symmetric. - **`IDataContainer::Drop()` is intentionally NOT added.** In `kInMemory` / `kHugePagePreferred` modes a container's `path_` points at the checkpoint file, so a generic Drop-deletes-path contract would silently corrupt checkpoint state. See #398 for the full rationale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #293