Resolves stale intents left by crashed cross-shard operation coordinators.
On startup (or on-demand), scans all shards for intent records with
status :executing. For each stale intent:
- Checks if the intent is old enough to be considered stale (>10s)
- Reads current lightweight watch tokens for involved keys
- Compares tokens with the intent snapshot
- If token matches: data unchanged, safe to clean up the intent
- If token doesn't match: someone wrote new data, clean up intent (don't re-execute)
- If key doesn't exist: already completed or expired, clean up intent
Intent records are self-describing: they contain the command type, involved keys, and expected value hashes.
Summary
Functions
Scans all shards for stale intents and cleans them up.