{"record":{"id":"0e008437478a990c","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-evic","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! eviction was used.","messagePattern":"CacheStore cannot be used on the worker node! eviction was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2084,"sourceCode":"        _timeout: u64,\n    ) -> Result<Option<QueueResultResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_result_blocking was used.\")\n    }\n\n    async fn queue_merge_extra(&self, _key: QueueKey, _payload: String) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_merge_extra was used.\")\n    }\n\n    async fn compaction(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! compaction was used.\")\n    }\n\n    async fn info(&self) -> Result<CachestoreInfo, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! info was used.\")\n    }\n\n    async fn eviction(&self) -> Result<EvictionResult, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! eviction was used.\")\n    }\n\n    async fn persist(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! persist was used.\")\n    }\n\n    async fn healthcheck(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! healthcheck was used.\")\n    }\n\n    async fn rocksdb_properties(&self) -> Result<Vec<RocksPropertyRow>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! rocksdb_properties was used.\")\n    }\n\n    async fn wipe(&self) -> Result<(), CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! wipe was used.\")\n    }\n}","sourceCodeStart":2066,"sourceCodeEnd":2102,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2066-L2102","documentation":"CacheStore::eviction triggers cache eviction policy execution. On worker nodes it is a deliberate panic! stub (cache_rocksstore.rs:2084): eviction is a master-side responsibility and worker cache stores never run it. The panic indicates eviction was requested on the wrong node.","triggerScenarios":"Calling CacheStore::eviction() on a worker-node CacheStore (cache_rocksstore.rs:2084), e.g. from an eviction loop or admin command routed to a worker.","commonSituations":"Eviction/management loops misconfigured to run cluster-wide; topology changes where a worker inherited master-era scheduler code.","solutions":["Run eviction only on the master node's store","Point management commands to the master endpoint","Add an is-master assertion before invoking eviction in shared code"],"exampleFix":"// before\nstore.eviction().await?; // runs everywhere\n// after\nif is_master { master_store.eviction().await?; }","handlingStrategy":"validation","validationCode":"if !is_master { return Err(CubeError::internal(\"eviction is master-only\")); }\nmaster_client.eviction().await?;","typeGuard":"fn supports_eviction(store: &dyn CacheStore) -> bool { node_role == NodeRole::Master }","tryCatchPattern":"std::panic::catch_unwind(AssertUnwindSafe(|| master_client.eviction())).map_err(|_| CubeError::internal(\"eviction called on worker node\"))?;","preventionTips":["Run eviction loops only on the master","Gate eviction triggers with role assertions","Review topology code after failover/promotion","Monitor for panic-rate spikes on worker nodes"],"tags":["cubestore","rust","panic","cache-store","worker-node","eviction"],"backgroundTag":"cachestore-not-usable-on-worker","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}