rob-9 opened a new issue, #1158:
URL: https://github.com/apache/flink-agents/issues/1158

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   A durable call can save its result to Kafka while its action is still 
unfinished. A checkpoint taken at that point records Kafka's current end 
offset. After a failure, recovery reads from that offset, potentially skipping 
the saved result and repeating the call.
   
   Expected: recovery reuses the saved result. Repeating the call can cause 
duplicate external effects or additional API costs.
   
   Related: checkpoint-aligned cleanup issue (#1034 / #1101). This predates 
cleanup and occurs without it. Cleanup can also delete the skipped records, 
removing a possible fallback through an older checkpoint.
   
   ### How to reproduce
   
   Reproduced using the real action operator and Flink checkpoint/restore test 
harness with Kafka mock clients, one subtask, and cleanup and tombstones 
disabled:
   
   1. Persist a durable call result at offset 1, then keep the action waiting 
on another async operation.
   2. Complete a checkpoint with the action pending and Kafka end offset 2.
   3. Fail before another action-state record containing the result is written.
   4. Restore from the checkpoint. Recovery starts at 2, misses the result at 
1, and repeats the call.
   
   With the same persisted records available to both recovery attempts:
   
   ```text
   Older checkpoint (control): recovered entries=1, total external calls=1
   Checkpoint with pending action: recovered entries=0, total external calls=2
   ```
   
   `KafkaActionStateStore.getRecoveryMarker()` captures the end offsets; 
`rebuildState()` seeks to them. The reproduction's assertion that the call 
count stays at 1 fails with an actual count of 2.
   
   
   ### Version and environment
   
   Reproduced at `63e252d5` with Flink 2.3.0 and OpenJDK 25.0.1 on macOS arm64 
after rebuilding runtime and its dependencies. Uses the packaged JDK 21+ async 
implementation and Kafka mock clients; not yet tested against a live Kafka 
broker. The relevant marker/replay behavior also exists at pre-cleanup commit 
`2050b526` (source inspection).
   
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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]

Reply via email to