Github user tdas commented on the pull request:

    https://github.com/apache/spark/pull/9421#issuecomment-153673079
  
    I there is a general problem that bugs me. I am not sure whether the KCL 
guarantees that the IRecordProcessor.shutdown() will be called when the worker 
is shutdown. From the source code of the KCL it seems that the shutdown will 
only be called when the corresponding processor loses the shard lease or the 
shard is terminated due to resharding. So we cannot guarantee the shutdown of 
the KinesisCheckpointState will be called when the receiver stops. 
    
    For that to happen, the design needs to change. There should a central 
single `KinesisCheckpointer` in the `KinesisReceiver` that is responsible for 
checkpointing all the shards.All the `KinesisRecordProcessor`s register and 
deregister their `IRecordProcessorCheckpointer` to the `KinesisCheckpointer` 
for each `shardId`. For each shardId, the `KinesisCheckpointer` will 
periodically try to call `KinesisRecordProcessor.checkpoint()` with the shardId 
in `shardIdTolatestStoreSeqNumber`. As an optimization, it will keep track of 
the last saved sequence number for each shardId and call checkpoint only if it 
has changed. Finally, when the receiver is stopped, the 
`KinesisCheckpointer.shutdown` will do a final round of checkpointing.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to