{"record":{"id":"0ba1368134e587eb","repo":"risingwavelabs/risingwave","slug":"should-get-commit-response-but-get","errorCode":null,"errorMessage":"should get Commit response but get {:?}","messagePattern":"should get Commit response but get (.+?)","errorType":"exception","errorClass":"RpcError","httpStatus":null,"severity":"error","filePath":"src/rpc_client/src/connector_client.rs","lineNumber":124,"sourceCode":"            SinkCoordinatorStreamResponse {\n                response:\n                    Some(sink_coordinator_stream_response::Response::Commit(\n                        sink_coordinator_stream_response::CommitResponse {\n                            epoch: response_epoch,\n                        },\n                    )),\n            } => {\n                if epoch == response_epoch {\n                    Ok(())\n                } else {\n                    Err(RpcError::Internal(anyhow!(\n                        \"get different response epoch to commit epoch: {} {}\",\n                        epoch,\n                        response_epoch\n                    )))\n                }\n            }\n            msg => Err(RpcError::Internal(anyhow!(\n                \"should get Commit response but get {:?}\",\n                msg\n            ))),\n        }\n    }\n}\n","sourceCodeStart":106,"sourceCodeEnd":131,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/rpc_client/src/connector_client.rs#L106-L131","documentation":"commit in ConnectorClient awaited the next SinkWriterStreamResponse and got something other than a Commit response. The catch-all arm formats the actual message with debug formatting into RpcError::Internal.","triggerScenarios":"Calling commit when the stream returns a Sync/Batch response where Commit was expected, or the stream yields an error/no message variant.","commonSituations":"Calling commit on a sink writer whose protocol stage expects Sync first (SyncSink writers); connector service returning error responses due to sink failure; version-skewed connector endpoint.","solutions":["Read the printed variant: if it is Sync, use the SyncSink path (next_commit_response) instead of commit; if Batch, skip and continue waiting.","Check connector service logs for sink failures that turn expected commits into error responses.","Recreate the sink writer stream and retry the epoch commit."],"exampleFix":"// before\nmsg => Err(RpcError::Internal(anyhow!(\"should get Commit response but get {:?}\", msg))),\n// after: handle Batch and error variants explicitly\nSinkWriterStreamResponse { response: Some(Response::Batch(_)) } => continue,\nSinkWriterStreamResponse { response: Some(Response::Error(e)) } => Err(e.into()),\nmsg => Err(RpcError::Internal(anyhow!(\"should get Commit response but get {:?}\", msg))),","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.commit(epoch).await {\n    Err(e) if e.to_string().contains(\"should get Commit response\") => {\n        // variant mismatch: pick the matching API (Sync vs Commit) or recreate the stream\n    }\n    other => other?,\n}","preventionTips":["Match the commit call to the sink writer's protocol mode (SyncSink vs CommitSink).","Monitor connector service health before issuing epoch commits.","Pin connector service versions compatible with your RisingWave release."],"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"}