Replies: 2 comments
|
Tracking batch completeness across an S3 source and a decoupled S3 sink requires coordinating two points in RisingWave's streaming lifecycle: source split consumption and sink barrier commit epochs. 1. Determining S3 Source Ingestion CompletenessWhen the upstream producer writes a batch to S3, RisingWave's S3 connector reads files via split readers. You can query the internal catalog view to inspect whether all source splits for the current files have been read: SELECT
source_id,
split_id,
split_type
FROM rw_catalog.rw_connector_splits
WHERE source_id = (SELECT id FROM rw_catalog.rw_sources WHERE name = 'your_s3_source_name');When an S3 source finishes reading the files discovered in the prefix, the split reader stops emitting new stream chunks for that batch. 2. Epoch and Barrier Alignment for Decoupled S3 SinksIn decoupled sink mode, the sink executor writes to an intermediate log store, and a sink writer commits files to S3 on barrier checkpoints (typically every 1–2 seconds depending on To verify that all rows up to the current epoch have been committed and flushed to the target S3 bucket: A. Querying System Catalog Views SELECT
s.name AS sink_name,
f.fragment_id,
f.state
FROM rw_catalog.rw_sinks s
JOIN rw_catalog.rw_fragments f ON s.id = f.table_id
WHERE s.name = 'your_s3_sink_name';B. Monitoring Prometheus Metrics via RisingWave Meta/Compute
When: 3. Recommended Pipeline Architecture for Batch BoundariesIf you require strict request/response synchronization between producer batches and consumer reads:
If this answers how to track the commit epoch across the decoupled sink, feel free to mark this as the answer. |
|
There is no "sink committed through epoch X" API for the file sinks, so there is nothing you can compare epochs against directly. ( How the S3 sink commits. File sinks always run decoupled, and they don't finish a file per checkpoint. A file is closed (made visible in S3) when risingwave/src/connector/src/sink/file_sink/opendal_sink.rs Lines 270 to 288 in b32aeef The log store is truncated only after such a commit, so "everything read from the log store, then one rollover period" means everything is in S3: risingwave/src/connector/src/sink/batching_log_sink.rs Lines 90 to 105 in b32aeef How the S3 source tracks files. The fetch executor keeps one row per pending file in its internal state table and deletes the row once the file has been read completely: risingwave/src/stream/src/executor/source/fs_fetch_executor.rs Lines 594 to 600 in b32aeef A practical "batch done" check for your orchestrator:
To keep step 4 short, create the sink with a small If you'd rather not depend on timing at all, the sentinel approach is more robust. The producer writes an end-of-batch marker row, and the orchestrator waits until a row with If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
Our pipeline is:
The upstream producer writes a batch of data, then waits. RisingWave ingests it, updates its materialized views, and sinks the results to S3.
We want to know when RisingWave has finished processing the batch and all resulting files are committed and visible in the S3 sink. This would let us:
Can source and sink progress be tracked through epochs? Is there a way to know the epoch through which the S3 source has been consumed and the epoch through which the decoupled S3 sink has committed?
Thanks in advance for any guidance!
All reactions