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:
Nikhil-Ladha
2025-05-19 11:51:19 +05:30
committed by mergify[bot]
parent c761b98933
commit 706cd88065
3 changed files with 33 additions and 11 deletions

View File

@ -120,6 +120,8 @@ func (rm *rbdMirror) EnableMirroring(ctx context.Context, mode librbd.ImageMirro
return fmt.Errorf("failed to enable mirroring on %q with error: %w", rm, err)
}
log.DebugLog(ctx, "mirroring is enabled on the image %q", rm)
return nil
}
@ -141,6 +143,8 @@ func (rm *rbdMirror) DisableMirroring(ctx context.Context, force bool) error {
return fmt.Errorf("failed to disable mirroring on %q with error: %w", rm, err)
}
log.DebugLog(ctx, "mirroring is disabled on the image %q", rm)
return nil
}
@ -183,6 +187,8 @@ func (rm *rbdMirror) Promote(ctx context.Context, force bool) error {
return fmt.Errorf("failed to promote image %q with error: %w", rm, err)
}
log.DebugLog(ctx, "image %q has been promoted", rm)
return nil
}
@ -213,6 +219,8 @@ func (rm *rbdMirror) ForcePromote(ctx context.Context, cr *util.Credentials) err
return fmt.Errorf("failed to promote image %q with stderror: %s", rm, stderr)
}
log.DebugLog(ctx, "image %q has been force promoted", rm)
return nil
}
@ -234,6 +242,8 @@ func (rm *rbdMirror) Demote(ctx context.Context) error {
return fmt.Errorf("failed to demote image %q with error: %w", rm, err)
}
log.DebugLog(ctx, "image %q has been demoted", rm)
return nil
}
@ -259,6 +269,8 @@ func (rm *rbdMirror) Resync(ctx context.Context) error {
return fmt.Errorf("failed to resync image %q with error: %w", rm, err)
}
log.DebugLog(ctx, "issued resync on image %q", rm)
// delay until the state is syncing, or until 1+2+4+8+16 seconds passed
delay := 1 * time.Second
for {