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

Should log table and index name when data inconsistencies occour #24643

Closed
youjiali1995 opened this issue May 13, 2021 · 2 comments
Closed

Should log table and index name when data inconsistencies occour #24643

youjiali1995 opened this issue May 13, 2021 · 2 comments
Labels
sig/execution SIG execution sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.

Comments

@youjiali1995
Copy link
Contributor

Bug Report

TiDB will report and log an error message if it detects data inconsistencies, but it only logs the index name. We don't know the table name! For example,

tidb/executor/distsql.go

Lines 1215 to 1223 in b7c22aa

logutil.Logger(ctx).Error("inconsistent index handles", zap.String("index", w.idxLookup.index.Name.O),
zap.Int("index_cnt", handleCnt), zap.Int("table_cnt", len(task.rows)),
zap.String("missing_handles", fmt.Sprint(GetLackHandles(task.handles, obtainedHandlesMap))),
zap.String("total_handles", fmt.Sprint(task.handles)))
// table scan in double read can never has conditions according to convertToIndexScan.
// if this table scan has no condition, the number of rows it returns must equal to the length of handles.
return errors.Errorf("inconsistent index %s handle count %d isn't equal to value count %d",
w.idxLookup.index.Name.O, handleCnt, len(task.rows))

TiDB should log enough information.

@youjiali1995 youjiali1995 added the type/bug The issue is confirmed as a bug. label May 13, 2021
@youjiali1995
Copy link
Contributor Author

@aytrack It's not critical. It's only related to log...

@wjhuang2016 wjhuang2016 added type/enhancement The issue or PR belongs to an enhancement. and removed severity/minor type/bug The issue is confirmed as a bug. labels May 14, 2021
@cfzjywxk cfzjywxk added the sig/transaction SIG:Transaction label May 24, 2021
@jyz0309
Copy link
Contributor

jyz0309 commented Aug 16, 2021

It seems that this issue have been fixed. I will close it.

@jyz0309 jyz0309 closed this as completed Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

5 participants