Disable creating StorPool logs when there isn't StorPool primary storage (#6317)

There is not need to create log files for StorPool driver when there
isn't a StorPool primary storage
This commit is contained in:
slavkap 2022-04-27 13:24:44 +03:00 committed by GitHub
parent f8920b9312
commit 453bb57fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -89,9 +89,13 @@ public class StorPoolAbandonObjectsCollector extends ManagerBase implements Conf
}
private void init() {
List<StoragePoolVO> spPools = storagePoolDao.findPoolsByProvider(StorPoolUtil.SP_PROVIDER_NAME);
if (CollectionUtils.isNotEmpty(spPools)) {
StorPoolHelper.appendLogger(log, ABANDON_LOG, "abandon");
}
_volumeTagsUpdateExecutor = Executors.newScheduledThreadPool(2,
new NamedThreadFactory("StorPoolAbandonObjectsCollector"));
StorPoolHelper.appendLogger(log, ABANDON_LOG, "abandon");
if (volumeCheckupTagsInterval.value() > 0) {
_volumeTagsUpdateExecutor.scheduleAtFixedRate(new StorPoolVolumesTagsUpdate(),
volumeCheckupTagsInterval.value(), volumeCheckupTagsInterval.value(), TimeUnit.SECONDS);

View File

@ -898,7 +898,7 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
}
public void handleQualityOfServiceForVolumeMigration(VolumeInfo arg0, QualityOfServiceState arg1) {
StorPoolUtil.spLog("handleQualityOfServiceForVolumeMigration with volume name=%s", arg0.getName());
log.debug(String.format("handleQualityOfServiceForVolumeMigration with volume name=%s is not supported", arg0.getName()));
}

View File

@ -81,11 +81,11 @@ public class StorPoolSnapshotStrategy implements SnapshotStrategy {
snapshotObj.processEvent(Snapshot.Event.BackupToSecondary);
snapshotObj.processEvent(Snapshot.Event.OperationSucceeded);
} catch (NoTransitionException ex) {
StorPoolUtil.spLog("Failed to change state: " + ex.toString());
log.debug("Failed to change state: " + ex.toString());
try {
snapshotObj.processEvent(Snapshot.Event.OperationFailed);
} catch (NoTransitionException ex2) {
StorPoolUtil.spLog("Failed to change state: " + ex2.toString());
log.debug("Failed to change state: " + ex2.toString());
}
}
return snapshotInfo;
@ -126,7 +126,7 @@ public class StorPoolSnapshotStrategy implements SnapshotStrategy {
@Override
public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) {
StorPoolUtil.spLog("StorpoolSnapshotStrategy.canHandle: snapshot=%s, uuid=%s, op=%s", snapshot.getName(), snapshot.getUuid(), op);
log.debug(String.format("StorpoolSnapshotStrategy.canHandle: snapshot=%s, uuid=%s, op=%s", snapshot.getName(), snapshot.getUuid(), op));
if (op != SnapshotOperation.DELETE) {
return StrategyPriority.CANT_HANDLE;