Skip to content

fix(satellite): read a GI through any peer the kernel still has - #335

Open
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
fix/observer-gi-from-kernel
Open

Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
fix/observer-gi-from-kernel

Conversation

@kvaps

Copy link
Copy Markdown
Member

Each time a replica of an in-use volume was deleted, the node of its Primary ran drbdmeta --force - v09 <backing device> internal get-gi against its own attached backing device.

The sequence is drbdsetup del-peer <rd> 1, then drbdsetup get-gi <rd> 1 0 (twice), then the drbdmeta read. The observer asked the kernel for the GI through the lowest peer node-id it held, which was the peer the kernel had just dropped, and on that failure fell back to the backing device. The kernel owns the metadata of an attached device, what drbdmeta reads on disk can trail it, and --force skips the check that would refuse the read.

The observer now asks the kernel through every peer it holds, lowest first. A replica with peers whose reads all fail publishes no GI on that pass instead of reading the disk, which the seed gates already treat as unknown. A replica with no peer at all is still read from its backing device, since no drbdsetup get-gi can name its volume.

Tests: TestObserverReadsTheGIThroughAPeerTheKernelStillHas replays the delete (the dropped peer fails, the remaining one answers, and with only the dropped peer nothing is read from disk); it fails without the change. The envtest that pinned the disk fallback after a failed kernel read now expects no disk read and no GI.

Deleting a replica drops its peer from the kernel before the observer
hears of it. The GI read that followed asked the kernel through the
lowest peer the observer held, which was the one just dropped, and on
that failure fell back to `drbdmeta --force ... get-gi` against the
attached backing device of the in-use Primary, once per delete. The
kernel owns the metadata of an attached device and what drbdmeta
finds on disk can trail it, and --force skips the check that would
have refused the read.

Ask the kernel through every peer the observer holds. A replica with
peers whose reads all failed publishes no GI this time instead of
reading the disk; only a replica with no peer, which no drbdsetup
get-gi can name, is still read from its backing device.

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 59 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: 7c1d7dbe-397d-482d-aaf7-aafd1dcafac4
Commits

Reviewing files that changed from the base of the PR and between d1b8e1d and 74dcbc5.

Files selected for processing: 3

  • pkg/satellite/controllers/observer.go
  • pkg/satellite/controllers/observer_gi_read_test.go
  • pkg/satellite/controllers/observer_kernel_gi_envtest_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

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