Store v2: Wait for fsyncs submitted by other operations before completing a sync #107

Closed
koolkhel wants to merge 1 commits from koolkhel/vitastor:v2-chaos-105267292 into master

1 Commits

Author SHA1 Message Date
b950937bac Store v2: Wait for fsyncs submitted by other operations before completing a sync
do_sync() returned at once when nothing was left unsynced, but these
counters are reset when an fsync is submitted, not when it completes. So
a stabilize or rollback whose metadata block was written before another
operation submitted its fsync completed before that fsync did, and a
power outage could undo it: test_blockstore_chaos --seed 105267292 sees
a rolled back version come back.

Count fsyncs in flight and wait for them as well. Comparing fsynced_lsn
with completed_lsn instead isn't enough: an unfinished earlier write
keeps completed_lsn below the entries of the operation being synced
(test_blockstore_chaos --config 5 --seed 100085 with BS_OP_ROLLBACK_WRITE
support applied).
2026-11-18 14:15:59 +03:00