Skip to content

fix(satellite): keep a resync source's reported disk state - #334

Open
Andrei Kvapil (kvaps) wants to merge 2 commits into
mainfrom
fix/observer-syncsource-disk-state
Open

Andrei Kvapil (kvaps) wants to merge 2 commits into
mainfrom
fix/observer-syncsource-disk-state

Conversation

@kvaps

Copy link
Copy Markdown
Member

After a volume lost its last UpToDate copy, r l kept showing two of its Outdated replicas as UpToDate and r l --faulty listed only the third, for as long as their satellites ran. On those replicas status.drbdState already read Outdated while status.volumes[0].diskState read UpToDate; restarting a satellite corrected its row at once.

DRBD resyncs from an Outdated source to an Inconsistent peer, and both replicas did exactly that after going UpToDate -> Outdated. The observer took every replication:SyncSource peer-device frame for proof of an UpToDate local disk (BUG-045) and wrote UpToDate over the Outdated the device frame had reported. drbdState comes from device frames only, so the two fields of the same Resource disagreed. A restart replays the device frames and nothing overwrites them before the next resync.

The SyncSource frame now fills in UpToDate only for a volume whose disk state no frame has reported yet. That is the blank diskState the frame was added for, so the last-copy delete guard keeps reading a state for a Secondary SyncSource.

Test: TestObserverSyncSourceKeepsAnOutdatedSource feeds an Outdated device frame followed by a SyncSource peer-device frame and checks the status keeps Outdated with the resync count. It fails without the change; the BUG-045 tests still pass.

DRBD resyncs from an Outdated source to an Inconsistent peer. The
observer took every `replication:SyncSource` peer-device frame for
proof of an UpToDate local disk and wrote UpToDate over the Outdated
the device frame had reported, while status.drbdState kept Outdated.
After a volume lost its last UpToDate copy, two of its Outdated
replicas went on showing UpToDate in `r l` and stayed out of
`r l --faulty` until their satellites restarted.

The SyncSource frame now fills in UpToDate only for a volume whose
disk state no frame reported yet, the blank diskState the frame was
added for.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04e1761a-24e3-4ca8-902d-fc7bff46e7f2
Commits

Reviewing files that changed from the base of the PR and between d1b8e1d and 312bab9.

Files selected for processing: 2

  • pkg/satellite/controllers/observer.go
  • pkg/satellite/controllers/observer_internal_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Keeps mergeVolumeInto under the cyclomatic budget after the SyncSource
guess learned to yield to a reported disk state.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps
Andrei Kvapil (kvaps) force-pushed the fix/observer-syncsource-disk-state branch from c2a1ee3 to 312bab9 Compare November 25, 2026 18:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant