-
Notifications
You must be signed in to change notification settings - Fork 546
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
rbd: get lastsyncbytes and lastsycduration for volrep #3894
Conversation
05392be
to
02eea42
Compare
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.
Have you tested this end to end in a live cluster ?
Can you please provide the new CR yaml with status and logs of each container?
Please test it also with ceph cluster version that does not have this change(if these variables were added recently)?
// description = `replaying, {"bytes_per_second":0.0,"bytes_per_snapshot":81920.0, | ||
// "last_snapshot_bytes":81920,"last_snapshot_sync_seconds":0, | ||
// "local_snapshot_timestamp":1684675261, | ||
// "remote_snapshot_timestamp":1684675261,"replay_state":"idle"}` | ||
// In case there is no last snapshot bytes returns 0 as the | ||
// LastSyncBytes is optional. | ||
// In case there is no last snapshot sync seconds, it returns nil as the | ||
// LastSyncDuration is optional. |
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.
Was lastSync[Byte|duration]
added recently to ceph ?
if so, please add ceph tracker/ version from which this was added for reference in comment.
have you tested this call on a ceph cluster version that does not provide these information ?
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.
The above query was not answered.
The localStatus struct which is used for unmarshalling will give default 0 value when the field is not present ?
Check this with unit test cases.
We will need to handle missing values.
The current code workflow does not do that.
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.
Yeah, the 0 value of lastSyncBytes states undefined files, which has been mentioned in csi-addons. and if the value is 0 the lastsyncbytes in volumereplication operator will not be updated.
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.
Similar logic needs to be applied for lastSyncDuration below too?
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.
yes, thats done.
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.
My very first question in this thread is still unanswered.
Still does not handle the case where duration does not exist in the description.
Current workflow will return 0s which is misleading IMO.
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.
That's what is mentioned in the comments, o/nil indicates the value of this field is undefined. We can't return any error as it's optional, and in case duration is not there it will be set to nil, 0 in case of lastsyncbytes. These values are sent by ceph-csi and in csi-addons we are keeping it nil only, which will be updates to the status.
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.
d11899d
to
5f41c9d
Compare
} | ||
type localStatus struct { | ||
LocalSnapshotTime int64 `json:"local_snapshot_timestamp"` | ||
LocalSnapshotTime int64 `json:"local_snapshot_timestamp"` | ||
LocalSnapshotBytes int64 `json:"last_snapshot_bytes"` |
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.
the naming of these members are not matching the json contents. Note the difference in Local
and last_
. Please rename them to match the json, it is a little confusing otherwise.
ea09ae9
to
0df93de
Compare
|
// description = `replaying, {"bytes_per_second":0.0,"bytes_per_snapshot":81920.0, | ||
// "last_snapshot_bytes":81920,"last_snapshot_sync_seconds":0, | ||
// "local_snapshot_timestamp":1684675261, | ||
// "remote_snapshot_timestamp":1684675261,"replay_state":"idle"}` | ||
// In case there is no last snapshot bytes returns 0 as the | ||
// LastSyncBytes is optional. | ||
// In case there is no last snapshot sync seconds, it returns nil as the | ||
// LastSyncDuration is optional. |
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.
The above query was not answered.
The localStatus struct which is used for unmarshalling will give default 0 value when the field is not present ?
Check this with unit test cases.
We will need to handle missing values.
The current code workflow does not do that.
757ca93
to
80f64dc
Compare
// This function gets the local snapshot time, last sync snapshot seconds | ||
// and last sync bytes from the description of localStatus and convert | ||
// it into required types. | ||
func getLastSyncInfo(description string) (*timestamppb.Timestamp, *durationpb.Duration, int64, error) { |
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.
create a local struct and return it in response, this avoids returning many values
f41a361
to
ed6af0f
Compare
5755a46
to
55bb11f
Compare
9ef3f00
to
3c6dd32
Compare
This commit get more information from the description like lastsyncbytes and lastsyncduration and send them as a response of getvolumereplicationinfo request. Signed-off-by: Yati Padia <ypadia@redhat.com>
@Mergifyio rebase |
✅ Nothing to do for rebase action |
/test ci/centos/k8s-e2e-external-storage/1.25 |
/test ci/centos/k8s-e2e-external-storage/1.26 |
/test ci/centos/k8s-e2e-external-storage/1.27 |
/test ci/centos/mini-e2e-helm/k8s-1.25 |
/test ci/centos/mini-e2e-helm/k8s-1.26 |
/test ci/centos/mini-e2e-helm/k8s-1.27 |
/test ci/centos/mini-e2e/k8s-1.25 |
/test ci/centos/mini-e2e/k8s-1.26 |
/test ci/centos/mini-e2e/k8s-1.27 |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/upgrade-tests-rbd |
This commit get more information from the description like lastsyncbytes and lastsyncduration and send them as a response of getvolumereplicationinfo request.