-
Notifications
You must be signed in to change notification settings - Fork 20
replication: add replication state to GetVolumeReplicationInfo response #77
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,9 @@ message GetVolumeReplicationInfoResponse { | |
// This field is OPTIONAL. | ||
// The value of this field MUST NOT be negative. | ||
int64 last_sync_bytes = 3; | ||
// Holds the latest replication state. | ||
// This field is REQUIRED. | ||
string replication_state = 4; | ||
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. Just curious, as we will have predictable states, can this not be an enum instead? 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. We want the spec to be storage agnostic. 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.
How are you going to use this value in csi-addons then? 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.
We will fetch the state and parse it in ceph-csi and pass the value accordingly to the api.
Hmm, yeah we would have to mark it optional for backward compatibility. |
||
} | ||
// Specifies what source the replication will be created from. One of the | ||
// type fields MUST be specified. | ||
|
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 probably should be optional instead of required. If it is a message, maybe call it
status_message
instead, and explain that it is user-facing information.If something is expected to inspect the contents and act on it, like a state, it definitely should be an enum that has values which fit for different storage providers.
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.
It would be the mirroring status state like
stopped
,syncing
,error
replaying
and so on. I don't think we would want it be a message instead.Based on the above mentioned value, I am not sure which values to use that make it fit for different storage providers?
Making it generic like
primary
,secondary
,unkown
anderror
could be one wayThere 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.
And, then the storage provider is responsible for mapping the respective states for them to the csi-addons spec's state?
Like, for us (ceph's pov)
stopped
toprimary
,replaying
tosecondary
,error
toerror
and any other state tounkown
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.
sounds reasonable, each state should have a description, something along these lines:
unknown
status was not providedprimary
this volume is in a primary state and can be used for writing tosecondary
this volume is actively tracking changes from a primary volumeerror
something went wrong, and replication has stoppedThe
error
state is probably final, and no automated recovery is possible. Maybe a mis-configuration or environment failure.In case there is an error state that can be recovered automatically (or retried), such a state should be mentioned separately, maybe something like
split-brain
orout-of-space
.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.
@nixpanic IMO we should keep it as string because it will be hard to map this from storage to the csi-addons and also state is more of enum where we have pre defined states . can we do something like below
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.
Sure, that is basically what I meant with
There is no need to add
replication_
in the name, as the call isGetVolumeReplicationInfoResponse
.To me,
status
still sounds like something that can be parsed by non-humans. I therefor preferstatus_message
so that storage providers can phrase something helpful to guide the humans reading it.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.
+1 for status_message as we need this to be representation only for users for information not the programmatic
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.
We can have status and a message for the very clear status and the more details message as well