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: Support check for_update_ts when prewriting #14492

Merged
merged 24 commits into from Apr 12, 2023

Conversation

MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented Mar 30, 2023

What is changed and how it works?

Issue Number: Ref #14311
Requires: pingcap/kvproto#1096

What's Changed:

Supports checking for_update_ts for specific keys during prewrite to avoid potential lost update that might be caused by allowing locking with conflict.

Related changes

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

Check List

Tests

(TODO)

  • Unit test
  • Integration test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

None

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 30, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • cfzjywxk
  • ekexium

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: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot ti-chi-bot added size/XL and removed size/L labels Mar 31, 2023
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta MyonKeminta force-pushed the m/prewrite-check-for-update-ts branch from 65d8386 to 97fdd06 Compare April 4, 2023 07:05
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
…her PR

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta MyonKeminta marked this pull request as ready for review April 6, 2023 13:44
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot
Copy link
Member

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

Commit hash: e85a9ad

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Apr 11, 2023
@MyonKeminta
Copy link
Contributor Author

/test

1 similar comment
@MyonKeminta
Copy link
Contributor Author

/test

@MyonKeminta
Copy link
Contributor Author

????
/test

@MyonKeminta
Copy link
Contributor Author

Why adding the need-cherry-pick-release-7.0 tag while 7.0 is a DMR version that rejects any more updates?

@MyonKeminta
Copy link
Contributor Author

[2023-04-12T07:29:51.450Z] thread 'test_merge::test_merge' panicked at 'assertion failed: `(left == right)`
[2023-04-12T07:29:51.450Z]   left: `[107, 52]`,
[2023-04-12T07:29:51.450Z]  right: `[107, 51]`', components/raftstore-v2/tests/integrations/cluster.rs:869:17
[2023-04-12T07:29:51.450Z] stack backtrace:
[2023-04-12T07:29:51.450Z]    0: rust_begin_unwind
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/std/src/panicking.rs:575:5
[2023-04-12T07:29:51.450Z]    1: core::panicking::panic_fmt
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/panicking.rs:65:14
[2023-04-12T07:29:51.450Z]    2: core::panicking::assert_failed_inner
[2023-04-12T07:29:51.450Z]    3: core::panicking::assert_failed
[2023-04-12T07:29:51.450Z]    4: raftstore_v2_integrations::cluster::merge_helper::merge_region
[2023-04-12T07:29:51.450Z]    5: raftstore_v2_integrations::test_merge::test_merge
[2023-04-12T07:29:51.450Z]    6: raftstore_v2_integrations::test_merge::test_merge::{{closure}}
[2023-04-12T07:29:51.450Z]    7: core::ops::function::FnOnce::call_once
[2023-04-12T07:29:51.450Z]    8: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
[2023-04-12T07:29:51.450Z]    9: core::ops::function::FnOnce::call_once{{vtable.shim}}
[2023-04-12T07:29:51.450Z]   10: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/alloc/src/boxed.rs:2000:9
[2023-04-12T07:29:51.450Z] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2023-04-12T07:29:51.450Z] 
[2023-04-12T07:29:51.450Z]    TRY 3 TMT [ 120.037s] raftstore-v2::raftstore-v2-integrations test_transfer_leader::test_transfer_leader
[2023-04-12T07:29:51.450Z] 
[2023-04-12T07:29:51.450Z] --- TRY 3 STDOUT:        raftstore-v2::raftstore-v2-integrations test_transfer_leader::test_transfer_leader ---
[2023-04-12T07:29:51.451Z] thread 'cases::test_pd_client::test_retry' panicked at 'called `Result::unwrap()` on an `Err` value: Other("[components/pd_client/src/client_v2.rs:312]: Connection unavailable GRPC_CHANNEL_TRANSIENT_FAILURE")', tests/failpoints/cases/test_pd_client.rs:147:42
[2023-04-12T07:29:51.451Z] stack backtrace:
[2023-04-12T07:29:51.451Z]    0: rust_begin_unwind
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/std/src/panicking.rs:575:5
[2023-04-12T07:29:51.451Z]    1: core::panicking::panic_fmt
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/panicking.rs:65:14
[2023-04-12T07:29:51.451Z]    2: core::result::unwrap_failed
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/result.rs:1791:5
[2023-04-12T07:29:51.451Z]    3: core::result::Result<T,E>::unwrap
[2023-04-12T07:29:51.451Z]    4: failpoints::cases::test_pd_client::run_on_bad_connection
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:147:9
[2023-04-12T07:29:51.451Z]    5: failpoints::cases::test_pd_client::test_retry::test_retry_success
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:201:13
[2023-04-12T07:29:51.451Z]    6: failpoints::cases::test_pd_client::test_retry
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:212:5
[2023-04-12T07:29:51.451Z]    7: failpoints::cases::test_pd_client::test_retry::{{closure}}
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:186:17
[2023-04-12T07:29:51.451Z]    8: core::ops::function::FnOnce::call_once
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/ops/function.rs:513:5
[2023-04-12T07:29:51.451Z]    9: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
[2023-04-12T07:29:51.451Z]   10: core::ops::function::FnOnce::call_once{{vtable.shim}}
[2023-04-12T07:29:51.451Z]   11: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/alloc/src/boxed.rs:2000:9

Are these tests always as unstable as this? I don't think this PR has anything to do with them

@MyonKeminta
Copy link
Contributor Author

/test

1 similar comment
@MyonKeminta
Copy link
Contributor Author

/test

@MyonKeminta
Copy link
Contributor Author

/test

@MyonKeminta
Copy link
Contributor Author

/test

2 similar comments
@MyonKeminta
Copy link
Contributor Author

/test

@MyonKeminta
Copy link
Contributor Author

/test

@MyonKeminta
Copy link
Contributor Author

[2023-04-12T07:29:51.450Z] thread 'test_merge::test_merge' panicked at 'assertion failed: `(left == right)`
[2023-04-12T07:29:51.450Z]   left: `[107, 52]`,
[2023-04-12T07:29:51.450Z]  right: `[107, 51]`', components/raftstore-v2/tests/integrations/cluster.rs:869:17
[2023-04-12T07:29:51.450Z] stack backtrace:
[2023-04-12T07:29:51.450Z]    0: rust_begin_unwind
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/std/src/panicking.rs:575:5
[2023-04-12T07:29:51.450Z]    1: core::panicking::panic_fmt
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/panicking.rs:65:14
[2023-04-12T07:29:51.450Z]    2: core::panicking::assert_failed_inner
[2023-04-12T07:29:51.450Z]    3: core::panicking::assert_failed
[2023-04-12T07:29:51.450Z]    4: raftstore_v2_integrations::cluster::merge_helper::merge_region
[2023-04-12T07:29:51.450Z]    5: raftstore_v2_integrations::test_merge::test_merge
[2023-04-12T07:29:51.450Z]    6: raftstore_v2_integrations::test_merge::test_merge::{{closure}}
[2023-04-12T07:29:51.450Z]    7: core::ops::function::FnOnce::call_once
[2023-04-12T07:29:51.450Z]    8: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
[2023-04-12T07:29:51.450Z]    9: core::ops::function::FnOnce::call_once{{vtable.shim}}
[2023-04-12T07:29:51.450Z]   10: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[2023-04-12T07:29:51.450Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/alloc/src/boxed.rs:2000:9
[2023-04-12T07:29:51.450Z] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2023-04-12T07:29:51.450Z] 
[2023-04-12T07:29:51.450Z]    TRY 3 TMT [ 120.037s] raftstore-v2::raftstore-v2-integrations test_transfer_leader::test_transfer_leader
[2023-04-12T07:29:51.450Z] 
[2023-04-12T07:29:51.450Z] --- TRY 3 STDOUT:        raftstore-v2::raftstore-v2-integrations test_transfer_leader::test_transfer_leader ---
[2023-04-12T07:29:51.451Z] thread 'cases::test_pd_client::test_retry' panicked at 'called `Result::unwrap()` on an `Err` value: Other("[components/pd_client/src/client_v2.rs:312]: Connection unavailable GRPC_CHANNEL_TRANSIENT_FAILURE")', tests/failpoints/cases/test_pd_client.rs:147:42
[2023-04-12T07:29:51.451Z] stack backtrace:
[2023-04-12T07:29:51.451Z]    0: rust_begin_unwind
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/std/src/panicking.rs:575:5
[2023-04-12T07:29:51.451Z]    1: core::panicking::panic_fmt
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/panicking.rs:65:14
[2023-04-12T07:29:51.451Z]    2: core::result::unwrap_failed
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/result.rs:1791:5
[2023-04-12T07:29:51.451Z]    3: core::result::Result<T,E>::unwrap
[2023-04-12T07:29:51.451Z]    4: failpoints::cases::test_pd_client::run_on_bad_connection
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:147:9
[2023-04-12T07:29:51.451Z]    5: failpoints::cases::test_pd_client::test_retry::test_retry_success
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:201:13
[2023-04-12T07:29:51.451Z]    6: failpoints::cases::test_pd_client::test_retry
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:212:5
[2023-04-12T07:29:51.451Z]    7: failpoints::cases::test_pd_client::test_retry::{{closure}}
[2023-04-12T07:29:51.451Z]              at /home/jenkins/tikv-src/tests/failpoints/cases/test_pd_client.rs:186:17
[2023-04-12T07:29:51.451Z]    8: core::ops::function::FnOnce::call_once
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/core/src/ops/function.rs:513:5
[2023-04-12T07:29:51.451Z]    9: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
[2023-04-12T07:29:51.451Z]   10: core::ops::function::FnOnce::call_once{{vtable.shim}}
[2023-04-12T07:29:51.451Z]   11: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
[2023-04-12T07:29:51.451Z]              at /rustc/96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef/library/alloc/src/boxed.rs:2000:9

Are these tests always as unstable as this? I don't think this PR has anything to do with them

cc @tabokie @BusyJay Do you have any idea?

@MyonKeminta
Copy link
Contributor Author

/test

2 similar comments
@MyonKeminta
Copy link
Contributor Author

/test

@cfzjywxk
Copy link
Collaborator

/test

@ti-chi-bot ti-chi-bot merged commit 3630ba9 into tikv:master Apr 12, 2023
7 checks passed
@ti-chi-bot ti-chi-bot added this to the Pool milestone Apr 12, 2023
@MyonKeminta MyonKeminta deleted the m/prewrite-check-for-update-ts branch April 12, 2023 11:18
@BusyJay
Copy link
Member

BusyJay commented Apr 12, 2023

No, it's not expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/XXL 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.

None yet

6 participants