From 6ab2148dadbf9eac8853a6ad456b95feab68ae10 Mon Sep 17 00:00:00 2001 From: Divyen Patel Date: Thu, 2 Oct 2025 14:44:59 -0700 Subject: [PATCH] remove max reconcile thread limits for CSI operator --- pkg/syncer/cnsoperator/controller/cnsfileaccessconfig/util.go | 4 ---- .../cnsnodevmattachment/cnsnodevmattachment_controller.go | 4 ---- .../cnsnodevmbatchattachment_controller.go | 2 +- pkg/syncer/cnsoperator/controller/cnsregistervolume/util.go | 4 ---- pkg/syncer/cnsoperator/controller/cnsunregistervolume/util.go | 2 +- .../cnsvolumemetadata/cnsvolumemetadata_controller.go | 4 ---- .../virtualmachinesnapshot_controller.go | 2 +- 7 files changed, 3 insertions(+), 19 deletions(-) diff --git a/pkg/syncer/cnsoperator/controller/cnsfileaccessconfig/util.go b/pkg/syncer/cnsoperator/controller/cnsfileaccessconfig/util.go index e128d37311..c1ae80986c 100644 --- a/pkg/syncer/cnsoperator/controller/cnsfileaccessconfig/util.go +++ b/pkg/syncer/cnsoperator/controller/cnsfileaccessconfig/util.go @@ -85,10 +85,6 @@ func getMaxWorkerThreadsToReconcileCnsFileAccessConfig(ctx context.Context) int log.Warnf("Maximum number of worker threads to run set in env variable "+ "WORKER_THREADS_FILE_ACCESS_CONFIG %s is less than 1, will use the default value %d", v, defaultMaxWorkerThreadsForFileAccessConfig) - } else if value > defaultMaxWorkerThreadsForFileAccessConfig { - log.Warnf("Maximum number of worker threads to run set in env variable "+ - "WORKER_THREADS_FILE_ACCESS_CONFIG %s is greater than %d, will use the default value %d", - v, defaultMaxWorkerThreadsForFileAccessConfig, defaultMaxWorkerThreadsForFileAccessConfig) } else { workerThreads = value log.Debugf("Maximum number of worker threads to run to reconcile "+ diff --git a/pkg/syncer/cnsoperator/controller/cnsnodevmattachment/cnsnodevmattachment_controller.go b/pkg/syncer/cnsoperator/controller/cnsnodevmattachment/cnsnodevmattachment_controller.go index 02c475a5fa..787ccb75c8 100644 --- a/pkg/syncer/cnsoperator/controller/cnsnodevmattachment/cnsnodevmattachment_controller.go +++ b/pkg/syncer/cnsoperator/controller/cnsnodevmattachment/cnsnodevmattachment_controller.go @@ -883,10 +883,6 @@ func getMaxWorkerThreadsToReconcileCnsNodeVmAttachment(ctx context.Context) int log.Warnf("Maximum number of worker threads to run set in env variable "+ "WORKER_THREADS_NODEVM_ATTACH %s is less than 1, will use the default value %d", v, defaultMaxWorkerThreadsForNodeVMAttach) - } else if value > defaultMaxWorkerThreadsForNodeVMAttach { - log.Warnf("Maximum number of worker threads to run set in env variable "+ - "WORKER_THREADS_NODEVM_ATTACH %s is greater than %d, will use the default value %d", - v, defaultMaxWorkerThreadsForNodeVMAttach, defaultMaxWorkerThreadsForNodeVMAttach) } else { workerThreads = value log.Debugf("Maximum number of worker threads to run to reconcile CnsNodeVmAttachment "+ diff --git a/pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_controller.go b/pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_controller.go index df1c7d9f6a..2f24cc0669 100644 --- a/pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_controller.go +++ b/pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_controller.go @@ -192,7 +192,7 @@ func getMaxWorkerThreads(ctx context.Context) int { } switch { - case value <= 0 || value > defaultMaxWorkerThreads: + case value <= 0: log.Warnf("Value %s for WORKER_THREADS_NODEVM_BATCH_ATTACH is invalid. Using default value %d", envVal, defaultMaxWorkerThreads) default: diff --git a/pkg/syncer/cnsoperator/controller/cnsregistervolume/util.go b/pkg/syncer/cnsoperator/controller/cnsregistervolume/util.go index a919e2b971..54b9d4b8d7 100644 --- a/pkg/syncer/cnsoperator/controller/cnsregistervolume/util.go +++ b/pkg/syncer/cnsoperator/controller/cnsregistervolume/util.go @@ -403,10 +403,6 @@ func getMaxWorkerThreadsToReconcileCnsRegisterVolume(ctx context.Context) int { log.Warnf("Maximum number of worker threads to run set in env variable "+ "WORKER_THREADS_REGISTER_VOLUME %s is less than 1, will use the default value %d", v, defaultMaxWorkerThreadsForRegisterVolume) - } else if value > defaultMaxWorkerThreadsForRegisterVolume { - log.Warnf("Maximum number of worker threads to run set in env variable "+ - "WORKER_THREADS_REGISTER_VOLUME %s is greater than %d, will use the default value %d", - v, defaultMaxWorkerThreadsForRegisterVolume, defaultMaxWorkerThreadsForRegisterVolume) } else { workerThreads = value log.Debugf("Maximum number of worker threads to run to reconcile CnsRegisterVolume instances is set to %d", diff --git a/pkg/syncer/cnsoperator/controller/cnsunregistervolume/util.go b/pkg/syncer/cnsoperator/controller/cnsunregistervolume/util.go index 3b3f20f47f..97fb481a82 100644 --- a/pkg/syncer/cnsoperator/controller/cnsunregistervolume/util.go +++ b/pkg/syncer/cnsoperator/controller/cnsunregistervolume/util.go @@ -61,7 +61,7 @@ func getMaxWorkerThreads(ctx context.Context) int { } switch { - case val <= 0 || val > defaultMaxWorkerThreads: + case val <= 0: log.Warnf("Value %d for WORKER_THREADS_UNREGISTER_VOLUME is invalid. Using default value %d", val, defaultMaxWorkerThreads) default: diff --git a/pkg/syncer/cnsoperator/controller/cnsvolumemetadata/cnsvolumemetadata_controller.go b/pkg/syncer/cnsoperator/controller/cnsvolumemetadata/cnsvolumemetadata_controller.go index 7480d14106..3d6fa467ba 100644 --- a/pkg/syncer/cnsoperator/controller/cnsvolumemetadata/cnsvolumemetadata_controller.go +++ b/pkg/syncer/cnsoperator/controller/cnsvolumemetadata/cnsvolumemetadata_controller.go @@ -535,10 +535,6 @@ func getMaxWorkerThreadsToReconcileCnsVolumeMetadata(ctx context.Context) int { if value <= 0 { log.Warnf("Maximum number of worker threads to run set in env variable WORKER_THREADS_VOLUME_METADATA %s is "+ "less than 1, will use the default value %d", v, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata) - } else if value > defaultMaxWorkerThreadsToProcessCnsVolumeMetadata { - log.Warnf("Maximum number of worker threads to run set in env variable WORKER_THREADS_VOLUME_METADATA %s "+ - "is greater than %d, will use the default value %d", - v, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata) } else { workerThreads = value log.Debugf("Maximum number of worker threads to run is set to %d", workerThreads) diff --git a/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go b/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go index a378cefe97..f9f548a718 100644 --- a/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go +++ b/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go @@ -406,7 +406,7 @@ func getMaxWorkerThreadsToReconcileVirtualMachineSnapshot(ctx context.Context) i return workerThreads } switch { - case value <= 0 || value > defaultMaxWorkerThreadsForVirtualMachineSnapshot: + case value <= 0: log.Warnf("Value %s for WORKER_THREADS_VIRTUAL_MACHINE_SNAPSHOT is invalid. Using default value %d", envVal, defaultMaxWorkerThreadsForVirtualMachineSnapshot) default: