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

feat: compact and recluster add table lock #15632

Merged
merged 3 commits into from
May 28, 2024

Conversation

zhyass
Copy link
Member

@zhyass zhyass commented May 23, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This PR introduces the following enhancements:

  1. Addition of LockTableOption Enum:

    • NoLock: No lock will be applied.
    • LockWithRetry: Attempts to acquire a lock and retries until a timeout is reached.
    • LockNoRetry: Attempts to acquire a lock without retrying on failure.
  2. Global Table Lock for optimize and recluster Operations:

    • Implements a global table lock mechanism for optimize and recluster operations.
    • Currently, only insert, copy, and replace do not apply table locks
  3. Compact Hook with Locking Mechanism:

    • The compact hook if need lock, it will attempts to acquire a lock using the LockNoRetry option. If the lock acquisition fails, the operation returns immediately without retrying.
  4. Fix: Refresh Table After Acquiring Lock:

    • Added logic to refresh the table after successfully acquiring a lock, ensuring the table state is up-to-date.

Fixes #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label May 23, 2024
@zhyass zhyass marked this pull request as draft May 23, 2024 14:43
@zhyass zhyass force-pushed the feat_stream branch 3 times, most recently from e196c06 to 7dc64d8 Compare May 24, 2024 05:57
@zhyass zhyass marked this pull request as ready for review May 24, 2024 07:43
@zhyass zhyass added the ci-cloud Build docker image for cloud test label May 24, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-15632-7a319d7

note: this image tag is only available for internal use,
please check the internal doc for more details.

@dantengsky dantengsky added this pull request to the merge queue May 28, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request May 28, 2024
@BohuTANG BohuTANG merged commit 10d1952 into datafuselabs:main May 28, 2024
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cloud Build docker image for cloud test pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants