alephcloud / hs-aws-kinesis-client

A producer/consumer client library for Kinesis
http://hackage.haskell.org/package/aws-kinesis-client
Apache License 2.0
5 stars 3 forks source link

Fix for #29 #30

Closed jonsterling closed 9 years ago

jonsterling commented 9 years ago

Quoting from #29:

What is happening is the following: if there was a saved state, but no records are found at that point on the shard, the state got wiped out and replaced with an empty one on the next save.

This issue could happen if you restore a saved stream state, but there are not yet any more records on the shard after the bookmark. In this case, the next saved state would lose the bookmark for that shard.

The solution is to mark a shard's last sequence number pre-emptively, in case we are not able to retrieve further records (which would supersede the restored state) at this time.