Skip to content

fix: stop creating checkpoint lock files in StorageManager constructor#689

Merged
adsharma merged 1 commit into
mainfrom
fix/subgraph-checkpoint-lock-cleanup
Jul 15, 2026
Merged

fix: stop creating checkpoint lock files in StorageManager constructor#689
adsharma merged 1 commit into
mainfrom
fix/subgraph-checkpoint-lock-cleanup

Conversation

@adsharma

@adsharma adsharma commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The checkpoint intent/apply lock files (*.checkpoint.intent.lock and *.checkpoint.apply.lock) were being created as empty placeholders by every StorageManager constructor, including for subgraph databases (e.g. test.mygraph1.db). These files are unnecessary because all access (including subgraph access) goes through the main database path via clientContext.getDatabasePath().

The files are already created on demand by Checkpointer:: acquireCheckpointLocks() (with CREATE_IF_NOT_EXISTS) when a checkpoint actually starts, and cleaned up by releaseCheckpointLocks() after the checkpoint completes. Pre-creating them in the StorageManager constructor was redundant and caused stale files to leak on disk for subgraph databases that are checkpointed via collectCheckpointTargets() but never have their own locks acquired or released.

The checkpoint intent/apply lock files (*.checkpoint.intent.lock and
*.checkpoint.apply.lock) were being created as empty placeholders by
every StorageManager constructor, including for subgraph databases
(e.g. test.mygraph1.db).  These files are unnecessary because all
access (including subgraph access) goes through the main database
path via clientContext.getDatabasePath().

The files are already created on demand by Checkpointer::
acquireCheckpointLocks() (with CREATE_IF_NOT_EXISTS) when a checkpoint
actually starts, and cleaned up by releaseCheckpointLocks() after
the checkpoint completes.  Pre-creating them in the StorageManager
constructor was redundant and caused stale files to leak on disk
for subgraph databases that are checkpointed via
collectCheckpointTargets() but never have their own locks acquired
or released.
@adsharma

Copy link
Copy Markdown
Contributor Author

Cc: @ericyuanhui

@adsharma adsharma merged commit 4f3861a into main Jul 15, 2026
4 checks passed
@adsharma adsharma deleted the fix/subgraph-checkpoint-lock-cleanup branch July 15, 2026 02:05
@ericyuanhui

Copy link
Copy Markdown
Contributor

Looks perfect! No issues with this modification at all. Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants