add device-uuid validation to protect against swapped disks#500
Open
IvanOgurchenok wants to merge 1 commit into
Open
add device-uuid validation to protect against swapped disks#500IvanOgurchenok wants to merge 1 commit into
IvanOgurchenok wants to merge 1 commit into
Conversation
- Add DeviceUUID field to RVR status to store DRBD metadata identifier - Validate device-uuid and node-id before drbdadm up (only when device is down) - Add DeviceUUIDMismatchError and NodeIDMismatchError for disk swap detection - Handle node-id=-1 for freshly created metadata (before first up) - Remove --force flag from dump-md (now called only when device is down) - Add parseMetadata function with regex parsing and unit tests Signed-off-by: Ivan Ogurchenok <ivan.ogurchenok@flant.com>
c3e7b88 to
8d091a8
Compare
020a126 to
2c75d18
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Add device-uuid and node-id validation before
drbdadm upto detect swapped disks.device-uuidfrom DRBD metadata in RVR statusstatus.drbd.errorsNo impact on critical components. No restarts required.
Why do we need it, and what problem does it solve?
Protects against accidentally attaching wrong disk after node reboot or disk replacement.
Without this: DRBD could start with wrong data → data corruption or split-brain.
With this: Agent refuses to bring up resource and reports clear error.
What is the expected result?
Normal: RVR gets
status.drbd.actual.deviceUUIDfield, resource works as before.Disk swapped: Resource stays down, RVR shows error:
status:
drbd:
errors:
deviceUUIDMismatchError:
expected: "0xABCD..."
actual: "0x1234..."
Checklist