mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rbd: improve logging for rpc calls
added logging of reqID for volume group rpc calls. Also, added logs for replication rpc calls which are helpful during debugging of issues related to failover/relocate. Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
c761b98933
commit
706cd88065
@ -306,6 +306,7 @@ func (rs *ReplicationServer) EnableVolumeReplication(ctx context.Context,
|
||||
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
log.UsefulLog(ctx, "mirror state is %s", info.GetState())
|
||||
if info.GetState() != librbd.MirrorImageEnabled.String() {
|
||||
err = rbdVol.HandleParentImageExistence(ctx, flattenMode)
|
||||
if err != nil {
|
||||
@ -371,6 +372,7 @@ func (rs *ReplicationServer) DisableVolumeReplication(ctx context.Context,
|
||||
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
log.UsefulLog(ctx, "mirror state is %s", info.GetState())
|
||||
switch info.GetState() {
|
||||
// image is already in disabled state
|
||||
case librbd.MirrorImageDisabled.String():
|
||||
@ -433,6 +435,7 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context,
|
||||
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
log.UsefulLog(ctx, "mirror state is %s, primary: %s", info.GetState(), info.IsPrimary())
|
||||
|
||||
if info.GetState() != librbd.MirrorImageEnabled.String() {
|
||||
return nil, status.Errorf(
|
||||
@ -533,6 +536,7 @@ func (rs *ReplicationServer) DemoteVolume(ctx context.Context,
|
||||
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
log.UsefulLog(ctx, "mirror state is %s, primary: %s", info.GetState(), info.IsPrimary())
|
||||
|
||||
if info.GetState() != librbd.MirrorImageEnabled.String() {
|
||||
return nil, status.Errorf(
|
||||
|
Reference in New Issue
Block a user