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

txn: use start_ts + 1 as Flush's min_commit_ts #16881

Merged
merged 2 commits into from Apr 19, 2024

Conversation

ekexium
Copy link
Contributor

@ekexium ekexium commented Apr 18, 2024

What is changed and how it works?

Issue Number: Close #16880

What's Changed:

The PR fixes the problem that locks written by pipelined-dml block reads.
Now min_commit_ts was set to start_ts + 1 for Flush commands. 
Previously it was set to 0, which disallows pushing min_commit_ts.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

None

Copy link
Contributor

ti-chi-bot bot commented Apr 18, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • cfzjywxk
  • you06

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: ekexium <eke@fastmail.com>
@ekexium ekexium force-pushed the pipelined-dml-flush-min-commit-ts branch from db45471 to bf8bd28 Compare April 18, 2024 11:14
@ekexium ekexium requested review from cfzjywxk and you06 April 18, 2024 11:15
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Status: PR - There is already 1 approval label Apr 18, 2024
@@ -123,7 +123,8 @@ impl Flush {
// txn_size is unknown, set it to max to avoid unexpected resolve_lock_lite
txn_size: u64::MAX,
lock_ttl: self.lock_ttl,
min_commit_ts: TimeStamp::zero(),
// min_commit_ts == 0 will disallow readers pushing it
min_commit_ts: self.start_ts.next(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the min_commit_ts be passed from the Flush kv request?

Copy link
Contributor Author

@ekexium ekexium Apr 19, 2024

Choose a reason for hiding this comment

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

It could be. But in current implementation we don't have to. We can change it in the future when needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to use the min_commit_ts from the FlushRequest I think, otherwise that field would always be coverd.

@@ -123,7 +123,8 @@ impl Flush {
// txn_size is unknown, set it to max to avoid unexpected resolve_lock_lite
txn_size: u64::MAX,
lock_ttl: self.lock_ttl,
min_commit_ts: TimeStamp::zero(),
// min_commit_ts == 0 will disallow readers pushing it
min_commit_ts: self.start_ts.next(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to use the min_commit_ts from the FlushRequest I think, otherwise that field would always be coverd.

@ti-chi-bot ti-chi-bot bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Apr 19, 2024
@ekexium
Copy link
Contributor Author

ekexium commented Apr 19, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented Apr 19, 2024

@ekexium: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Copy link
Contributor

ti-chi-bot bot commented Apr 19, 2024

This pull request has been accepted and is ready to merge.

Commit hash: bf8bd28

@ti-chi-bot ti-chi-bot bot added the status/can-merge Status: Can merge to base branch label Apr 19, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 19, 2024

@ekexium: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 05bc952 into tikv:master Apr 19, 2024
7 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Apr 19, 2024
ekexium added a commit to ekexium/tikv that referenced this pull request Apr 23, 2024
close tikv#16880

The PR fixes the problem that locks written by pipelined-dml block reads.
Now min_commit_ts was set to start_ts + 1 for Flush commands. 
Previously it was set to 0, which disallows pushing min_commit_ts.

Signed-off-by: ekexium <eke@fastmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #16902.

ti-chi-bot bot added a commit that referenced this pull request Apr 23, 2024
close #16880

The PR fixes the problem that locks written by pipelined-dml block reads.
Now min_commit_ts was set to start_ts + 1 for Flush commands. 
Previously it was set to 0, which disallows pushing min_commit_ts.

Signed-off-by: ekexium <eke@fastmail.com>

Co-authored-by: ekexium <eke@fastmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-8.1 release-note-none size/S status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipelined DML locks blocks read
4 participants