test_pg_chaos: Don't run deferred recovery checks on objects with an operation in flight #163

Open
koolkhel wants to merge 1 commits from koolkhel/vitastor:chaos-recover-busy into master
Contributor

Description

flush_recover_pending() runs from settle() while client operations are in flight. So check_recovered() could read an object that the model was still writing to. The test's own rule forbids that: no operation may touch an object while another one on it is in flight (touched). Such a read may legally return a per-block mix of the old and the new data. No single world of the recorded versions explains that mix, so the checker aborted although nothing was lost.

Found with test_pg_chaos --replicated --recovery --seed 1230 on a slightly older tree (config 0: fsync=0, csum none):

  • An OSD power outage had parked every object in recover_pending.
  • Peer 2 came back while a full-object write to object 1 was in flight, and settle() ran the deferred check of object 1.
  • The read returned a hole for 0-32767 (old), the in-flight write's bytes for 32768-94207 and the previous version's bytes after that. Every byte belonged to one of the two versions, and all replicas ended at the new one.
  • On current master that seed takes a different schedule and passes.

The fix skips busy objects. They are checked again by a later settle() or by the convergence loop, which runs flush_recover_pending() and drain() up to 200 times and fails if anything is still pending.

Tested on master with the fix:

  • --replicated --recovery, seeds 1-3000: all pass;
  • --replicated, seeds 1-1000: all pass;
  • the default EC configs, seeds 1-1000: all pass.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description `flush_recover_pending()` runs from `settle()` while client operations are in flight. So `check_recovered()` could read an object that the model was still writing to. The test's own rule forbids that: no operation may touch an object while another one on it is in flight (`touched`). Such a read may legally return a per-block mix of the old and the new data. No single world of the recorded versions explains that mix, so the checker aborted although nothing was lost. Found with `test_pg_chaos --replicated --recovery --seed 1230` on a slightly older tree (config 0: fsync=0, csum none): - An OSD power outage had parked every object in `recover_pending`. - Peer 2 came back while a full-object write to object 1 was in flight, and `settle()` ran the deferred check of object 1. - The read returned a hole for 0-32767 (old), the in-flight write's bytes for 32768-94207 and the previous version's bytes after that. Every byte belonged to one of the two versions, and all replicas ended at the new one. - On current master that seed takes a different schedule and passes. The fix skips busy objects. They are checked again by a later `settle()` or by the convergence loop, which runs `flush_recover_pending()` and `drain()` up to 200 times and fails if anything is still pending. Tested on master with the fix: - `--replicated --recovery`, seeds 1-3000: all pass; - `--replicated`, seeds 1-1000: all pass; - the default EC configs, seeds 1-1000: all pass. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-11-23 14:02:39 +03:00
flush_recover_pending() runs from settle() while client operations are
in flight, so check_recovered() could read an object the model was still
writing to. Such a read may legally return a per-block mix of the old and
the new data, which no single world of the recorded versions explains,
and the checker aborted although nothing was lost.

Skip busy objects. They are checked again by a later settle or by the
convergence loop after drain().
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u chaos-recover-busy:koolkhel-chaos-recover-busy
git checkout koolkhel-chaos-recover-busy
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#163
No description provided.