-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Return ErrAlreadyDetached when reattaching #908
Conversation
This commit addresses the need for handling reattaching detached documents. When reattaching a document that was previously detached, special processing is required to prevent attachment in cases where tombstone nodes may have been garbage collected by another client during editing.
Warning Review failedThe pull request is closed. WalkthroughThe changes primarily add an Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
What this PR does / why we need it:
Return ErrAlreadyDetached when reattaching
This commit addresses the need for handling reattaching detached
documents. When reattaching a document that was previously detached,
special processing is required to prevent attachment in cases where
tombstone nodes may have been garbage collected by another client during
editing.
If attaching a new document with the same key, it should attach normally.
Therefore, there needs to be a distinction between attaching a new
document and reattaching.
While there is no difference in DB.ClientInfo, the Request ChangePack's
Checkpoint.ServerSeq value can be used to distinguish between attaching
a new document and reattaching a detached document. In cases where
Checkpoint.ServerSeq is greater than 0, the ErrAlreadyDetached error
should be returned.
Which issue(s) this PR fixes:
Addresses #904
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests