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

fast reorg checkpoint has wrong prerequisite #53009

Closed
lance6716 opened this issue Apr 30, 2024 · 0 comments · Fixed by #53072
Closed

fast reorg checkpoint has wrong prerequisite #53009

lance6716 opened this issue Apr 30, 2024 · 0 comments · Fixed by #53072
Labels
affects-7.1 affects-7.5 affects-8.1 component/ddl This issue is related to DDL of TiDB. severity/major type/bug This issue is a bug.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Apr 30, 2024

If the checkpoint record shows the it is generated by current node

if s.instanceAddr == cp.InstanceAddr || cp.InstanceAddr == "" /* initial state */ {
s.localDataIsValid = true

we skip the data whose key is smaller that "local storage key watermark" and assume the data is already stay in local storage.

// IsComplete checks if the task is complete.
// This is called before the reader reads the data and decides whether to skip the current task.
func (s *CheckpointManager) IsComplete(end kv.Key) bool {
s.mu.Lock()
defer s.mu.Unlock()
if len(s.minKeySyncGlobal) > 0 && end.Cmp(s.minKeySyncGlobal) <= 0 {
return true
}
return s.localDataIsValid && len(s.minKeySyncLocal) > 0 && end.Cmp(s.minKeySyncLocal) <= 0
}

However this is not reliable, especially we are using /tmp folder to store the data https://docs.pingcap.com/tidb/stable/command-line-flags-for-tidb-configuration#--temp-dir. If the node restarts in many OS /tmp folder will be cleaned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 affects-7.5 affects-8.1 component/ddl This issue is related to DDL of TiDB. severity/major type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants