<@U0A71G31CDV> in 4.0.5, does enable_datacache_sha...
# questions-and-troubleshooting
r
@Rocky in 4.0.5, does enable_datacache_sharing depend on enable_trace_historical_node = true? How can we verify if enable_datacache_sharing is actually being used or not?
r
In StarRocks 4.0.5, the
enable_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:
Copy code
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. Referencesdata_source/data_cache.mddeployment/shared_data/feature-support-shared-data.mdsql-reference/System_variable.mdadministration/management/BE_configuration.mdusing_starrocks/caching/block_cache.mddata_source/data_cache_troubleshooting.md