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

pessimistic-txn: eliminate CleanUpWaitFor when waiter timeouts #5157

Merged
merged 2 commits into from Jul 31, 2019

Conversation

youjiali1995
Copy link
Contributor

Signed-off-by: youjiali1995 zlwgx1023@gmail.com

What have you changed? (mandatory)

Use wait-for-lock-timeout as the TTL of the detect table. So when waiter timeouts, there is no need to send 'CleanUpWaitFor` request to the deadlock detector.

What are the type of the changes? (mandatory)

  • Improvement (change which is an improvement to an existing feature)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
@youjiali1995
Copy link
Contributor Author

@coocood @MyonKeminta @AndreMouche PTAL

@AndreMouche AndreMouche added the sig/transaction SIG: Transaction label Jul 31, 2019
@coocood
Copy link
Contributor

coocood commented Jul 31, 2019

LGTM

@@ -322,6 +322,7 @@ fn run_raft_server(pd_client: RpcClient, cfg: &TiKvConfig, security_mgr: Arc<Sec
pd_client,
resolver,
cfg.pessimistic_txn.monitor_membership_interval,
cfg.pessimistic_txn.wait_for_lock_timeout,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid there might be too many arguments. May it be better if we pass the whole cfg.pessimistic_txn?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I will file a PR to pass &cfg.pessimistic_txn to WaiterManger and Detector.

Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

) -> Self {
Self {
store_id,
leader_info: None,
leader_client: None,
// TODO: make it configurable.
detect_table: Rc::new(RefCell::new(DetectTable::new(time::Duration::from_secs(3)))),
detect_table: Rc::new(RefCell::new(DetectTable::new(time::Duration::from_millis(
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the Rc in another PR.

Copy link
Contributor

@MyonKeminta MyonKeminta left a comment

Choose a reason for hiding this comment

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

LGTM

@youjiali1995 youjiali1995 merged commit 5024ad0 into tikv:master Jul 31, 2019
@youjiali1995 youjiali1995 deleted the utilize-expiring-detect-table branch July 31, 2019 03:43
youjiali1995 added a commit to youjiali1995/tikv that referenced this pull request Aug 5, 2019
…v#5157)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
YangKeao added a commit to YangKeao/tikv that referenced this pull request Sep 5, 2019
sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
…v#5157)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG: Transaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants