Client: Retry a SYNC failed by a dropped connection by timer #182

Open
koolkhel wants to merge 1 commits from koolkhel/vitastor:client-sync-retry-timer into master
Contributor

Description

A SYNC whose part failed with -EPIPE (or -EAGAIN, -EIO, -ENOSPC) was put back to state 0 in continue_sync() without a retry timer, so it only resumed on the next continue_ops().

This is what happens when a primary OSD drops with a SYNC in flight:

  1. The writes repeated for that OSD go ahead of the SYNC.
  2. The SYNC resumes only after they complete on the new primary.
  3. That happens after the peer and PG events, so nothing continued the SYNC any more.
  4. The SYNC, and every write queued after it, hung until some unrelated event.

Seen with fio over a pool with immediate_commit=none when the primary OSD was killed under writes. One writer whose SYNC failed on the dead OSD reconnected to the new primaries and then never resumed. A writer whose failures were all writes did resume, because a failed write arms its own retry timer.

The fix arms the retry timer for the parked SYNC, as handle_op_part() does for a failed write.

Tested: new test_sync_retry_after_drop in test_cluster_client, which uses a mock clock (timerfd_manager_t(NULL) + tick()) and no manual continue_ops():

  • A write completes on OSD 1, and a SYNC goes to OSD 1.
  • The PG moves to OSD 2, and OSD 1 drops.
  • The repeated write completes on OSD 2.
  • After one retry interval the SYNC must be resent to OSD 2. It isn't without the fix, and the whole test_cluster_client passes with it.

Contributor Name

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

CLA

### Description A SYNC whose part failed with -EPIPE (or -EAGAIN, -EIO, -ENOSPC) was put back to state 0 in `continue_sync()` without a retry timer, so it only resumed on the next `continue_ops()`. This is what happens when a primary OSD drops with a SYNC in flight: 1. The writes repeated for that OSD go ahead of the SYNC. 2. The SYNC resumes only after they complete on the new primary. 3. That happens after the peer and PG events, so nothing continued the SYNC any more. 4. The SYNC, and every write queued after it, hung until some unrelated event. Seen with fio over a pool with `immediate_commit=none` when the primary OSD was killed under writes. One writer whose SYNC failed on the dead OSD reconnected to the new primaries and then never resumed. A writer whose failures were all writes did resume, because a failed write arms its own retry timer. The fix arms the retry timer for the parked SYNC, as `handle_op_part()` does for a failed write. Tested: new `test_sync_retry_after_drop` in `test_cluster_client`, which uses a mock clock (`timerfd_manager_t(NULL)` + `tick()`) and no manual `continue_ops()`: - A write completes on OSD 1, and a SYNC goes to OSD 1. - The PG moves to OSD 2, and OSD 1 drops. - The repeated write completes on OSD 2. - After one retry interval the SYNC must be resent to OSD 2. It isn't without the fix, and the whole `test_cluster_client` passes with it. ### 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-25 02:46:00 +03:00
A SYNC whose part failed with -EPIPE (or -EAGAIN, -EIO, -ENOSPC) was put
back to state 0 without a retry timer, so it only resumed on the next
continue_ops(). When a primary OSD drops with a SYNC in flight, the
writes repeated for it go ahead of the SYNC, and the SYNC resumes only
after they complete on the new primary. That happens after the peer and
PG events, so nothing continued the SYNC any more, and it and every write
queued after it hung until some unrelated event.

Arm the retry timer for it, as a failed write does.
This pull request has changes conflicting with the target branch.
  • src/test/test_cluster_client.cpp
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u client-sync-retry-timer:koolkhel-client-sync-retry-timer
git checkout koolkhel-client-sync-retry-timer
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#182
No description provided.