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

executor: Fix unstable test TestCheckFailReport #31701

Conversation

MyonKeminta
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #26833

Problem Summary: TestCheckFailReport is unstable. There's such a problem: when executing admin check, it didn't handle context cancellation correctly, therefore if admin check fails, and another working goroutine inner the TableReaderExecutor returns empty result due to being cancelled, there's some chance that the admin check procedure produced one more false-positive error log, which may cause confusion and misleading.

What is changed and how it works?

After reading from table, exit before reporting error if context is cancelled.

Check List

Tests

  • Unit test

Release note

None

@MyonKeminta MyonKeminta requested a review from a team as a code owner January 14, 2022 10:18
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 14, 2022

[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.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 14, 2022
@MyonKeminta MyonKeminta changed the base branch from master to ft-data-inconsistency January 14, 2022 10:18
@ti-chi-bot ti-chi-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 14, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jan 14, 2022

Copy link
Contributor

@ekexium ekexium left a comment

Choose a reason for hiding this comment

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

It does fix the bug. But I'm not sure whether it's the most appropriate place to put it.

executor/distsql.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 14, 2022
@hawkingrei
Copy link
Member

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/txn_driver.go:241:12: txn.KVTxn.SetAssertionLevel undefined (type *transaction.KVTxn has no field or method SetAssertionLevel)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/txn_driver.go:303:20: f.HasAssertionFlags undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertionFlags)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:150:9: flag.HasAssertExist undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertExist)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:152:16: flag.HasAssertNotExist undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertNotExist)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:154:16: flag.HasAssertUnknown undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertUnknown)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:167:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertExist

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:169:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertNotExist

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:171:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertUnknown

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:173:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertNone

Please fix build.

Co-authored-by: Ziqian Qin <ekexium@gmail.com>
@MyonKeminta
Copy link
Contributor Author

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/txn_driver.go:241:12: txn.KVTxn.SetAssertionLevel undefined (type *transaction.KVTxn has no field or method SetAssertionLevel)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/txn_driver.go:303:20: f.HasAssertionFlags undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertionFlags)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:150:9: flag.HasAssertExist undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertExist)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:152:16: flag.HasAssertNotExist undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertNotExist)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:154:16: flag.HasAssertUnknown undefined (type "github.com/tikv/client-go/v2/kv".KeyFlags has no field or method HasAssertUnknown)

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:167:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertExist

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:169:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertNotExist

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:171:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertUnknown

[2022-01-14T10:24:26.597Z] ../../tidb/store/driver/txn/unionstore_driver.go:173:10: undefined: "github.com/tikv/client-go/v2/kv".SetAssertNone

Please fix build.

@hawkingrei It's not the problem in this PR.

@ekexium
Copy link
Contributor

ekexium commented Jan 18, 2022

@hawkingrei PTAL

@ekexium ekexium requested a review from cfzjywxk January 19, 2022 04:18
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 19, 2022
@ekexium ekexium merged commit fdf1296 into pingcap:ft-data-inconsistency Jan 19, 2022
@MyonKeminta MyonKeminta deleted the m/fix-unstable-test-check-fail-report branch January 20, 2022 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants