Skip to content

Fast ack a flush to a RO volume. - #1962

Merged
leftwo merged 5 commits into
mainfrom
alan/ro-read-just-one
Jul 27, 2026
Merged

Fast ack a flush to a RO volume.#1962
leftwo merged 5 commits into
mainfrom
alan/ro-read-just-one

Conversation

@leftwo

@leftwo leftwo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Added a test to verify that a read only volume that can connect to just one downstairs will be able to activate and read from that volume.

Shade was being thrown on Crucible, and this test was written in part to confirm that a single downstairs is all you need to talk to a RO volume.

quotes from the chat:

but we get vcpus going at 19:20:57.697 and then at 19:21:07.691 propolis logs about timeouts two downstairses
so that seems funky

And

"msg":"client task is sending Done(ConnectionFailed(Os { code: 146, kind: ConnectionRefused, message: "Connection refused" }))"
after some seconds when the upstairs tried again, something was quite sad

And

it does seem odd to have failed to connect to a downstairs though
this doesn't explain why we'd fail to boot the RO volume for sure

And

because if that means that downstairs 0 and 1 were active, but 2 wasn't, and then we lost 0 and 1 .. that sounds like it would be a problem
but i don't know if that's possible

These slights were handled, and Crucible's good standing was returned.

leftwo added 2 commits July 23, 2026 14:53
Add integration_test_just_read_one_downstairs, which creates three
read-only downstairs, stops two of them, and confirms that a read-only
upstairs can still activate and read from the remaining single
downstairs.

Also add a stop() helper to TestDownstairs so a test can bring an
individual downstairs down while keeping the rest of the set running.
Augment integration_test_just_read_one_downstairs to manually send a
flush after the first read, then confirm a second read completes
successfully.  With only one downstairs running, the flush still acks
because the two stopped downstairs have their jobs moved to Skipped, so
the flush is complete on all clients rather than hanging.
@leftwo
leftwo requested a review from jmpesp July 23, 2026 22:31
Comment thread integration_tests/src/lib.rs Outdated
id: Uuid::new_v4(),
block_size: BLOCK_SIZE as u64,
sub_volumes: vec![],
read_only_parent: Some(Box::new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flushes won't be sent to read-only parents, you'll have to change the structure of the VCR to put this under sub volumes instead

leftwo added 2 commits July 24, 2026 14:30
A flush on a read-only volume has no data to persist, so ack it
immediately in the guest Flush path instead of sending it to the
downstairs.

This broke a test, test_no_read_only_live_repair, which relied on a
guest flush reaching the downstairs to retire skipped jobs after a
fault.  Retiring completed jobs still must happen, but in the
production code the auto-flush will come around and clear these
jobs out.  The internal flush timer for the test framework is pinned
to 24 hours, so to enable the internal flush we add a test-only
BlockOp::FlushCheck and guest.flush_check() that runs the same work
the automatic flush timer performs.  Unlike a guest flush, this path
still sends the flush to the downstairs on a read-only volume.  Update
the test to use it.  This appears to be a simpler solution and does
not require the heavier modification that enabling the auto flush on
all tests would involve.  Enabling auto-flush for all tests would
add non-determinism to many tests that don't expect it.
Comment thread upstairs/src/upstairs.rs
return;
}

if self.cfg.read_only {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real change, the rest is to support the test changes.

@leftwo leftwo changed the title Add a test verifying only one downstairs required to activate and read from a RO volume. Fast ack a flush to a RO volume. Jul 27, 2026
Comment thread upstairs/src/upstairs.rs
return;
}

if self.cfg.read_only {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put a comment in for future us about how this doesn't affect the auto flush that the upstairs sends as part of the flush check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@leftwo
leftwo merged commit a3aaac2 into main Jul 27, 2026
17 checks passed
@leftwo
leftwo deleted the alan/ro-read-just-one branch July 27, 2026 18:35
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.

2 participants