Skip to content
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

Handling reattaching detached document in SDK #904

Closed
hackerwins opened this issue Jun 18, 2024 · 1 comment
Closed

Handling reattaching detached document in SDK #904

hackerwins opened this issue Jun 18, 2024 · 1 comment
Labels
enhancement 🌟 New feature or request

Comments

@hackerwins
Copy link
Member

hackerwins commented Jun 18, 2024

Description:

Currently, SDK provides an interface that implies the ability to reattach a detached document, as evidenced by the presence of test code within JS SDK.

However, when a specific client detaches a document, there is possibilities that tombstones of that client may be garbage collected by another peers. If an operation is generated that refers to tombstones, it could lead to a cannot find node issue.

Possible Solutions:

  1. Prevent reattaching detached documents

    • When attempting to reattach a detached document, expose an error like ErrAlreadyDetached to the user.
    • Pros: Simplifies the logic
    • Cons: Detach interface may still appear confusing as it suggests the possibility of reattachment.
  2. Allow reattaching of detached documents

    • Implement a mechanism to prevent garbage collection from occurring immediately after detachment.
    • Pros: Interface appears more intuitive
    • Cons: Potential complexity in GC functionality and error handling logic.

For now, I think it’s better to proceed with Solution 1.

Why:

@hackerwins
Copy link
Member Author

Fixed by #908.

@github-project-automation github-project-automation bot moved this from Todo to Done in Yorkie Project Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant