-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: Reduce data inconsistencies #31547
Conversation
* feat: check index key in AddRecord Signed-off-by: ekexium <ekexium@gmail.com> * feat: check for AddRecord/UpdateRecord Signed-off-by: ekexium <ekexium@gmail.com> * ignore deletion of indices if NeedRestoredData Signed-off-by: ekexium <ekexium@gmail.com> * check values of row mutations Signed-off-by: ekexium <ekexium@gmail.com> * style: fix naming Signed-off-by: ekexium <ekexium@gmail.com> * skip when sh == 0 Signed-off-by: ekexium <ekexium@gmail.com> * check in RemoveRecord Signed-off-by: ekexium <ekexium@gmail.com> * modify license header Signed-off-by: ekexium <ekexium@gmail.com> * test: add unit tests Signed-off-by: ekexium <ekexium@gmail.com> * add lisence header Signed-off-by: ekexium <ekexium@gmail.com> * also truncate decoded mutation Signed-off-by: ekexium <ekexium@gmail.com> * tidy up Signed-off-by: ekexium <ekexium@gmail.com> * refactor according to comments Signed-off-by: ekexium <ekexium@gmail.com> Auto stash before rebase of "ft-data-inconsistency" * skip partitioned table Signed-off-by: ekexium <ekexium@gmail.com> * save columnMap in stmtctx * skip when sh == 0 Some implementations of MemBuffer doesn't support staging. We don't care about them for now * reuse a slice in a loop * save reusable maps in stmtctx * save reusable maps in txn option * add unit test for checkIndexKeys * address comments in test
* check handle consistency Signed-off-by: ekexium <ekexium@gmail.com> * refactor according to comments Signed-off-by: ekexium <ekexium@gmail.com> * refactor according to comments Signed-off-by: ekexium <ekexium@gmail.com>
* add a sysvar to enable mutation checker Signed-off-by: ekexium <ekexium@gmail.com> * add an HTTP API to modify tidb_enable_mutation_checker Signed-off-by: ekexium <ekexium@gmail.com> * hide tidb_enable_mutation_checker Signed-off-by: ekexium <ekexium@gmail.com> * change the default behavior: only enable mutation checker for new clusters Signed-off-by: ekexium <ekexium@gmail.com> * fix name Signed-off-by: ekexium <ekexium@gmail.com>
Signed-off-by: ekexium <ekexium@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: ekexium <ekexium@gmail.com>
* fix admin test Signed-off-by: ekexium <ekexium@gmail.com> * fix gosec Signed-off-by: ekexium <ekexium@gmail.com> * satisfy gosec Signed-off-by: ekexium <ekexium@gmail.com>
* fix admin test Signed-off-by: ekexium <ekexium@gmail.com> * fix gosec Signed-off-by: ekexium <ekexium@gmail.com> * satisfy gosec Signed-off-by: ekexium <ekexium@gmail.com> * add error codes for mutation checker; redact log if needed Signed-off-by: ekexium <ekexium@gmail.com> * add comments Signed-off-by: ekexium <ekexium@gmail.com> * fix errors.toml Signed-off-by: ekexium <ekexium@gmail.com> * better redact log Signed-off-by: ekexium <ekexium@gmail.com> * address comments Signed-off-by: ekexium <ekexium@gmail.com> * fix argument order Signed-off-by: ekexium <ekexium@gmail.com> * log error using redacted error object Signed-off-by: ekexium <ekexium@gmail.com> * modify log message Signed-off-by: ekexium <ekexium@gmail.com>
* *: set consistent assertion for DML * table: check duplicate for row_id * update client-go * fix fail in br * update client-go, kvproto and add failpoints * update kvproto and client-go * update client-go for metrics * Support assertion with existance state fetched during pessimistic lock phase * Fix incorrect CheckExistence implementation in unistore * support assertion level * Fix the bug that untouched index has wrong assertion * Remove change to explaintest script * Implement assertion in unistore * Add a basic test case for assertion * Add tests to SetAssertion interface * Add test case for previsously found bug * update client-go * Fix tests * Fix store not closed in TestSetAssertion * Address comments * Fix ignore assertion in CreateIndex overwritten * Fix build * Test clustered index * fix fmt * Enable assertion only for new clusters Co-authored-by: lysu <sulifx@gmail.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
…ogs (#30897) Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-unit-test |
/run-unit-test |
1 similar comment
/run-unit-test |
* add a error code for assertion Signed-off-by: ekexium <ekexium@gmail.com> * take care of log redaction Signed-off-by: ekexium <ekexium@gmail.com> * generate errors.toml Signed-off-by: ekexium <ekexium@gmail.com> * get mvcc history Signed-off-by: ekexium <ekexium@gmail.com> * refactor according to comments Signed-off-by: ekexium <ekexium@gmail.com> * use ctx logger Signed-off-by: ekexium <ekexium@gmail.com>
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/b706ea398868c26d725fed58be2b1c2ea51c5934 |
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
* Fix unstable test TestCheckFailReport * Update executor/distsql.go Co-authored-by: Ziqian Qin <ekexium@gmail.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: Ziqian Qin <ekexium@gmail.com>
/run-unit-test |
Signed-off-by: ekexium <ekexium@gmail.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
c966685
to
f95b022
Compare
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: ekexium <ekexium@gmail.com>
/merge |
@ekexium: In response to this:
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. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b706ea3
|
What problem does this PR solve?
Issue Number: ref #26833
Problem Summary:
Defend against data inconsistency and improve its troubleshooting.
It's developed in a separate feature branch ft-data-inconsistency.
PRs can be found in the tracking issue #26833.
What is changed and how it works?
Two features: the mutation checker and the assertion, and error message improvements.
Check List
Tests
Side effects
Documentation
Release note