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 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/major type/bug The issue is confirmed as 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.

@lance6716 lance6716 added type/bug The issue is confirmed as a bug. severity/major labels Apr 30, 2024
@lance6716 lance6716 added 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 Apr 30, 2024
@lance6716 lance6716 removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 30, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label May 3, 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/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants