Skip to content
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: (lastSyncInfo)handle last sync duration being empty case #3930

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

Rakshith-R
Copy link
Contributor

@Rakshith-R Rakshith-R commented Jun 23, 2023

This commit modifies code to handle last sync duration being empty & 0,returning nil & 0 on encountering it respectively. Earlier both case returned 0. Test case is added for the same too.

This commit modifies code to handle last sync duration being
empty & 0,returning nil & 0 on encountering it respectively.
Earlier both case return 0. Test case is added too.

Signed-off-by: Rakshith R <rar@redhat.com>
@Rakshith-R Rakshith-R added component/rbd Issues related to RBD ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures labels Jun 23, 2023
@Rakshith-R Rakshith-R requested review from nixpanic, Madhu-1 and a team June 23, 2023 08:48
@Rakshith-R Rakshith-R added the ok-to-test Label to trigger E2E tests label Jun 23, 2023
@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.25

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.25

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.25

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot ceph-csi-bot removed the ok-to-test Label to trigger E2E tests label Jun 23, 2023
Comment on lines +518 to +519
description: `replaying, {"bytes_per_second":0.0,"bytes_per_snapshot":81920.0,"last_snapshot_sync_seconds":0,
"last_snapshot_bytes":81920,"local_snapshot_timestamp":1684675261,"remote_snapshot_timestamp":1684675261,"replay_state":"idle"}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

am not sure we can have this case from Ceph, where we will have last_snapshot_bytes but duration is 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

am not sure we can have this case from Ceph, where we will have last_snapshot_bytes but duration is 0

I did not focus on other parameters.
We can ignore that parameter for this test case since parameters are not interlinked here, this test case only focuses on duration.

LastSnapshotDuration int64 `json:"last_snapshot_sync_seconds"`
LocalSnapshotTime int64 `json:"local_snapshot_timestamp"`
LastSnapshotBytes int64 `json:"last_snapshot_bytes"`
LastSnapshotDuration *int64 `json:"last_snapshot_sync_seconds"`
Copy link
Member

@nixpanic nixpanic Jun 23, 2023

Choose a reason for hiding this comment

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

if last_snapshot_sync_seconds can be empty when Ceph returns this, can last_snapshot_bytes not also be empty?

Is it known what Ceph versions return incomplete results?

Copy link
Contributor Author

@Rakshith-R Rakshith-R Jun 23, 2023

Choose a reason for hiding this comment

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

if last_snapshot_sync_seconds can be empty when Ceph returns this, can last_snapshot_bytes not also be empty?

Maybe but currently it does not matter since there's no *int64 type in protoc3 sadly.

Anyway csiaddons defines bytes 0 as empty and sets it to nil in status.
This pr just rectifies the nil case for last sync duration.

https://github.com/csi-addons/kubernetes-csi-addons/blob/main/controllers/replication.storage/volumereplication_controller.go#L390-L393

Is it known what Ceph versions return incomplete results?
I asked the same too in previous pr but didn't get an answer.

@Madhu-1 Madhu-1 added this to the release-v3.9.0 milestone Jun 23, 2023
@Rakshith-R Rakshith-R requested review from nixpanic and a team June 23, 2023 10:15
@mergify mergify bot merged commit 1ca6f00 into ceph:devel Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures component/rbd Issues related to RBD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants