-
Notifications
You must be signed in to change notification settings - Fork 39
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
replication: reduce RPC calls when VR state is primary #280
Conversation
// updating the LastSyncTime in the status. The image need to be | ||
// promoted only one time not always during the reconcile. |
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.
// updating the LastSyncTime in the status. The image need to be | |
// promoted only one time not always during the reconcile. | |
// updating the LastSyncTime in the status. The volume needs to be | |
// Replication enabled and promoted only once, not always during each reconcilation. |
Avoid extra RPC calls as request will be requested again for updating the LastSyncTime in the status. The image need to be promoted only one time not always during the reconcile. fixes: csi-addons#250 Co-authored-by: Madhu Rajanna <[email protected]> Signed-off-by: yati1998 <[email protected]>
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.
LGTM, let's wait for the test results. If everything is good, we can merge this one.
// updating the LastSyncTime in the status. The volume needs to be | ||
// replication enabled and promoted only once, not always during | ||
// each reconciliation. | ||
if instance.Status.State != replicationv1alpha1.PrimaryState { |
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 useful to also check if instance.Status.ObservedGeneration == instance.Generation
, so that we do not process a stale Status. Although in this case I cannot think of a reason for the Status to be stale, unless it was flipped from Primary to Seconday and back to Primary (in which case the generation may not matter), it is safer to check the same.
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, we can do that if it avoids corner cases, but here is the instance.Status.ObservedGeneration
wont be equal to the instance.Generation
as the status.ObservedGeneration
is not updated yet right? let's take it in follow-up PR as it also requires extensive testing and also this PR is already getting tested for some time. @ShyamsundarR WDYT?
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.
In this case the instance.Generation will equal the instance.Status.ObservedGeneration as there is no change to spec. The reconcile only updates the status for the sync time, which will change the revision.
I am fine taking it into another PR as the generation match is not tested in other conditions as well.
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, correct. Let's take it as a follow-up PR, as we need to test it verywell.
/cherry-pick release-4.12 |
Avoid extra RPC calls as request will be requested again for updating the LastSyncTime in the status. The image need to be promoted only one time not always during the reconcile.
fixes: #250
Co-authored-by: Madhu Rajanna [email protected]
Signed-off-by: yati1998 [email protected]