{"record":{"id":"89d3da3649074771","repo":"cube-js/cube","slug":"cachestore-cannot-be-used-on-the-worker-node-comp","errorCode":null,"errorMessage":"CacheStore cannot be used on the worker node! compaction was used.","messagePattern":"CacheStore cannot be used on the worker node! compaction was used\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs","lineNumber":2076,"sourceCode":"        _external_id: Option<String>,\n    ) -> Result<Option<QueueResultResponse>, CubeError> {\n        panic!(\"CacheStore cannot be used on the worker node! queue_result was used.\")\n    }\n\n    async fn queue_result_blocking(\n        &self,\n        _key: QueueKey,\n        _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","sourceCodeStart":2058,"sourceCodeEnd":2094,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/cachestore/cache_rocksstore.rs#L2058-L2094","documentation":"CacheStore::compaction triggers RocksDB compaction of the cache store. On worker nodes the method is an unconditional panic! stub (cache_rocksstore.rs:2076) because compaction/queue maintenance is a master-side operation. This is a guard against invoking node-management operations on a cache-only store.","triggerScenarios":"Calling CacheStore::compaction() on a worker-node store, e.g. from a maintenance routine or an admin command routed to the wrong node (cache_rocksstore.rs:2076).","commonSituations":"Ops scripts issuing compaction to every node in the cluster; monitoring/admin tooling hitting worker nodes with master-only commands.","solutions":["Issue compaction only to the master CubeStore node","Filter cluster targets in admin/ops tooling to master-capable nodes","Add role checks in the maintenance code path before calling compaction"],"exampleFix":"// before\nfor node in all_nodes { node.compaction().await?; }\n// after\nfor node in master_nodes { node.compaction().await?; }","handlingStrategy":"validation","validationCode":"if !is_master { return Err(CubeError::internal(\"compaction is master-only\")); }\nmaster_client.compaction().await?;","typeGuard":"fn supports_maintenance(store: &dyn CacheStore) -> bool { node_role == NodeRole::Master }","tryCatchPattern":"std::panic::catch_unwind(AssertUnwindSafe(|| master_client.compaction())).map_err(|_| CubeError::internal(\"compaction called on worker node\"))?;","preventionTips":["Target compaction at master nodes only","Filter node lists in ops scripts by role","Verify topology before running maintenance commands","Prefer role-aware admin APIs over direct store calls"],"tags":["cubestore","rust","panic","cache-store","worker-node","compaction"],"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"}