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

Improve GC for deactivated client's nodes #926

Merged
merged 11 commits into from
Nov 20, 2024

Conversation

JOOHOJANG
Copy link
Contributor

@JOOHOJANG JOOHOJANG commented Nov 7, 2024

What this PR does / why we need it?

If a node created by a deactivated client remains in the document, it means that the garbage collection did not run. The existing GC logic compares the Lamport of the node's ticket with the min version vector based on actor information. However, the min version vector does not contain information about the deactivated client.

To handle this case, when the actor information in the ticket is missing in the min version vector, we retrieve the minimum value from the min version vector. If this minimum value is greater than the Lamport in the ticket, the node is removed.

The reason is that a higher minimum value in the min version vector implies that all users have received that change, indicating it is safe to delete.

+)
I updated garbage collection design document includes this PR's information.
If you want to know, please read it.yorkie-team/yorkie#1061

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new method to calculate the minimum lamport timestamp in the VersionVector class.
    • Enhanced the functionality of the afterOrEqual method to utilize the new minimum lamport feature.
  • Tests

    • Added new test cases to improve garbage collection coverage, focusing on scenarios involving deactivated clients and document lifecycle management.
    • Implemented comprehensive tests for the Tree class, covering creation, editing, synchronization, and error handling to ensure robustness across various scenarios.

@JOOHOJANG JOOHOJANG requested a review from hackerwins November 7, 2024 07:39
Copy link

coderabbitai bot commented Nov 7, 2024

Walkthrough

The changes introduce a new method called minLamport to the VersionVector class, which calculates the minimum lamport timestamp from the vector. Additionally, the afterOrEqual method has been updated to utilize minLamport, allowing it to return a boolean based on the minimum lamport when the actor ID is not found in the vector. Furthermore, new test cases for garbage collection behavior related to deactivated clients have been added, enhancing the coverage of garbage collection scenarios.

Changes

File Path Change Summary
packages/sdk/src/document/time/version_vector.ts Added public minLamport() method to calculate the minimum lamport timestamp; modified afterOrEqual method to use minLamport.
packages/sdk/test/integration/gc_test.ts Added two new test cases for garbage collection behavior related to deactivated clients and document lifecycle management.
packages/sdk/test/integration/tree_test.ts Added comprehensive tests for the Tree class covering creation, editing, synchronization, and error handling.

Sequence Diagram(s)

sequenceDiagram
    participant A as Actor
    participant V as VersionVector
    participant T as TimeTicket

    A->>V: Call afterOrEqual(actorId)
    V->>V: Check if actorId exists
    alt Actor ID found
        V-->>A: Return boolean based on existing lamport
    else Actor ID not found
        V->>V: Call minLamport()
        V-->>A: Return boolean based on minLamport and TimeTicket
    end
Loading

🐇 "In the vector's dance, we find the least,
A timestamp small, our worries ceased.
With afterOrEqual, we check with glee,
The minimum's magic sets our logic free!
Hopping through code, with joy we sing,
New methods and changes, oh what joy they bring!" 🐇

Possibly related PRs

  • Introducing version vector to solve GC problem #899: The changes in this PR introduce substantial enhancements to the converter.ts file, focusing on the integration of VersionVector, which is directly related to the new minLamport method added in the main PR.
  • Ensure find and indexOf perform splay #904: This PR modifies the SplayTree class, but it does not directly relate to the changes in the VersionVector class or the minLamport method. However, it is included here for completeness as it deals with tree structures, which may have indirect implications in the broader context of the SDK.
  • Modify Snapshot Event to publish updated local changes #923: This PR addresses the Snapshot Event to ensure it publishes updated local changes, which may involve the VersionVector indirectly as it relates to the state of documents and their changes.
  • Add keepalive option in client.deactivate #928: This PR enhances the client deactivation process, which may involve version vectors in the context of garbage collection, linking it to the main PR's focus on the VersionVector class.

Suggested reviewers

  • chacha912
  • cloneot

Warning

Rate limit exceeded

@hackerwins has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 2846be1 and 17926ef.

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/sdk/test/integration/gc_test.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "/packages/sdk".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in "packages/sdk/.eslintrc.js » ../../.eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 924ba4c and 5e3fdfb.

📒 Files selected for processing (1)
  • packages/sdk/src/document/time/version_vector.ts (2 hunks)
🔇 Additional comments (1)
packages/sdk/src/document/time/version_vector.ts (1)

Line range hint 61-117: Verify GC behavior with these changes

The implementation aligns with the PR objectives for improving garbage collection of nodes from deactivated clients. Let's verify the behavior:

Please ensure that:

  1. The GC logic properly uses these changes to clean up nodes from deactivated clients
  2. Test cases cover scenarios with both active and deactivated clients
  3. Edge cases are tested (empty vector, single client, all clients deactivated)

