Open
Conversation
cb3e88b to
c98fcb5
Compare
DwyaneShi
reviewed
Mar 17, 2026
| } | ||
| /* Optional: unpin on release if requested; unpin always targets latest version */ | ||
| /* Enforce RELEASE+UNPIN all-or-nothing semantics when requested: | ||
| * - If UNPIN_ON_RELEASE is set and unpin fails (e.g., NO_SUCH_KEY / UNPIN_NOT_CLOSED), |
Collaborator
There was a problem hiding this comment.
why retry on NO_SUCH_KEY / UNPIN_NOT_CLOSED?
- NO_SUCH_KEY: retrying until the same key is stored & pinned is not feasible, no one knows how long it will take
- UNPIN_NOT_CLOSED: pin count already mismatched, retrying may make the mismatch even worse, it'd better to fail earlier
Author
There was a problem hiding this comment.
It is true that there should not be retrying after a pin operation fails;
DwyaneShi
reviewed
Mar 17, 2026
| * - Then perform unpin on latest version to maintain multi-version semantics. | ||
| */ | ||
| resp = priskv_key_unpin_latest(conn->kv, keynode); | ||
| if (resp != PRISKV_RESP_STATUS_OK) { |
Collaborator
There was a problem hiding this comment.
need to cleanup if retrying does not make sense
Author
There was a problem hiding this comment.
sure , i will cleanup token in here
• Add priskv_publish_node_with_pin(kv, keynode, pin_on_publish) and make priskv_publish_node delegate to it. Publishing now runs under the hash-bucket lock, inherits pin_count from the old version, removes the old visible node, inserts the new one, and cleans up the old outside the lock—ensuring a single visible version. • Replace deprecated priskv_key_pin with priskv_key_pin_latest; update semantics so both pin and unpin operate on the latest visible version under the bucket lock, with inline expiry cleanup on miss/expired. • Transport SEAL now calls priskv_publish_node_with_pin to remove the publish→pin race; ACQUIRE uses priskv_key_pin_latest; RELEASE uses priskv_key_unpin_latest. • Add concurrency tests (two-thread and stress) to verify single-version visibility and pin_count inheritance; extend negative/permission and failure-path coverage.
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.
Pull Request Description
[Please provide a clear and concise description of your changes here]
Related Issues
Resolves: #[Insert issue number(s)]
Important: Before submitting, please complete the description above and review the checklist below.
Contribution Guidelines (Expand for Details)
We appreciate your contribution to PrisKV! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:
Pull Request Title Format
Your PR title should start with one of these prefixes to indicate the nature of the change:
[Bug]: Corrections to existing functionality[CI]: Changes to build process or CI pipeline[Docs]: Updates or additions to documentation[API]: Modifications to PrisKV's API or interface[CLI]: Changes or additions to the Command Line Interface[Misc]: For changes not covered above (use sparingly)Note: For changes spanning multiple categories, use multiple prefixes in order of importance.
Submission Checklist
By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.