{"record":{"id":"0bde365fec5950eb","repo":"databendlabs/databend","slug":"unreachable-0bde36","errorCode":null,"errorMessage":"_ => unreachable!()","messagePattern":"_ => unreachable!\\(\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/pipelines/processors/transforms/hash_join/transform_hash_join_build.rs","lineNumber":283,"sourceCode":"                            if let Some(builder) = self.runtime_filter_builder.as_mut() {\n                                builder.add_block(data_block)?;\n                            }\n                        }\n                    }\n                }\n                self.data_blocks.clear();\n                self.is_collect_finished = true;\n                self.build_state.collect_done()\n            }\n            Step::Sync(SyncStep::Finalize) => {\n                if let Some(task) = self.build_state.finalize_task() {\n                    self.build_state.finalize(task)\n                } else {\n                    self.is_finalize_finished = true;\n                    self.build_state.finalize_done(self.hash_table_type)\n                }\n            }\n            _ => unreachable!(),\n        }\n    }\n\n    #[async_backtrace::framed]\n    async fn async_process(&mut self) -> Result<()> {\n        match &self.step {\n            Step::Async(AsyncStep::CheckSpillHappen) => {\n                self.build_state.barrier.wait().await;\n                self.is_spill_happen_checked = true;\n                self.is_spill_happened = self\n                    .build_state\n                    .hash_join_state\n                    .is_spill_happened\n                    .load(Ordering::Acquire);\n            }\n            Step::Async(AsyncStep::WaitCollect) => {\n                if let Some(builder) = self.runtime_filter_builder.take() {\n                    let spill = self","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/processors/transforms/hash_join/transform_hash_join_build.rs#L265-L301","documentation":"The build transform's process() matches on its Step enum to drive the pipeline state machine. The catch-all arm panics, meaning a Step variant (e.g. a synchronous step not expected in process, or a wrongly-set step) reached the synchronous processing path. This is an internal state-machine invariant: only specific steps are valid for synchronous processing.","triggerScenarios":"The transform's step field holds a Step value that process() does not explicitly handle (e.g. an async-only step, or a stale step left after a state transition bug).","commonSituations":"Regressions after adding new AsyncStep/Step variants without updating process(); pipeline scheduling anomalies where event()/process()/async_process() interleave unexpectedly.","solutions":["Add a match arm for the unexpected Step variant in process(), or route it to the correct handler","Log the actual step value in the panic message to accelerate diagnosis","Audit all Step/AsyncStep variants and confirm each is handled in exactly the right phase","Check recent changes to the build transform state machine"],"exampleFix":"// before\n_ => unreachable!(),\n// after\nother => unreachable!(\"TransformHashJoinBuild::process got unexpected step: {:?}\", other),","handlingStrategy":"validation","validationCode":"// Assert the step is valid for synchronous processing before calling process()\nmatch &self.step {\n    Step::NeedInput | Step::Consume => {},\n    other => return Err(ErrorCode::Internal(format!(\"invalid step for process(): {:?}\", other))),\n}","typeGuard":"fn sync_step(s: &Step) -> bool {\n    matches!(s, Step::NeedInput | Step::Consume | Step::Sync(_))\n}","tryCatchPattern":null,"preventionTips":["Include the step value in every unreachable! in pipeline state machines","Add new Step variants' handling in the same commit that introduces them","Write state-machine tests driving process()/async_process() through all steps"],"tags":["rust","panic","state-machine","hash-join","pipeline"],"backgroundTag":"internal-invariant-violation","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}