Skip to content

LoopWatcher can miss changes after etcd compaction #11032

Description

@rleungx

Bug Report

What did you do?

Disconnect a LoopWatcher, update its watched key, advance the etcd
revision, compact past the missed update, and then reconnect the watcher.

This was found while investigating:
https://github.com/tidbcloud/pd-cse/issues/559

What did you expect to see?

After detecting a compacted watch revision, LoopWatcher should reload a
consistent snapshot and continue watching from the snapshot revision plus
one.

What did you see instead?

LoopWatcher changes its watch revision to the compact revision without
reloading. Changes in the compacted interval are not replayed, so the
consumer cache can remain stale indefinitely.

Paginated loading can also read different revisions, and an earlier
callback error can be overwritten by a later successful callback.

What version of PD are you using (pd-server -V)?

master at 39b6220

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions