Skip to content

The log backup observer loses observation of a region #18243

@Leavrth

Description

@Leavrth

Image

Background

A region becomes leader while a new log backup task is initialized.

Reproduction Timeline

  1. The log backup endpoint register ranges of the new log backup task to the observers.
    1/2. The region becomes pre-candidate, which trigger to send Task::ModifyObserve(Observe::Stop) to the Endpoint::scheduler.
    3/4. The region becomes candidate, which trigger to send Task::ModifyObserve(Observe::Stop) to the Endpoint::scheduler.
    5/6. The region becomes leader, which trigger to send Task::ModifyObserve(Observe::Start{ObserveId: 191299}) to the Endpoint::scheduler.

After the step 6, the Endpoint::scheduler has the followed messages that have not been consumed.

Task::ModifyObserve(Observe::Stop)
Task::ModifyObserve(Observe::Stop)
Task::ModifyObserve(Observe::Start{ObserveId: 191299})
  1. The initialization of new log backup scan the region and send Observe::Start{ObserveId:191374} to the Observer::scheduler.

After the step 7, the Observer::scheduler has the followed messages that have not been consumed.

Observe::Start{ObserveId:191374}
  1. The Endpoint starts to consumes the above messages in the scheduler, and sends them to Observer::scheduler.

After the step 8, the Observer::scheduler has the followed messages that have not been consumed.

Observe::Start{ObserveId:191374}
Observe::Stop
Observe::Stop
Observe::Start{ObserveId: 191299}

This order causes the region to not be observed with the error stale observe id ObserveId(191299), current id: ObserveId(191374).

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.5This bug affects the 6.5.x(LTS) versions.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.affects-8.5This bug affects the 8.5.x(LTS) versions.component/backup-restoreComponent: backup, import, external_storageseverity/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