Open
Conversation
Signed-off-by: Steffen Siering <steffen@xata.io>
Comment on lines
+44
to
+54
| impl AsRef<str> for RaidState { | ||
| fn as_ref(&self) -> &str { | ||
| match self { | ||
| RaidState::WaitingForDevices => "waiting for devices", | ||
| RaidState::StartingUp => "starting up", | ||
| RaidState::Online => "online", | ||
| RaidState::Offline => "offline", | ||
| RaidState::Unknown => "unknown", | ||
| } | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
nit: You can sure strum macros
Comment on lines
+70
to
+75
| /// number of base bdevs discovered and configured | ||
| pub discovered: u8, | ||
| /// number of base bdevs we expect to be operational (can be less for degraded arrays - depends on raid level) | ||
| pub operational: u8, | ||
| /// total number of base bdevs comprising the RAID array | ||
| pub total: u8, |
Member
There was a problem hiding this comment.
Doc comments, should start with Capital and end with .. It would be good if we can follow this, even if at some places it was not followed prior to your changes. Thanks!
| .with_name(&format!("raid_wait_{}", self.name())) | ||
| .with_interval(Duration::from_millis(100)) | ||
| .with_poll_fn(move |_| { | ||
| // Reconstruct RaidBdev from the raw pointer |
Member
There was a problem hiding this comment.
This comment goes before line 336?
| if device_counts.discovered >= device_counts.operational { | ||
| RaidState::StartingUp | ||
| } else { | ||
| RaidState::WaitingForDevices |
Member
There was a problem hiding this comment.
Shouldn't it be WaitingForDevice when device_counts.total < device_counts.discovered? Because raid bdev might have enough bdevs, some could be just not operational. Also, do we know when num_base_bdevs_operational is decremented?
What happens when num_base_bdevs_operational < min_base_bdevs_operational?
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.
Add RaidBDev to core module. The RaidBdevs provides us with a more convenient API over having to use low-level SPDK raid_bdev functions throughout the code base.
Note: I have a working Raid0 implementation (MVP) available in my feature-raid0 branch. For context how the changes in here fit in the full implementation see: https://github.com/openebs/mayastor/compare/develop...urso:mayastor:feature-raid0?expand=1