ygerzhedovich commented on a change in pull request #9423:
URL: https://github.com/apache/ignite/pull/9423#discussion_r723327682
##########
File path:
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/stat/IgniteStatisticsManagerImpl.java
##########
@@ -163,61 +194,88 @@ else if (db == null)
if (log.isInfoEnabled())
log.info(String.format("Statistics usage state was changed
from %s to %s", oldVal, newVal));
+ lastUsageState = newVal;
+
if (oldVal == newVal)
return;
- switch (newVal) {
- case OFF:
- disableOperations();
+ if (newVal == ON || newVal == NO_UPDATE)
+ tryStart();
- break;
- case ON:
- case NO_UPDATE:
- enableOperations();
-
- break;
- }
+ if (newVal == OFF)
+ tryStop();
});
dispatcher.registerProperty(usageState);
});
- StatisticsUsageState currState = usageState();
- if (currState == ON || currState == NO_UPDATE)
- enableOperations();
-
- ctx.timeout().schedule(() -> {
- StatisticsUsageState state = usageState();
- if (state == ON && !ctx.isStopping()) {
- if (log.isTraceEnabled())
- log.trace("Processing statistics obsolescence...");
-
- try {
- processObsolescence();
- } catch (Throwable e) {
- log.warning("Error while processing statistics
obsolescence", e);
- }
- }
+ tryStart();
- }, OBSOLESCENCE_INTERVAL * 1000, OBSOLESCENCE_INTERVAL * 1000);
+ if (!ctx.clientNode()) {
+ // Use mgmt pool to work with statistics repository in busy lock
to schedule some tasks.
+ ctx.timeout().schedule(() -> {
Review comment:
Let's stop scheduled task during the component stop.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]