-
Notifications
You must be signed in to change notification settings - Fork 34
Fast ack a flush to a RO volume. #1962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dfac3d6
Add integration test for read-only activation with one downstairs
leftwo bdae831
Flush and re-read in read-only one-downstairs test
leftwo 9a2b923
Make RO volume not have a ROP
leftwo 3eb3eda
Ack flushes on read-only volumes without sending to downstairs
leftwo 810bc81
Add a comment
leftwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1172,7 +1172,14 @@ impl Upstairs { | |
| done.send_err(CrucibleError::UpstairsInactive); | ||
| return; | ||
| } | ||
|
|
||
| if self.cfg.read_only { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| // While we ACK a guest sent flush here, The upstairs | ||
| // internally will still send a flush to all connected RO | ||
| // downstairs, which they are expected to handle. This | ||
| // internal flush serves to clean out completed jobs. | ||
| done.send_ok(()); | ||
| return; | ||
| } | ||
| let n = self.downstairs.active_client_count(); | ||
| let required = if snapshot_details.is_some() { 3 } else { 2 }; | ||
| if n < required { | ||
|
|
@@ -1205,6 +1212,20 @@ impl Upstairs { | |
| ); | ||
| done.send_ok(()); | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| BlockOp::FlushCheck { done } => { | ||
| // Deterministically run the work the automatic flush timer | ||
| // does, so a test can trigger the internal flush that a | ||
| // read-only guest flush intentionally skips. We omit the | ||
| // timer's has_jobs guard because the test is forcing this | ||
| // explicitly. | ||
| if self.need_flush { | ||
| let io_guard = self.try_acquire_io(0); | ||
| self.submit_flush(None, None, io_guard); | ||
| } | ||
| done.send_ok(()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.