Support Expiration Notice: Pentaho 9.3 is unsupported from July 1, 2026. See this article for details.

Get a grip on your data

With battle-tested solutions and a focus on foundational strength,

Pentaho helps you meet the challenges of an AI-driven world.

Analysis reports show inconsistent data across clustered Pentaho Server nodes after a Mondrian cache refresh

Article type: Knowledge Base – Troubleshooting / Best Practice
Product: Pentaho Business Analytics (Pentaho Server, Analyzer, Mondrian / Pentaho Analysis)
Applies to: Any deployment in which two or more Pentaho Server instances sit behind a load balancer, reverse proxy, or ingress (for example Kubernetes, OpenShift, Docker Swarm, VM clusters behind F5 / HAProxy / NGINX / Apache, or cloud load balancers)


Summary

In a high-availability (HA) or horizontally scaled Pentaho Server deployment, calling the Mondrian cache refresh REST API through the load balancer clears the cache on only one server node. The other nodes keep serving cached results from before the latest data warehouse (DWH) load. Users then see different numbers in the same Analysis report, depending on which node handles the request.

This article explains the cause and describes the supported ways to keep all nodes consistent after each data load.


Symptoms

  • A scheduled ETL process (for example a PDI job) loads new data into the DWH, then calls the Mondrian cache refresh endpoint, for example:
    POST https://<load-balancer>/pentaho/api/system/refresh/mondrianSchemaCache
  • After the refresh, some users see the new data and others still see the old data.
  • Refreshing the browser, logging in again, or opening the report in another session can change the figures shown.
  • Restarting all Pentaho Server nodes makes the data consistent again.

Cause

Mondrian, the OLAP engine behind Pentaho Analysis and Analyzer, keeps its caches in the memory (JVM) of each Pentaho Server instance:

Cache Contents Scope
Schema cache Parsed and validated OLAP schemas, including dimension members Per server instance
Segment (data) cache Aggregated cell values returned by previous queries Per server instance

The refresh REST API and the Mondrian CacheControl API act only on the instance that receives the request. A load balancer, proxy, or ingress sends each request to one node, by design. So:

  1. The ETL calls the refresh endpoint through the load balancer.
  2. The request reaches node A, which clears its cache.
  3. Nodes B, C, … never receive the request and keep serving the old cached data.

Sticky sessions or session affinity do not fix this. They decide which node a user reaches, but every node still needs to know that the data has changed.

Note: This is expected behavior of the per-node cache design, not a product defect. Any deployment with more than one Pentaho Server instance must handle cache refreshes for the cluster as a whole.


Resolution

Choose one of the options below, depending on your architecture and operational needs. See Recommendation for guidance on which to choose.

Option 1 – Send the cache refresh to every node directly

Change the post-load step so that it calls the refresh endpoint on each Pentaho Server node individually, bypassing the load balancer.

How it works

  1. Get the current list of Pentaho Server node addresses: - Static clusters (VMs or physical servers): keep the node list in configuration (for example a PDI variable or a properties file). - Kubernetes / OpenShift: create a headless Service (clusterIP: None) that selects the Pentaho Server pods. A DNS lookup of that Service returns the IP of every ready pod. You can also query the Endpoints / EndpointSlice API. - Other orchestrators or cloud platforms: use the service discovery or target-group API that the platform provides.
  2. Call the refresh endpoint on each node.
  3. Treat a failure on any node as a failure of the job, so that inconsistencies are caught and reported.

Example (shell, generic)

#!/bin/sh
# NODES: space-separated list of Pentaho Server base URLs, reachable directly (not via the load balancer)
# Example: NODES="http://pentaho-node1:8080 http://pentaho-node2:8080"
# Kubernetes example (headless Service):
#   NODES=$(getent ahostsv4 pentaho-headless.<namespace>.svc.cluster.local \
#           | awk '{print "http://"$1":8080"}' | sort -u)

FAILED=0
for node in $NODES; do
  if curl -sf -u "$PENTAHO_USER:$PENTAHO_PASSWORD" -X POST \
       "$node/pentaho/api/system/refresh/mondrianSchemaCache"; then
    echo "Cache refreshed on $node"
  else
    echo "ERROR: cache refresh failed on $node"
    FAILED=1
  fi
done
exit $FAILED

This script can be called from a PDI job (Shell job entry), or you can build the same logic in PDI with a list of node URLs feeding a REST Client / HTTP Post step.

Considerations

  • The process that runs the refresh needs network access to each node directly. In container platforms this usually means running the step inside the cluster, for example as a short-lived job started by the ETL.
  • The account used needs administrative rights on the Pentaho Server.
  • Some Pentaho versions also offer a per-schema endpoint (/pentaho/api/system/refresh/mondrianSingleSchemaCache?name=<CatalogName>), which clears a single catalog instead of all of them. Check that it is available in your version.
  • Nodes that start after the refresh begin with an empty cache, so they already serve current data.
  • Limitation: if nodes are added, replaced, or restarted while the refresh is running (for example during autoscaling), a node can be missed.
Pros Cons
Simple and quick to implement Needs direct network access to every node
No custom code inside Pentaho Server The node list must be accurate when the refresh runs
All nodes refresh within seconds Must be maintained as the topology changes

Instead of telling each node to clear its cache, this option makes every node detect on its own that the data has changed. It uses Mondrian's Dynamic Schema Processor (DSP) extension point.

How it works

  1. Control table: at the end of each successful load, the ETL writes a new load identifier (for example load_id or the load completion timestamp) to a small control table in the DWH. It writes it only after the data has been committed.
  2. Custom DSP: a Java class implementing mondrian.spi.DynamicSchemaProcessor is installed on every Pentaho Server node. Each time Mondrian requests the schema, the DSP: - reads the original schema, - gets the current load_id from the control table, cached in memory for a short time (for example 60 seconds) to avoid querying the DWH on every connection, - adds the load_id to the schema text (for example as an XML comment or an annotation).
  3. Automatic cache separation: Mondrian identifies cached schemas by a checksum of the processed schema text. When the load_id changes, the checksum changes, and Mondrian builds a new schema with new, empty caches. Data loaded before the change is no longer used. No refresh call is needed.

Configuration (summary)

  • Package the DSP as a JAR and add it to the Pentaho Server web application (for example pentaho-server/tomcat/webapps/pentaho/WEB-INF/lib) or the container image on every node.
  • In the Analysis data source parameters (Manage Data Sources → Analysis data source → Parameters), add: DynamicSchemaProcessor=<fully.qualified.ClassName> UseContentChecksum=true

Illustrative implementation outline

public class DwhVersionDsp extends mondrian.spi.impl.FilterDynamicSchemaProcessor {
  private static final long TTL_MS = 60_000;          // how often to re-check the load id
  private static volatile String cachedId = "init";
  private static volatile long fetchedAt = 0;

  @Override
  protected String filter(String schemaUrl, Util.PropertyList connectInfo,
                          InputStream stream) throws Exception {
    String schema = super.filter(schemaUrl, connectInfo, stream);
    return schema + "\n<!-- dwhLoadId=" + currentLoadId() + " -->";
  }

  private static String currentLoadId() {
    long now = System.currentTimeMillis();
    if (now - fetchedAt > TTL_MS) {
      synchronized (DwhVersionDsp.class) {
        if (now - fetchedAt > TTL_MS) {
          // Read the latest successful load id from the control table
          // (for example via the JNDI data source used by the DWH).
          // On error: log it and keep the last known id so that reporting continues.
          fetchedAt = now;
        }
      }
    }
    return cachedId;
  }
}

Important: the value added to the schema must be the identifier of the last data load, never the current date or time. Using the current time would make Mondrian build a new schema on every connection, which slows performance severely and increases memory use.

Considerations

  • Pickup delay: each node picks up the new load_id within the configured cache time (for example 60 seconds). For a short period after a load, nodes can differ by up to that amount of time.
  • First query after a load on each node rebuilds the schema and fills the cache again. This is the same cost as after a manual refresh. If needed, warm up key reports after the load.
  • Memory: schemas from previous loads stay in memory until the JVM garbage collector reclaims them. Monitor heap use after rollout.
  • Existing DSPs: Mondrian supports one DSP per data source. If you already use a DSP (for example for row-level security), the version logic must be merged into it.
  • Other caches: caches outside Mondrian, such as the CDA cache used by CTools dashboards, are not affected and must be handled separately if used.
  • Upgrades: custom DSP code must be retested whenever Pentaho Server is upgraded.
Pros Cons
No need to reach individual nodes; works through any proxy or load balancer Requires custom Java development and maintenance
Handles autoscaling, restarts and node replacement automatically Short, configurable delay before all nodes switch
Data freshness follows the data itself, not an external call Previous schemas use memory until garbage-collected
Also refreshes dimension member caches Must be retested on product upgrades

Option 3 – Rolling restart after each load (interim workaround)

Restarting each node one at a time after the load (for example a rolling restart of the deployment) clears all caches on all nodes.

  • With correctly configured health checks and enough nodes, users see no downtime.
  • All caches start empty, and restarts take longer than a cache refresh.
  • Recommended only as a temporary workaround while Option 1 or Option 2 is being implemented.

Option comparison

Criteria Option 1: Refresh every node Option 2: Versioned schema (DSP) Option 3: Rolling restart
Solves the inconsistency on its own Yes Yes Yes
Handles autoscaling / changing topology Partially Yes Yes
Custom development required Low (script / job) Medium (Java) None
Direct access to nodes required Yes No Platform access
Time until all nodes show new data Seconds Up to configured TTL Duration of restart
Edition All All All

Recommendation

  • Static or small clusters (fixed number of nodes): Option 1 is usually enough and the simplest to run.
  • Elastic, autoscaled, or container-based deployments (Kubernetes, OpenShift, cloud autoscaling groups): Option 2 is the most robust long-term solution, because it does not depend on knowing or reaching every node.
  • Use Option 3 only as a temporary measure.

Whichever option you choose, test it in a non-production environment with at least two Pentaho Server nodes behind the load balancer before rolling it out to production. Confirm that all nodes return the same results after a data load.


Professional Services

Our Professional Services team can help in the implementation. Talk to your Account Executive or Customer Success contact to know more about it.


Pentaho documentation

  • Cache control and propagation: confirms that Mondrian cache control operations apply to a single node and are not propagated across the members of a cluster.
  • Analyzer data multi-tenancy: how to implement a Dynamic Schema Processor and configure the DynamicSchemaProcessor and UseContentChecksum data source parameters.
  • Clearing the Mondrian Cache with Pentaho (best-practices document): methods for clearing the Mondrian cache in clustered environments, including the Dynamic Schema Processor approach.

Comments