-
Notifications
You must be signed in to change notification settings - Fork 614
HDDS-13004. Snapshot Cache lock on a specific snapshotId #9210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -288,14 +288,26 @@ public void release(UUID key) { | |||||||||||||
| */ | ||||||||||||||
| public UncheckedAutoCloseableSupplier<OMLockDetails> lock() { | ||||||||||||||
| return lock(() -> lock.acquireResourceWriteLock(SNAPSHOT_DB_LOCK), | ||||||||||||||
| () -> lock.releaseResourceWriteLock(SNAPSHOT_DB_LOCK)); | ||||||||||||||
| () -> lock.releaseResourceWriteLock(SNAPSHOT_DB_LOCK), () -> cleanup(true)); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| private UncheckedAutoCloseableSupplier<OMLockDetails> lock( | ||||||||||||||
| Supplier<OMLockDetails> lockFunction, Supplier<OMLockDetails> unlockFunction) { | ||||||||||||||
| /** | ||||||||||||||
| * Acquires a write lock on a specific snapshot database and returns an auto-closeble supplier for lock details. | ||||||||||||||
| * The lock ensures that the operations accessing the snapshot database are perfromed in a thread safe manner. The | ||||||||||||||
| * returned supplier automatically releases the lock acquired when closed, preveneting potential resource | ||||||||||||||
|
||||||||||||||
| * Acquires a write lock on a specific snapshot database and returns an auto-closeble supplier for lock details. | |
| * The lock ensures that the operations accessing the snapshot database are perfromed in a thread safe manner. The | |
| * returned supplier automatically releases the lock acquired when closed, preveneting potential resource | |
| * Acquires a write lock on a specific snapshot database and returns an auto-closeable supplier for lock details. | |
| * The lock ensures that the operations accessing the snapshot database are performed in a thread safe manner. The | |
| * returned supplier automatically releases the lock acquired when closed, preventing potential resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we closing the snapshot instance upon acquiring a lock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want a rocksdb open in the cache once a write lock has been acquired. We would be using this for atomically switching the rocksdb directory after defragging a snapshot
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical error: 'instances that has' should be 'instances that have' for subject-verb agreement.
| instances that has zero reference count. | |
| instances that have zero reference count. |
Uh oh!
There was an error while loading. Please reload this page.