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

multi-schema-change fast reorg has no chance to save checkpoint #53165

Closed
lance6716 opened this issue May 10, 2024 · 0 comments · Fixed by #53233
Closed

multi-schema-change fast reorg has no chance to save checkpoint #53165

lance6716 opened this issue May 10, 2024 · 0 comments · Fixed by #53233
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

We use FlushModeAuto to save checkpoint

flushed, imported, _, err := TryFlushAllIndexes(s.flushCtrl, FlushModeAuto, s.indexIDs)

But when indexIDs has more than one elements, each index (engine) check flush based on shared last flush time and will update the time immediately

shouldFlush = shouldImport ||
time.Since(bc.timeOfLastFlush.Load()) >= interval

It's unlikely that all engines are flushed

func TryFlushAllIndexes(flushCtrl FlushController, mode FlushMode, indexIDs []int64) (flushed, imported bool, failedIdxID int64, err error) {
allFlushed := true
allImported := true
for _, idxID := range indexIDs {
// TODO(lance6716): use flushCtrl.Flush(indexIDs, mode)
flushed, imported, err := flushCtrl.Flush(idxID, mode)
if err != nil {
return false, false, idxID, err
}
allFlushed = allFlushed && flushed
allImported = allImported && imported
}
return allFlushed, allImported, -1, nil
}
so at caller checkpoint is not updated.

@lance6716 lance6716 added type/bug The issue is confirmed as a bug. severity/moderate affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. labels May 10, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants