-
Notifications
You must be signed in to change notification settings - Fork 554
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: check local image state during promote operation #2684
Conversation
073166d
to
0ed6411
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.
LGTM
0ed6411
to
8bd0a7b
Compare
below is the output from VR condition when the image is not healthy primary conditions:
- lastTransitionTime: "2021-11-30T06:40:24Z"
message: ""
observedGeneration: 8
reason: FailedToPromote
status: "False"
type: Completed
- lastTransitionTime: "2021-11-30T06:40:24Z"
message: ""
observedGeneration: 8
reason: Error
status: "True"
type: Degraded
- lastTransitionTime: "2021-11-30T06:35:58Z"
message: ""
observedGeneration: 8
reason: NotResyncing
status: "False"
type: Resyncing
lastCompletionTime: "2021-11-30T06:35:58Z"
lastStartTime: "2021-11-26T05:50:08Z"
message: 'rpc error: code = Internal desc = replicapool/csi-vol-b2f4ee8a-4e7c-11ec-9b91-0242ac110005
is not healthy. Image state is up=false, state="unknown"' |
8bd0a7b
to
293ba6f
Compare
293ba6f
to
5149f30
Compare
Pull request has been modified.
func checkHealthyPrimary(ctx context.Context, rbdVol *rbdVolume) error { | ||
mirrorStatus, err := rbdVol.getImageMirroringStatus() | ||
if err != nil { | ||
return err |
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.
return err
-> return fmt.Errorf("failed to get mirror status: %w", err)
?
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.
getImageMirroringStatus
already returning the same error message. doing this will add a duplicate error message.
5149f30
to
39c70f7
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.
LGTM
/retest all |
rbd mirroring CLI calls are async and it doesn't wait for the operation to be completed. ex:- `rbd mirror image enable` it will enable the mirroring on the image but it doesn't ensure that the image is mirroring enabled and healthy primary. The same goes for the promote volume also. This commits adds a check-in PromoteVolume to make sure the image in a healthy state i.e `up+stopped`. note:- not considering any intermediate states to make sure the image is completely healthy before responding success to the RPC call. Signed-off-by: Madhu Rajanna <[email protected]>
39c70f7
to
9cdd669
Compare
rbd mirroring CLI calls are async and it doesn't wait for the operation to be completed. ex:-
rbd mirror image enable
it will enable the mirroring on the image but it doesn't ensure that the image is mirroring enabled and healthy
primary. The same goes for the promote volume also. This commits adds a check-in PromoteVolume to make sure the image is in a healthy state i.e
up+stopped
.note:-
Signed-off-by: Madhu Rajanna [email protected]