{"record":{"id":"fc721a79f43ce2a9","repo":"risingwavelabs/risingwave","slug":"no-upstream-while-snapshot-epoch-not-set","errorCode":null,"errorMessage":"no upstream while snapshot epoch not set","messagePattern":"no upstream while snapshot epoch not set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/backfill/snapshot_backfill/executor.rs","lineNumber":199,"sourceCode":"                } else {\n                    None\n                }\n            } else {\n                // must go through snapshot backfill when having no upstream\n                Some(snapshot_epoch)\n            }\n        } else {\n            // when snapshot epoch is not set, the StreamNode must be created previously and has finished the backfill\n            if cfg!(debug_assertions) {\n                panic!(\n                    \"snapshot epoch not set. first_upstream_epoch: {:?}, first_recv_epoch: {:?}\",\n                    upstream.map(|(first_upstream_barrier, _)| first_upstream_barrier.epoch),\n                    first_recv_barrier.epoch\n                );\n            } else {\n                let (first_upstream_barrier, _) = upstream\n                    .as_ref()\n                    .ok_or_else(|| anyhow!(\"no upstream while snapshot epoch not set\"))?;\n                warn!(first_upstream_epoch = ?first_upstream_barrier.epoch, first_recv_epoch=?first_recv_barrier.epoch, \"snapshot epoch not set\");\n                assert_eq!(first_upstream_barrier.epoch, first_recv_barrier.epoch);\n                None\n            }\n        };\n        let first_recv_barrier_epoch = first_recv_barrier.epoch;\n        let initial_backfill_paused =\n            first_recv_barrier.is_backfill_pause_on_startup(self.actor_ctx.fragment_id);\n        yield Message::Barrier(first_recv_barrier);\n        let mut backfill_state = BackfillState::new(\n            self.progress_state_table,\n            first_recv_barrier_epoch,\n            self.upstream_table.pk_serializer().clone(),\n        )\n        .await?;\n\n        let (mut barrier_epoch, mut need_report_finish, upstream) = {\n            if let Some(snapshot_epoch) = should_snapshot_backfill {","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/backfill/snapshot_backfill/executor.rs#L181-L217","documentation":"In the snapshot backfill executor's execute_inner, the snapshot epoch must be initialized from the first upstream barrier. If snapshot_epoch is None but there is no upstream entry to read the epoch from, the executor cannot proceed and throws this error instead of panicking.","triggerScenarios":"The executor's barrier alignment finishes without receiving any upstream message while the snapshot epoch was never set — i.e. the upstream channel list is empty at the point where the first barrier must establish the snapshot epoch.","commonSituations":"Upstream fragment not yet scheduled/connected when the backfill actor starts; upstream actor crashed before delivering its first barrier; mis-wired fragment dependency in the stream graph after a meta scheduling failure.","solutions":["Recover/retry the job so the meta service reconnects the upstream actor before this one starts","Check meta logs for upstream fragment scheduling or actor creation failures","Cancel and recreate the streaming job if the graph dependency is broken","Upgrade to a version with fragment scheduling fixes if this occurs consistently at job creation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match execute_inner().await {\n    Err(e) if e.to_string().contains(\"no upstream while snapshot epoch not set\") => {\n        // upstream actor missing: check meta scheduling logs and recover the job\n    }\n    r => r?,\n}","preventionTips":["Ensure upstream fragments are scheduled before dependent backfill actors start","Monitor meta service scheduling errors during job creation"],"tags":["rust","streaming","backfill","barrier","upstream"],"backgroundTag":"missing-required-argument","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}