Skip to content

Commit

Permalink
Merge pull request #7458 from Lyndon-Li/issue-fix-7308
Browse files Browse the repository at this point in the history
Issue 7308: change the data path requeue time to 5 second
  • Loading branch information
Lyndon-Li authored Feb 22, 2024
2 parents 74bf4c3 + e1bcdf0 commit 174c10f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/7458-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue #7308, change the data path requeue time to 5 second for data mover backup/restore, PVB and PVR.
2 changes: 1 addition & 1 deletion pkg/controller/data_download_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (r *DataDownloadReconciler) Reconcile(ctx context.Context, req ctrl.Request
if err != nil {
if err == datapath.ConcurrentLimitExceed {
log.Info("Data path instance is concurrent limited requeue later")
return ctrl.Result{Requeue: true, RequeueAfter: time.Minute}, nil
return ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5}, nil
} else {
return r.errorOut(ctx, dd, err, "error to create data path", log)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/data_download_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestDataDownloadReconcile(t *testing.T) {
dataMgr: datapath.NewManager(0),
notNilExpose: true,
notMockCleanUp: true,
expectedResult: &ctrl.Result{Requeue: true, RequeueAfter: time.Minute},
expectedResult: &ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5},
},
{
name: "Error getting volume directory name for pvc in pod",
Expand Down Expand Up @@ -416,8 +416,8 @@ func TestDataDownloadReconcile(t *testing.T) {
require.NotNil(t, actualResult)

if test.expectedResult != nil {
assert.Equal(t, test.expectedResult.Requeue, test.expectedResult.Requeue)
assert.Equal(t, test.expectedResult.RequeueAfter, test.expectedResult.RequeueAfter)
assert.Equal(t, test.expectedResult.Requeue, actualResult.Requeue)
assert.Equal(t, test.expectedResult.RequeueAfter, actualResult.RequeueAfter)
}

dd := velerov2alpha1api.DataDownload{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_upload_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (r *DataUploadReconciler) Reconcile(ctx context.Context, req ctrl.Request)
if err != nil {
if err == datapath.ConcurrentLimitExceed {
log.Info("Data path instance is concurrent limited requeue later")
return ctrl.Result{Requeue: true, RequeueAfter: time.Minute}, nil
return ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5}, nil
} else {
return r.errorOut(ctx, du, err, "error to create data path", log)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/data_upload_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func TestReconcile(t *testing.T) {
du: dataUploadBuilder().Phase(velerov2alpha1api.DataUploadPhasePrepared).SnapshotType(fakeSnapshotType).Result(),
expectedProcessed: false,
expected: dataUploadBuilder().Phase(velerov2alpha1api.DataUploadPhasePrepared).Result(),
expectedRequeue: ctrl.Result{Requeue: true, RequeueAfter: time.Minute},
expectedRequeue: ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5},
},
{
name: "prepare timeout",
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pod_volume_backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (r *PodVolumeBackupReconciler) Reconcile(ctx context.Context, req ctrl.Requ
fsBackup, err := r.dataPathMgr.CreateFileSystemBR(pvb.Name, pVBRRequestor, ctx, r.Client, pvb.Namespace, callbacks, log)
if err != nil {
if err == datapath.ConcurrentLimitExceed {
return ctrl.Result{Requeue: true, RequeueAfter: time.Minute}, nil
return ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5}, nil
} else {
return r.errorOut(ctx, &pvb, err, "error to create data path", log)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pod_volume_backup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ var _ = Describe("PodVolumeBackup Reconciler", func() {
expected: builder.ForPodVolumeBackup(velerov1api.DefaultNamespace, "pvb-1").
Phase("").
Result(),
expectedRequeue: ctrl.Result{Requeue: true, RequeueAfter: time.Minute},
expectedRequeue: ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5},
}),
)
})
2 changes: 1 addition & 1 deletion pkg/controller/pod_volume_restore_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *PodVolumeRestoreReconciler) Reconcile(ctx context.Context, req ctrl.Req
fsRestore, err := c.dataPathMgr.CreateFileSystemBR(pvr.Name, pVBRRequestor, ctx, c.Client, pvr.Namespace, callbacks, log)
if err != nil {
if err == datapath.ConcurrentLimitExceed {
return ctrl.Result{Requeue: true, RequeueAfter: time.Minute}, nil
return ctrl.Result{Requeue: true, RequeueAfter: time.Second * 5}, nil
} else {
return c.errorOut(ctx, pvr, err, "error to create data path", log)
}
Expand Down

0 comments on commit 174c10f

Please sign in to comment.