packages/sdk/src/document/time/version_vector.ts Outdated Show resolved Hide resolved
packages/sdk/src/document/time/version_vector.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
packages/sdk/test/integration/gc_test.ts (3)

1603-1698: Test case needs enhancement for better verification.

The test case structure is good but could be improved in several ways:

  1. Add descriptive messages to assertions to clarify what's being tested:
-    assert.equal(doc2.getGarbageLen(), 2);
-    assert.equal(doc2.getVersionVector().size(), 2);
+    assert.equal(doc2.getGarbageLen(), 2, 'Should have 2 garbage nodes after client1 deactivation');
+    assert.equal(doc2.getVersionVector().size(), 2, 'Version vector should still contain both clients');
  1. Add verification of document content to ensure data integrity:
     await client1.deactivate();
+    assert.equal(doc2.getRoot().t.toString(), 'a', 'Document content should be "a" after deletions');
     assert.equal(doc2.getGarbageLen(), 2);

1692-1694: TODO comment needs more context.

The TODO comment references issue #1058 but doesn't explain the impact on this test. Consider adding more context about what behavior is expected once the issue is resolved.

Consider updating the comment to:

-    // TODO(JOOHOJANG): remove below comments after https://github.com/yorkie-team/yorkie/issues/1058 resolved
-    // Due to https://github.com/yorkie-team/yorkie/issues/1058, removing deactivated client's version vector is not working properly now.
+    // TODO(JOOHOJANG): Enable these assertions after https://github.com/yorkie-team/yorkie/issues/1058 is resolved
+    // Currently, the deactivated client's version vector is not properly removed from the document
+    // Expected behavior: After client deactivation and sync, the version vector should only contain
+    // the active client, and garbage nodes should be collected

1695-1697: Consider adding test coverage for partial functionality.

While the complete test is blocked by issue #1058, consider adding assertions for the functionality that does work correctly. This will help catch regressions in the working parts while waiting for the issue to be resolved.

-    //await client2.sync();
-    //assert.equal(doc2.getGarbageLen(), 0);
-    //assert.equal(doc2.getVersionVector().size(), 1);
+    // Verify current behavior while issue #1058 is pending
+    await client2.sync();
+    assert.equal(doc2.getRoot().t.toString(), 'a', 'Document content should remain stable after sync');
+    // TODO: Following assertions will be enabled after #1058 is resolved
+    // assert.equal(doc2.getGarbageLen(), 0, 'Garbage should be collected after sync');
+    // assert.equal(doc2.getVersionVector().size(), 1, 'Version vector should only contain active client');
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5e3fdfb and b46a7b6.

📒 Files selected for processing (1)
  • packages/sdk/test/integration/gc_test.ts (1 hunks)

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.
I left a comment.

packages/sdk/src/document/time/version_vector.ts Outdated Show resolved Hide resolved
@JOOHOJANG JOOHOJANG requested a review from hackerwins November 8, 2024 03:46
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
packages/sdk/src/document/time/version_vector.ts (1)

Line range hint 61-118: Consider caching minLamport for performance optimization.

Since minLamport is used for garbage collection decisions and could be called frequently, consider:

  1. Caching the minimum value and updating it only when the vector changes
  2. Adding a method to check if a vector has changed since the last minLamport calculation

This would improve performance for garbage collection operations, especially in large documents with many deactivated clients.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b46a7b6 and 2795800.

📒 Files selected for processing (1)
  • packages/sdk/src/document/time/version_vector.ts (2 hunks)
🔇 Additional comments (1)
packages/sdk/src/document/time/version_vector.ts (1)

116-118: Previous review comment about logical inconsistency is still valid.

The logical inconsistency between the method name (afterOrEqual) and the implementation (using strict >) remains an issue.

packages/sdk/src/document/time/version_vector.ts Outdated Show resolved Hide resolved
@JOOHOJANG
Copy link
Contributor Author

I found some defection in min version vector algorithm while watching CI failure.

To summarize briefly, there is a case where the min version vector is empty.

When the last user detaches a document, all documents are in a detached state, so an empty min version vector is created at the time of generation. While pushpulling this detach change, we end up receiving an empty min version vector, and in trying to calculate minLamport from this empty min version vector, we get an int64Max value. Therefore gc runs and error occured.

In my opinion, except for this specific case (where the last document detaches), this situation is unlikely to occur otherwise. So, I think adding an exception handling should resolve it. What do you think? @hackerwins

Error occured because of split operation's defec. When applying remote split operation, tombstone-marked node doesn't carried by its parent.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
packages/sdk/test/integration/gc_test.ts (3)

1692-1693: Track the version vector removal issue.

The TODO comment references issue #1058 regarding the improper removal of deactivated client's version vector. Consider adding a link to the issue for better tracking.

