{"record":{"id":"d2795c103eb6f1ca","repo":"risingwavelabs/risingwave","slug":"newly-start-epoch-after-update-vnode-bitmap-not","errorCode":null,"errorMessage":"newly start epoch {} after update vnode bitmap not matched with prev_epoch {}","messagePattern":"newly start epoch (.+?) after update vnode bitmap not matched with prev_epoch (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/coordinate.rs","lineNumber":244,"sourceCode":"                                    is_stop,\n                                    \"schema change should stop current sink for sink {}\",\n                                    self.param.sink_id\n                                );\n                            }\n                            coordinator_stream_handle\n                                .commit(epoch, metadata, schema_change)\n                                .await?;\n                            sink_writer_metrics\n                                .sink_commit_duration\n                                .observe(start_time.elapsed().as_secs_f64());\n\n                            current_checkpoint = 0;\n                            if let Some(new_vnode_bitmap) = new_vnode_bitmap {\n                                let epoch = coordinator_stream_handle\n                                    .update_vnode_bitmap(&new_vnode_bitmap)\n                                    .await?;\n                                if epoch != prev_epoch {\n                                    bail!(\n                                        \"newly start epoch {} after update vnode bitmap not matched with prev_epoch {}\",\n                                        epoch,\n                                        prev_epoch\n                                    );\n                                }\n                            }\n                            if is_stop {\n                                coordinator_stream_handle.stop().await?;\n                                info!(\n                                    sink_id = %self.param.sink_id,\n                                    \"coordinated log sinker stops\"\n                                );\n                                log_reader.truncate(TruncateOffset::Barrier { epoch })?;\n                                return pending().await;\n                            }\n                            log_reader.truncate(TruncateOffset::Barrier { epoch })?;\n                        } else {\n                            let metadata = sink_writer.barrier(false).await?;","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/coordinate.rs#L226-L262","documentation":"After applying a new vnode bitmap via coordinator_stream_handle.update_vnode_bitmap, the handle returns the epoch at which the update took effect. The coordinator requires this epoch to equal prev_epoch (the epoch the stream will resume from); a mismatch means the sink coordination state and the stream's epoch are out of sync after scaling.","triggerScenarios":"During consume_log_and_sink's scale-in/out handling: new_vnode_bitmap is Some, update_vnode_bitmap(new_vnode_bitmap) returns an epoch that differs from prev_epoch.","commonSituations":"Sink rescaling (fragment parallelism change) concurrent with recovery; meta returned a commit epoch that differs from the epoch recorded before the bitmap update due to concurrent barrier/scale operations.","solutions":["Retry the recovery/scale operation; transient epoch mismatch often resolves once no scale is in flight.","Check meta logs to see why update_vnode_bitmap committed at a different epoch than prev_epoch.","Recover from an earlier consistent checkpoint so prev_epoch matches the bitmap-update epoch."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err.to_string().contains(\"not matched with prev_epoch\") {\n    // wait for in-flight rescale to settle, then restart recovery from last checkpoint\n}","preventionTips":["Avoid triggering sink rescaling while recovery is in progress.","Recover from checkpoints that precede any vnode bitmap changes."],"tags":["rust","risingwave","sink","rescale","epoch"],"backgroundTag":"invalid-state-transition","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"}