zstan commented on code in PR #12654:
URL: https://github.com/apache/ignite/pull/12654#discussion_r2719972595
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/DistributedCalciteConfiguration.java:
##########
@@ -95,31 +125,28 @@ public String[] disabledRules() {
log
);
- disabledRules.addListener(new DistributePropertyListener<>() {
- @Override public void onUpdate(String name, String[] oldVal,
String[] newVal) {
- if (oldVal != null && F.compareArrays(oldVal, newVal) != 0) {
- if (qryPlanCache != null) {
- if (log.isInfoEnabled()) {
- log.info("Cleaning Calcite's cache plan by
changing of the property '"
- + DISABLED_RULES_PROPERTY_NAME + "'.");
- }
-
- qryPlanCache.clear();
- }
- }
- }
- });
+ disabledRules.addListener(planCacheCleaner);
+
+ registerProperty(
+ dispatcher,
+ PLAN_CACHE_SIZE_PROPERTY_NAME,
+ prop -> planCacheSize = prop,
+ () -> new SimpleDistributedProperty<>(
+ PLAN_CACHE_SIZE_PROPERTY_NAME,
+ Integer::parseInt,
+ "Calcite's plan cache size. NOTE: cleans the planning cache on
change."
Review Comment:
i found that cache is cleared on configuration changes just because it
property is propagate through QueryPlanCacheImpl#clear method - why do we need
such approach ? It can lead to unexpected spikes.
--
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]