1. You are troubleshooting a Dataflow streaming pipeline that reads from Pub/Sub and writes to BigQuery using the BigQuery Storage Write API with a 1-second commit interval. The pipeline occasionally produces duplicate rows in BigQuery, even though you've configured exactly-once delivery. Upon investigation, you discover that the Dataflow job is using the default trigger and has not been configured to checkpoint its state. What is the root cause of the duplicates?
- A. The BigQuery Storage Write API doesn't support exactly-once semantics; you must use streaming inserts instead.
- B. The 1-second commit interval is too short; increase it to at least 5 seconds to allow Dataflow's state backend to fully synchronize.
- C. Without checkpointing, Dataflow cannot recover the last committed offset to Pub/Sub when the pipeline restarts, causing messages to be reprocessed and rewritten to BigQuery.✓ Correct
- D. The default trigger flushes data before the Streaming Engine has finished deduplicating messages in the pipeline's state.
Explanation
The correct answer is option 3. Duplicates occur because Dataflow lacks state checkpoint configuration. When the pipeline restarts or updates, it cannot resume from the last processed Pub/Sub offset, so it reprocesses messages and writes them again to BigQuery. State checkpoints (stored in Cloud Storage or Datastore) are essential for exactly-once semantics in streaming pipelines. Option 1 is incorrect because the BigQuery Storage Write API does support exactly-once with proper configuration. Option 2 is incorrect because the commit interval isn't the root cause—the issue is missing state checkpoints, not commit timing. Option 4 is incorrect because the default trigger and Streaming Engine don't have a built-in deduplication mechanism; deduplication depends on state checkpoints and idempotent writes.