risingwavelabs/risingwave · error

BatchPosixFsReader should not be used

Error message

BatchPosixFsReader should not be used

What it means

BatchPosixFsReader::new unconditionally returns an error: this reader type is never meant to be instantiated. The batch POSIX FS source executes via the specialized list/fetch paths (batch_posix_fs_list.rs, batch_posix_fs_fetch.rs), so the generic StreamSourceReader construction path is unsupported. Hitting it means code is routing this source through the wrong engine path.

Source

Thrown at src/connector/src/source/filesystem/opendal_source/batch_posix_fs_source.rs:146

}

/// Reader for batch posix fs source
#[derive(Debug)]
pub struct BatchPosixFsReader {}

#[async_trait]
impl SplitReader for BatchPosixFsReader {
    type Properties = BatchPosixFsProperties;
    type Split = BatchPosixFsSplit;

    async fn new(
        _properties: Self::Properties,
        _splits: Vec<Self::Split>,
        _parser_config: ParserConfig,
        _source_ctx: SourceContextRef,
        _columns: Option<Vec<Column>>,
    ) -> ConnectorResult<Self> {
        return Err(anyhow!("BatchPosixFsReader should not be used").into());
    }

    fn into_stream(self) -> BoxSourceChunkStream {
        unreachable!(
            "BatchPosixFsReader should not hit this branch. refer to `batch_posix_fs_list.rs`, `batch_posix_fs_fetch.rs`"
        );
    }
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Do not construct BatchPosixFsReader; use the batch list/fetch paths referenced in batch_posix_fs_list.rs and batch_posix_fs_fetch.rs.
  2. Check how the source was registered; ensure it's executed as a batch filesystem source, not a streaming source reader.
  3. If this appears in production, file/inspect the caller - it indicates an engine-side routing bug, not a user config problem.
Defensive patterns

Strategy: fallback

Try / catch

// never call new(); use the batch path
let chunks = batch_posix_fs_list::list_chunks(...).await?;

Prevention

When it happens

Trigger: Any call to BatchPosixFsReader::new - typically from the generic batch source framework instantiating a reader for the source instead of using the batch list/fetch implementation.

Common situations: Internal misuse: wiring BatchPosixFsSource into a code path that expects a normal streaming reader; custom tooling or tests constructing readers generically for all source types.

Related errors


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