Ryan Gates
04/06/2026, 1:06 PMRocky
04/06/2026, 1:07 PMenable_datacache_sharing feature does indeed depend on the FE configuration enable_trace_historical_node.
Dependency
* enable_datacache_sharing (System Variable): This variable enables the Cache Sharing feature, which allows a node to fetch data from the cache of other nodes (peers) instead of remote storage during a local cache miss (often caused by cluster scaling).
* enable_trace_historical_node (FE Parameter): This must be set to true for enable_datacache_sharing to take effect. It allows the FE to maintain information about which nodes previously held specific data, enabling the routing logic required for peer-to-peer cache access.
How to Verify if Cache Sharing is Active
You can verify if Cache Sharing is actually working by examining the Query Profile of a running or completed query.
1. Enable Profile Collection:
sql
SET enable_profile = true;
2. Run your query (ideally after a cluster scaling event or when you suspect cache misses are occurring).
3. Check the Profile:
Look for the following metrics under the SCAN node or DataCache section in the profile:
* DataCacheReadPeerCounter: The number of times data was successfully read from other BE nodes.
* DataCacheReadPeerBytes: The total amount of data (in bytes) transferred from peer nodes via Cache Sharing.
* DataCacheReadPeerTimer: The total time spent reading data from peer nodes.
If these metrics are greater than 0, then Cache Sharing is actively being used.
Summary of Configuration
To ensure it is enabled, you should check/set:
1. FE Config (fe.conf):
enable_trace_historical_node = true (Requires FE restart if changed in config file, or use ADMIN SET FRONTEND CONFIG).
2. System Variable:
SET GLOBAL enable_datacache_sharing = true; (Default is usually true since v3.5.1).
3. Work Period (Optional):
`datacache_sharing_work_period`: This variable (default 600s) determines how long after a scaling event the system will attempt to share cache. If you are testing long after a scale-out/in, you might need to increase this to verify behavior.
References
• data_source/data_cache.md
• deployment/shared_data/feature-support-shared-data.md
• sql-reference/System_variable.md
• administration/management/BE_configuration.md
• using_starrocks/caching/block_cache.md
• data_source/data_cache_troubleshooting.md