risingwavelabs/risingwave · error · anyhow::Error
should get AlignInitialEpochResponse but get {:?}
Error message
should get AlignInitialEpochResponse but get {:?} What it means
SinkCoordinateClient::align_initial_epoch sends an AlignInitialEpochRequest and expects an AlignInitialEpochResponse carrying the aligned epoch. Any other response triggers this error, meaning epoch alignment with the sink coordinator did not complete as expected.
Source
Thrown at src/rpc_client/src/sink_coordinate_client.rs:163
CoordinateResponse {
msg: Some(coordinate_response::Msg::Stopped(_)),
} => Ok(()),
msg => Err(anyhow!("should get Stopped but get {:?}", msg)),
}
}
pub async fn align_initial_epoch(&mut self, initial_epoch: u64) -> anyhow::Result<u64> {
self.send_request(CoordinateRequest {
msg: Some(coordinate_request::Msg::AlignInitialEpochRequest(
initial_epoch,
)),
})
.await?;
match self.next_response().await? {
CoordinateResponse {
msg: Some(coordinate_response::Msg::AlignInitialEpochResponse(epoch)),
} => Ok(epoch),
msg => Err(anyhow!(
"should get AlignInitialEpochResponse but get {:?}",
msg
)),
}
}
}
View on GitHub (pinned to 6469eb736d)
Solutions
- Read the debug-printed `msg` to see the unexpected response
- Recreate the coordination stream and redo initialization (align_initial_epoch) from scratch
- Check coordinator logs and align component versions
Defensive patterns
Strategy: retry
Try / catch
// Rust
let epoch = loop {
match client.align_initial_epoch(initial_epoch).await {
Ok(e) => break e,
Err(e) if e.to_string().contains("AlignInitialEpochResponse") && retries < 3 => {
retries += 1;
client = SinkCoordinateClient::start(...).await?;
}
Err(e) => return Err(e),
}
}; Prevention
- Perform epoch alignment once, at sink init, on a fresh stream
- Recreate the stream rather than reusing one after a failed round-trip
- Keep compute node and coordinator versions aligned
When it happens
Trigger: Calling align_initial_epoch during sink initialization when the coordinator returns a different CoordinateResponse variant — stale buffered response, coordinator restart, or protocol version skew.
Common situations: Sink startup racing with coordinator restart; stream desync from earlier failed calls; compute node/meta version mismatch after upgrade.
Related errors
- should get Sync response but get {:?}
- should get Commit response but get {:?}
- should get commit response but get {:?}
- should get start response but get {:?}
- get none metadata in commit response for coordinated sink wr
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/6ddbd61436708e3b.
Report an issue: GitHub.