{"record":{"id":"5842617ce13ee48f","repo":"risingwavelabs/risingwave","slug":"no-worker-node-found-for-worker-slot-id","errorCode":null,"errorMessage":"No worker node found for worker slot id: {}","messagePattern":"No worker node found for worker slot id: (.+?)","errorType":"error_code","errorClass":"BatchError","httpStatus":null,"severity":"error","filePath":"src/batch/src/worker_manager/worker_node_manager.rs","lineNumber":160,"sourceCode":"        write_guard.serving_fragment_vnode_mapping = serving_mapping;\n    }\n\n    /// If worker slot ids is empty, the scheduler may fail to schedule any task and stuck at\n    /// schedule next stage. If we do not return error in this case, needs more complex control\n    /// logic above. Report in this function makes the schedule root fail reason more clear.\n    pub fn get_workers_by_worker_slot_ids(\n        &self,\n        worker_slot_ids: &[WorkerSlotId],\n    ) -> Result<Vec<WorkerNode>> {\n        if worker_slot_ids.is_empty() {\n            return Err(BatchError::EmptyWorkerNodes);\n        }\n        let guard = self.inner.read().unwrap();\n        let mut workers = Vec::with_capacity(worker_slot_ids.len());\n        for worker_slot_id in worker_slot_ids {\n            match guard.worker_nodes.get(&worker_slot_id.worker_id()) {\n                Some(worker) => workers.push((*worker).clone()),\n                None => bail!(\n                    \"No worker node found for worker slot id: {}\",\n                    worker_slot_id\n                ),\n            }\n        }\n\n        Ok(workers)\n    }\n\n    pub fn get_streaming_fragment_mapping(\n        &self,\n        fragment_id: &FragmentId,\n    ) -> Result<WorkerSlotMapping> {\n        let guard = self.inner.read().unwrap();\n\n        let Some(streaming_mapping) = guard.streaming_fragment_vnode_mapping.as_ref() else {\n            return Err(BatchError::StreamingVnodeMappingNotInitialized);\n        };","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/batch/src/worker_manager/worker_node_manager.rs#L142-L178","documentation":"Raised by WorkerNodeManager::get_workers_by_worker_slot_ids: an explicit guard that fires when the requested worker slot id list is empty. An empty list would otherwise make the scheduler fail to place any task and silently hang while waiting to schedule the next stage; this error makes the root cause of the scheduling failure explicit. The offending input is an empty worker_slot_ids slice passed by the scheduler.","triggerScenarios":"Thrown at src/batch/src/worker_manager/worker_node_manager.rs:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the caller (scheduler/planner) to never produce an empty worker slot list for a stage","Check cluster membership: if worker slots are derived from active worker nodes, ensure enough compute nodes are registered and running","Verify parallelism configuration so at least one parallel unit/worker slot is allocated per stage","If triggered by node failures, wait for the meta service to re-register workers, then retry the query"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}