-    // TODO(JOOHOJANG): remove below comments after https://github.com/yorkie-team/yorkie/issues/1058 resolved
-    // Due to https://github.com/yorkie-team/yorkie/issues/1058, removing deactivated client's version vector is not working properly now.
+    // TODO(JOOHOJANG): Remove these comments after https://github.com/yorkie-team/yorkie/issues/1058 is resolved.
+    // See: https://github.com/yorkie-team/yorkie/issues/1058
+    // Issue: Removing deactivated client's version vector is not working properly.

1700-1702: Consider shortening the test name for better readability.

The test name is quite long and could be more concise while maintaining clarity.

-  it('attach > pushpull > detach lifecycle version vector test (run gc at last client detaches document, but no tombstones)', async function ({
+  it('should run gc when last client detaches (no tombstones)', async function ({

2034-2096: Improve documentation of skipped test case.

The test case contains valuable information about error scenarios but could benefit from more structured documentation. Consider adding JSDoc comments to clearly document:

  1. The purpose of the test
  2. The error conditions being tested
  3. The expected behavior once fixed

Add JSDoc comments before the test:

/**
 * Tests error handling when GC runs with empty min version vector.
 * 
 * Current issues:
 * 1. Empty min version vector when last client detaches
 * 2. Int64max value returned from VersionVector.minLamport()
 * 3. Premature removal of tombstones affects split operations
 * 
 * @see Related issue: [Add issue link here]
 */
it.skip('attach > pushpull > detach lifecycle...')
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f9126b2 and 42523c9.

📒 Files selected for processing (1)
  • packages/sdk/test/integration/gc_test.ts (1 hunks)
🔇 Additional comments (1)
packages/sdk/test/integration/gc_test.ts (1)

1603-2096: Well-structured test cases with good coverage.

The new test cases effectively cover important edge cases in the garbage collection logic, particularly around client deactivation and document lifecycle. The tests are well-organized with clear stages:

  1. Setup and client activation
  2. Document manipulation
  3. Synchronization
  4. Verification of GC behavior

The test assertions and version vector checks provide good validation of the system's behavior.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (10)
packages/sdk/test/integration/gc_test.ts (4)

1692-1694: Track the blocking issue for deactivated client's version vector.

The TODO comment indicates a known issue (#1058) that prevents proper removal of the deactivated client's version vector. Consider adding a link to the issue in the comment for better tracking.

-// TODO(JOOHOJANG): remove below comments after https://github.com/yorkie-team/yorkie/issues/1058 resolved
-// Due to https://github.com/yorkie-team/yorkie/issues/1058, removing deactivated client's version vector is not working properly now.
+// TODO(JOOHOJANG): Uncomment assertions below after fixing https://github.com/yorkie-team/yorkie/issues/1058
+// Issue: Removing deactivated client's version vector is not working properly
+// Tracking: https://github.com/yorkie-team/yorkie/issues/1058

1603-1698: Test case looks good but could be improved.

The test case effectively verifies garbage collection behavior with deactivated clients. However, consider adding more assertions to verify the document state and content after client deactivation.

Consider adding these assertions:

 await client1.deactivate();
 assert.equal(doc2.getGarbageLen(), 2);
 assert.equal(doc2.getVersionVector().size(), 2);
+assert.equal(doc2.getRoot().t.toString(), 'a');  // Verify final text content
+assert.equal(doc1.getRoot().t.toString(), 'a');  // Verify both docs are in sync

1700-1700: Fix typo in test name.

There's a typo in the test name: 'exsits' should be 'exists'.

-  it('attach > pushpull > detach lifecycle version vector test (run gc at last client detaches document, but no tombstone exsits)', async function ({
+  it('attach > pushpull > detach lifecycle version vector test (run gc at last client detaches document, but no tombstone exists)', async function ({

1700-1869: Test case is thorough but could be more maintainable.

The test effectively verifies the garbage collection behavior during the document lifecycle. However, the test could be more maintainable by extracting repeated version vector assertions into a helper function.

Consider creating a helper function:

function assertVersionVector(doc: Document, expected: Array<{actor: string, lamport: bigint}>) {
  assert.equal(
    versionVectorHelper(doc.getVersionVector(), expected),
    true,
  );
}

This would reduce code duplication and make the test more maintainable.

packages/sdk/test/integration/tree_test.ts (6)

Line range hint 2481-2488: Implement the skipped test 'contained-split-and-delete-the-whole-original-and-split-nodes'

The test contained-split-and-delete-the-whole-original-and-split-nodes is marked as skipped. Implementing this test is important to validate the behavior when both the original and split nodes are deleted after a split operation. This will help ensure the robustness of the split and delete functionalities under concurrent conditions.

I'm happy to help implement this test case or debug any related issues.


Line range hint 2535-2540: Consider enabling the skipped test 'contained-merge-and-merge-at-the-same-level'

The test contained-merge-and-merge-at-the-same-level is currently skipped. If this test is stable and passes, consider removing the .skip to include it in the test suite. Enabling this test will enhance coverage for merge operations occurring at the same level.


Line range hint 2557-2563: Ensure the test 'contained-merge-and-insert' is implemented and passing

The test contained-merge-and-insert is skipped. Implementing this test will help verify the correctness of concurrent merge and insert operations, which is crucial for maintaining data integrity in concurrent editing scenarios.

Let me know if you need assistance in implementing this test case.


Line range hint 2587-2593: Enable or remove the skipped test 'contained-merge-and-delete-contents-in-merged-node'

The test contained-merge-and-delete-contents-in-merged-node is currently skipped. If the test is ready and passes, please enable it to increase test coverage. If it's no longer needed, consider removing it to keep the test suite clean.


Line range hint 2610-2617: Implement or remove the skipped test 'side-by-side-merge-and-insert'

The test side-by-side-merge-and-insert is marked as skipped. Implementing this test will help ensure the correctness of concurrent side-by-side merge and insert operations, which is important for handling complex concurrent edits.


Line range hint 2635-2642: Consider implementing the skipped test 'side-by-side-merge-and-delete'

The test side-by-side-merge-and-delete is currently skipped. Enabling this test after implementation will help validate the behavior of side-by-side merge and delete operations under concurrent scenarios.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 42523c9 and 8adb6ed.

📒 Files selected for processing (2)
  • packages/sdk/test/integration/gc_test.ts (1 hunks)
  • packages/sdk/test/integration/tree_test.ts (1 hunks)
🔇 Additional comments (1)
packages/sdk/test/integration/tree_test.ts (1)

Line range hint 2678-2686: Review the need for the skipped test 'contained-split-and-delete-contents-in-split-node'

The test contained-split-and-delete-contents-in-split-node is skipped and includes a comment about a split operation defect causing a GC error. If this issue has been resolved, consider implementing the test. Otherwise, updating the comment with the current status would be helpful.

Comment on lines 2465 to 2468
// TODO(JOOHOJANG)
// split operation's defect cause GC error.
// remove this comment after implement split operation completely.
it.skip('contained-split-and-delete-contents-in-split-node', async function ({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Address the TODO comment and implement the skipped test

The test contained-split-and-delete-contents-in-split-node is currently skipped and includes a TODO comment indicating that a defect in the split operation causes a GC error. To ensure comprehensive test coverage and verify the split operation's functionality, please implement this test case and remove the TODO comment once the issue is resolved.

Would you like assistance in addressing the split operation defect and implementing this test case?

@hackerwins hackerwins force-pushed the add-min-lamport-to-run-gc-properly branch from 8d69b61 to 2846be1 Compare November 20, 2024 12:48
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8d69b61 and 2846be1.

📒 Files selected for processing (2)
  • packages/sdk/src/document/time/version_vector.ts (2 hunks)
  • packages/sdk/test/integration/tree_test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/sdk/test/integration/tree_test.ts
🔇 Additional comments (1)
packages/sdk/src/document/time/version_vector.ts (1)

Line range hint 61-119: Consider distributed system implications

The changes to minLamport and afterOrEqual affect garbage collection behavior in a distributed setting. Please ensure:

  1. The new behavior maintains causal consistency across the distributed system
  2. Edge cases like network partitions and concurrent modifications are handled correctly
  3. Consider adding logging for debugging GC-related issues in production
  4. Document the GC behavior changes in the system architecture documentation

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
packages/sdk/test/integration/gc_test.ts (1)

1697-1697: Fix typo in test name

There's a typo in the test name: "exsits" should be "exists"

-  it('attach > pushpull > detach lifecycle version vector test (run gc at last client detaches document, but no tombstone exsits)', async function ({
+  it('attach > pushpull > detach lifecycle version vector test (run gc at last client detaches document, but no tombstone exists)', async function ({
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2846be1 and 17926ef.

📒 Files selected for processing (1)
  • packages/sdk/test/integration/gc_test.ts (1 hunks)
🔇 Additional comments (1)
packages/sdk/test/integration/gc_test.ts (1)

1603-2030: Well-structured test cases with comprehensive coverage

The new test cases effectively cover important garbage collection scenarios:

  1. Garbage collection behavior with deactivated clients
  2. Version vector lifecycle during document attachment/detachment

The tests are well-structured with clear setup, actions, and assertions. They help ensure the reliability of the garbage collection mechanism.

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

@hackerwins hackerwins changed the title Add minLamport to run gc properly Improve GC for deactivated client's nodes Nov 20, 2024
@hackerwins hackerwins merged commit bc21a84 into main Nov 20, 2024
2 checks passed
@hackerwins hackerwins deleted the add-min-lamport-to-run-gc-properly branch November 20, 2024 13:09
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