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: add table lock manager to fix table lock cannot be released #13434

Merged
merged 50 commits into from
Nov 2, 2023

Conversation

zhyass
Copy link
Member

@zhyass zhyass commented Oct 25, 2023

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

Summary

Add table lock manager to fix table lock cannot be released bug.

Add setting acquire_lock_timeout to set the maximum timeout in seconds for acquire a lock, the default value is 10 sec.
Move table-lock out of the ee features.

mysql> create table testc(c35 int);
Query OK, 0 rows affected (0.06 sec)

mysql> insert into testc values(1);
Query OK, 1 row affected (0.08 sec)

mysql> UPDATE testc SET c35 = (12498456046895769003 !) WHERE to_timestamp(8472945773481);
ERROR 1105 (HY000): BadArguments. Code: 1006, Text = eval try eval const failed:
unable to cast type `Timestamp` to type `Boolean NULL`.
mysql> UPDATE testc SET c35 = (12498456046895769003 !) WHERE to_timestamp(8472945773481);
ERROR 1105 (HY000): BadArguments. Code: 1006, Text = eval try eval const failed:
unable to cast type `Timestamp` to type `Boolean NULL`.

This change is Reviewable

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
databend ⬜️ Ignored (Inspect) Visit Preview Nov 2, 2023 8:47am

@zhyass zhyass marked this pull request as draft October 25, 2023 02:52
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Oct 25, 2023
@zhyass zhyass force-pushed the lock_manager branch 4 times, most recently from 5c6856a to 9951426 Compare October 25, 2023 18:38
@zhyass zhyass marked this pull request as ready for review October 26, 2023 18:05
@zhyass zhyass changed the title feat: add table lock manager feat: add table lock manager to fix table lock cannot be released Oct 27, 2023
@zhyass zhyass added ci-benchmark Benchmark: run all test and removed ci-benchmark Benchmark: run all test labels Nov 2, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Docker Image for PR

  • tag: pr-13434-c9075be

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

Copy link
Contributor

github-actions bot commented Nov 2, 2023

@drmingdrmer drmingdrmer requested a review from zhang2014 November 2, 2023 06:23
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 20 files at r4, 15 of 49 files at r6, 6 of 56 files at r7, 5 of 28 files at r12, 15 of 36 files at r13, 15 of 22 files at r14, 19 of 20 files at r16, 1 of 1 files at r17, all commit messages.
Reviewable status: all files reviewed, 10 unresolved discussions (waiting on @dantengsky, @soyeric128, @Xuanwo, @zhang2014, and @zhyass)

@zhyass zhyass enabled auto-merge November 2, 2023 08:47
@zhyass zhyass removed the request for review from soyeric128 November 2, 2023 08:48
@zhyass zhyass added this pull request to the merge queue Nov 2, 2023
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Nov 2, 2023
@BohuTANG BohuTANG merged commit b644282 into databendlabs:main Nov 2, 2023
62 checks passed
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
…tabendlabs#13434)

* Add table lock manager

* make lint

* rename to table lock holder

* Add valid check

* fix

* add metrics

* add catalog

* add test

* fix review comment

* remove unused

* fix table lock release

* add check lock

* remove unused codes

* update

* fix

* remove unused code

* make lint

* Add table lock meta

* add setting acquire_lock_timeout_secs

* rename metrics

* fix

* add user in table lock meta

* fix comment

* fix test

* rename

* update

* remove lockrequest

* rename

* fix lint

* fix review comment

* fix test

* Update src/meta/proto-conv/tests/it/proto_conv.rs

Co-authored-by: Winter Zhang <[email protected]>

* fix review comment

* add retry for lock holder

* update

---------

Co-authored-by: Winter Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-benchmark Benchmark: run all 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.

bug: If first exec update return err, the next update will return TableAlreadyLocked.
6 participants