Skip to content

fast reorg checkpoint has wrong prerequisite #53009

@lance6716

Description

@lance6716

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions