abhishekrb19 commented on code in PR #19477:
URL: https://github.com/apache/druid/pull/19477#discussion_r3319561856


##########
docs/api-reference/supervisor-api.md:
##########
@@ -3539,6 +3539,109 @@ when the supervisor's tasks restart, they resume 
reading from `{"0": 100, "1": 1
   ```
 </details>
 
+### Reset offsets and start a backfill supervisor
+
+This endpoint is supported for Apache Kafka and RabbitMQ Stream supervisors. 
Amazon Kinesis is not supported yet.
+
+Resets the supervisor to the latest available stream offsets and starts a new 
bounded backfill supervisor to ingest the data in the skipped range.
+
+This endpoint is useful when a supervisor has fallen behind and you want to 
catch it up to the latest offsets without losing the skipped data. The main 
supervisor resumes ingesting from the latest offsets, while the backfill 
supervisor processes the range from the previously checkpointed offsets up to 
the latest offsets at the time of the reset.
+
+**Duplicate ingestion notice:** The main supervisor is not quiesced before the 
reset. This means duplicate data can occur in two ways:
+- **Backfill overlap:** Any tasks that were in-flight at the time of the reset 
may publish segments covering part of the backfill range before being shut down.
+- **Reset race:** If a task checkpoint is written to the metadata store 
between when this endpoint captures the current offsets and when it applies the 
reset, that checkpoint can be overwritten, causing the main supervisor to 
re-ingest already-processed data.
+
+Both windows are narrow in practice, but cannot be fully eliminated without 
manually suspending the main supervisor before calling this endpoint and 
waiting for all pending tasks to complete.

Review Comment:
   This seems reasonable to me. If an exactly-once guarantee is truly required, 
operators can still perform these steps manually, right?
   
   I’m not sure what it would take to fully bake suspend + handoff semantics 
into this API, but that’s something we can evolve in the future if needed. In 
the interim, as the docs call out, operators can still:
   
   suspend supervisor → wait for tasks to checkpoint and complete → kick off 
backfill supervisor with checkpoints & reset main supervisor
   
   (Fwiw, `resetOffsetsAutomatically` and hard resets have similar caveats 
around exactly-once semantics)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to