diff --git a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_disk_task.go b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_disk_task.go index 47211f3ba00..9bb50d53f66 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_disk_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_disk_task.go @@ -112,15 +112,12 @@ func (t *createSnapshotFromDiskTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } @@ -146,7 +143,7 @@ func (t *createSnapshotFromDiskTask) lockBaseSnapshot( if diskParams.IsDiskRegistryBasedDisk { logging.Info( ctx, - "Performing full snapshot %v of disk %v because it is registry based", + "Performing full snapshot %v of disk %v because it is Disk Registry based", snapshotMeta.ID, t.request.SrcDisk.DiskId, ) diff --git a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_legacy_snapshot_task.go b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_legacy_snapshot_task.go index 64a68c85c19..9e3d11b0bd4 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_legacy_snapshot_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_legacy_snapshot_task.go @@ -10,6 +10,7 @@ import ( "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/snapshot" "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/snapshot/storage" "github.com/ydb-platform/nbs/cloud/tasks" + "github.com/ydb-platform/nbs/cloud/tasks/logging" ) //////////////////////////////////////////////////////////////////////////////// @@ -183,14 +184,11 @@ func (t *createSnapshotFromLegacySnapshotTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } diff --git a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_snapshot_task.go b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_snapshot_task.go index 4f9f6a2052d..22d244d06c4 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_snapshot_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_snapshot_task.go @@ -8,6 +8,7 @@ import ( "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/protos" "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/snapshot/storage" "github.com/ydb-platform/nbs/cloud/tasks" + "github.com/ydb-platform/nbs/cloud/tasks/logging" ) //////////////////////////////////////////////////////////////////////////////// @@ -127,14 +128,11 @@ func (t *createSnapshotFromSnapshotTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } diff --git a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_url_task.go b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_url_task.go index 5a5658b36b4..ccaf4d5431a 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_url_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/create_snapshot_from_url_task.go @@ -14,6 +14,7 @@ import ( "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/url" "github.com/ydb-platform/nbs/cloud/tasks" "github.com/ydb-platform/nbs/cloud/tasks/errors" + "github.com/ydb-platform/nbs/cloud/tasks/logging" ) //////////////////////////////////////////////////////////////////////////////// @@ -204,14 +205,11 @@ func (t *createSnapshotFromURLTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } diff --git a/cloud/disk_manager/internal/pkg/dataplane/replicate_disk_task.go b/cloud/disk_manager/internal/pkg/dataplane/replicate_disk_task.go index b5cfeced2a6..40b6edf9c0b 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/replicate_disk_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/replicate_disk_task.go @@ -144,6 +144,7 @@ func (t *replicateDiskTask) saveProgress( t.state.SecondsRemaining = int64(bytesToReplicate / bytesPerSecond) t.state.UpdatedAt = timestamppb.Now() + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } diff --git a/cloud/disk_manager/internal/pkg/dataplane/transfer_from_disk_to_disk_task.go b/cloud/disk_manager/internal/pkg/dataplane/transfer_from_disk_to_disk_task.go index 78cddd8ef3e..c28e92fcc70 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/transfer_from_disk_to_disk_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/transfer_from_disk_to_disk_task.go @@ -11,6 +11,7 @@ import ( "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/nbs" "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/protos" "github.com/ydb-platform/nbs/cloud/tasks" + "github.com/ydb-platform/nbs/cloud/tasks/logging" ) //////////////////////////////////////////////////////////////////////////////// @@ -150,14 +151,11 @@ func (t *transferFromDiskToDiskTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) } diff --git a/cloud/disk_manager/internal/pkg/dataplane/transfer_from_snapshot_to_disk_task.go b/cloud/disk_manager/internal/pkg/dataplane/transfer_from_snapshot_to_disk_task.go index 356cc90627b..869a0ac84ca 100644 --- a/cloud/disk_manager/internal/pkg/dataplane/transfer_from_snapshot_to_disk_task.go +++ b/cloud/disk_manager/internal/pkg/dataplane/transfer_from_snapshot_to_disk_task.go @@ -13,6 +13,7 @@ import ( "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/snapshot" "github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/dataplane/snapshot/storage" "github.com/ydb-platform/nbs/cloud/tasks" + "github.com/ydb-platform/nbs/cloud/tasks/logging" ) //////////////////////////////////////////////////////////////////////////////// @@ -131,14 +132,11 @@ func (t *transferFromSnapshotToDiskTask) saveProgress( execCtx tasks.ExecutionContext, ) error { - if t.state.Progress == 1 { - return nil - } - if t.state.ChunkCount != 0 { t.state.Progress = float64(t.state.MilestoneChunkIndex) / float64(t.state.ChunkCount) } + logging.Debug(ctx, "saving state %+v", t.state) return execCtx.SaveState(ctx) }