{"record":{"id":"ee6dae7017ba7498","repo":"risingwavelabs/risingwave","slug":"should-get-sync-response-but-get","errorCode":null,"errorMessage":"should get Sync response but get {:?}","messagePattern":"should get Sync response but get (.+?)","errorType":"exception","errorClass":"RpcError","httpStatus":null,"severity":"error","filePath":"src/rpc_client/src/connector_client.rs","lineNumber":67,"sourceCode":"                is_checkpoint,\n            })),\n        })\n        .await\n    }\n}\n\nimpl SinkWriterResponseReceiver {\n    pub async fn next_commit_response(&mut self) -> Result<CommitResponse> {\n        loop {\n            match self.next_response().await? {\n                SinkWriterStreamResponse {\n                    response: Some(sink_writer_stream_response::Response::Commit(rsp)),\n                } => return Ok(rsp),\n                SinkWriterStreamResponse {\n                    response: Some(sink_writer_stream_response::Response::Batch(_)),\n                } => continue,\n                msg => {\n                    return Err(RpcError::Internal(anyhow!(\n                        \"should get Sync response but get {:?}\",\n                        msg\n                    )));\n                }\n            }\n        }\n    }\n}\n\nimpl<REQ: From<SinkWriterStreamRequest>> SinkWriterStreamHandle<REQ> {\n    pub async fn write_batch(&mut self, epoch: u64, batch_id: u64, payload: Payload) -> Result<()> {\n        self.request_sender\n            .write_batch(epoch, batch_id, payload)\n            .await\n    }\n\n    pub async fn barrier(&mut self, epoch: u64) -> Result<()> {\n        self.request_sender.barrier(epoch, false).await","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/rpc_client/src/connector_client.rs#L49-L85","documentation":"next_commit_response in ConnectorClient expects the sink writer stream to deliver a Commit response, skipping Batch responses, but received some other SinkWriterStreamResponse variant. The code wraps the mismatched message in an RpcError::Internal with its debug representation.","triggerScenarios":"Calling commit_sink/next_commit_response while the connector sink stream is closed, delivers a Start/Barrier response out of order, or the sink endpoint returns an error/empty variant where a Commit (Sync path) was expected.","commonSituations":"Sink coordinator/connector endpoint version mismatch producing unexpected response variants; stream terminated by connector service crash; misordered use of the bidi stream API (expecting Sync when the writer returned StartSink).","solutions":["Inspect the debug-printed msg variant to identify which response type arrived; handle or skip that variant in the caller.","Verify the connector node version matches the meta/compute node (compatible sink protocol).","Retry the sink operation / recreate the sink writer stream, since a closed or desynchronized stream cannot recover mid-call."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.commit_sink(epoch).await {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"should get Sync response\") => {\n        // recreate sink writer stream and retry once\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Keep connector and compute node versions in lockstep.","Use one stream per sink writer; never interleave Sync and Commit paths.","Log the full RpcError debug output when handling sink commit failures."],"tags":["grpc","streaming","sink","rpc","protocol"],"backgroundTag":"unexpected-response-shape","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"}