risingwavelabs/risingwave · critical · anyhow::Error

should have meta client

Error message

should have meta client

What it means

The sink coordinator requires a meta client to create a SinkCoordinateClient for communicating with the meta service during distributed sink coordination. `writer_param.meta_client` is an Option; batch/simple-actor contexts may not supply one, so the constructor explicitly rejects building a coordinating sink writer without it.

Source

Thrown at src/connector/src/sink/coordinate.rs:56

    param: SinkParam,
    vnode_bitmap: Bitmap,
    commit_checkpoint_interval: NonZeroU64,
    sink_writer_metrics: SinkWriterMetrics,
}

impl<W: SinkWriter<CommitMetadata = Option<SinkMetadata>>> CoordinatedLogSinker<W> {
    pub async fn new(
        writer_param: &SinkWriterParam,
        param: SinkParam,
        writer: W,
        commit_checkpoint_interval: NonZeroU64,
    ) -> Result<Self> {
        Ok(Self {
            writer,
            sink_coordinate_client: writer_param
                .meta_client
                .as_ref()
                .ok_or_else(|| anyhow!("should have meta client"))?
                .clone()
                .sink_coordinate_client()
                .await,
            param,
            // Singleton actors do not carry a vnode bitmap. For sink coordination, the only
            // writer owns the singleton fragment's sole vnode.
            vnode_bitmap: writer_param
                .vnode_bitmap
                .clone()
                .unwrap_or_else(|| Bitmap::singleton().clone()),
            commit_checkpoint_interval,
            sink_writer_metrics: SinkWriterMetrics::new(writer_param),
        })
    }
}

#[async_trait]
impl<W: SinkWriter<CommitMetadata = Option<SinkMetadata>>> LogSinker for CoordinatedLogSinker<W> {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Ensure the actor/stream environment attaches a meta client to WriterParam before creating the sink writer.
  2. If the sink does not need coordination, use a sink path/writer type that does not require a coordinator.
  3. In tests, provide a mock/in-memory meta client instead of None.

Example fix

// before
let writer_param = WriterParam { meta_client: None, .. };
// after
let writer_param = WriterParam { meta_client: Some(meta_client), .. };
Defensive patterns

Strategy: validation

Validate before calling

if writer_param.meta_client.is_none() {
    return Err(anyhow!("sink coordination requires a meta client"));
}

Prevention

When it happens

Trigger: Constructing the sink coordinator (SinkCoordinator new / from writer_param) when writer_param.meta_client is None, i.e. the writer was created in a context that does not attach a meta client (e.g. non-distributed sink paths or tests).

Common situations: Running a sink in an environment/test harness where the actor's WriterParam was built without a meta client; misconfigured cluster where the meta node is not wired to the compute node creating the sink writer.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/c5828d364d422277. Report an issue: GitHub.