Skip to content

Commit

Permalink
replication: update reconcile logic
Browse files Browse the repository at this point in the history
This commit updates the reconcile logic to
get more info and update the volrep status.

Signed-off-by: yati1998 <[email protected]>
  • Loading branch information
yati1998 committed Jun 21, 2023
1 parent 97ada38 commit 5f45cec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,15 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
if ts != nil {
lastSyncTime := metav1.NewTime(ts.AsTime())
instance.Status.LastSyncTime = &lastSyncTime
td := info.GetLastSyncDuration()
if td != nil {
lastSyncDuration := metav1.Duration{Duration: td.AsDuration()}
instance.Status.LastSyncDuration = &lastSyncDuration
}
tb := info.GetLastSyncBytes()
if tb != 0 {
instance.Status.LastSyncBytes = &tb
}
}
requeueForInfo = true
} else if !util.IsUnimplementedError(err) {
Expand Down
6 changes: 5 additions & 1 deletion internal/sidecar/service/volumereplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,12 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(
if lastsynctime == nil {
klog.Errorf("Failed to get last sync time: %v", lastsynctime)
}
lastsyncduration := resp.GetLastSyncDuration()
lastsyncbytes := resp.GetLastSyncBytes()

return &proto.GetVolumeReplicationInfoResponse{
LastSyncTime: lastsynctime,
LastSyncTime: lastsynctime,
LastSyncDuration: lastsyncduration,
LastSyncBytes: lastsyncbytes,
}, nil
}

0 comments on commit 5f45cec

Please sign in to comment.