Skip to content

Conversation

@jmpesp
Copy link
Contributor

@jmpesp jmpesp commented Jan 29, 2025

Reuse the region snapshot replacement machinery to replace read-only regions. This is done by storing a replacement type in the region snapshot replacement record such that either a region snapshot or a read-only region can be the subject of this type of replacement. The procedure for both types is the same so all the code can be reused.

A future commit will rename region snapshot replacement (and all references) to "read-only target replacement" to reflect that the machinery now applies to both region snapshots and read-only regions. This will be a mostly mechanical set of changes that can be reviewed separately with much less scrutiny. Right now manually requesting a region replacement with omdb is done through the region replacement manual request, not the region snapshot replacement manual request. This will change in that future commit to be part of a read-only target replacement request.

Fixes #6172

Reuse the region snapshot replacement machinery to replace read-only
regions. This is done by storing a replacement type in the region
snapshot replacement record such that either a region snapshot _or_ a
read-only region can be the subject of this type of replacement. The
procedure for both types is the same so all the code can be reused.

A future commit will rename region snapshot replacement (and all
references) to "read-only target replacement" to reflect that the
machinery now applies to both region snapshots and read-only regions.
This will be a mostly mechanical set of changes that can be reviewed
separately with much less scrutiny. Right now manually requesting a
region replacement with omdb is done through the region replacement
manual request, not the region snapshot replacement manual request. This
will change in that future commit to be part of a read-only target
replacement request.
Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

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

It looks pretty good, just some general questions.

I've been replacing read only regions in snapshots for about a week now, no issues found.

request.volume_id,
)
} else {
String::from("UNKNOWN")
Copy link
Contributor

Choose a reason for hiding this comment

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

This would happen if someone changed how step_invalidated was assigned and did not add a place for it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, exactly

Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

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

I don't see anything in the code, and I've done 26 test runs and not seen the test flake.

I also did more than 7 sled expunges and as long as I don't have running instances on the sled I expunged, things have been working correclty.

…ents

also, run all replacement tasks _before_ checking if there are any
replacements left, because the replacement tasks add replacements!
@jmpesp jmpesp enabled auto-merge (squash) February 12, 2025 18:02
@jmpesp jmpesp merged commit a45a089 into oxidecomputer:main Feb 12, 2025
16 checks passed
@jmpesp jmpesp deleted the replace_read_only_regions branch February 14, 2025 16:56
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.

Region replacement should work for read-only regions

2 participants