krasserm / akka-persistence-kafka

A replicated Akka Persistence journal backed by Apache Kafka
Apache License 2.0
201 stars 59 forks source link

Snapshotting views seems causes trouble #10

Closed danielhopkins closed 10 years ago

danielhopkins commented 10 years ago

This might be related to my previous issue #7 but I can't be sure. It's the same setup as before. One producer, one view. The view doesn't seem to be able to snapshot correctly.

Testing in JDBC I can snapshot and recover but the kafka driver seems to give me very weird results. The producer actor seems to be fine but the view will always read from the beginning of the queue.

What could I look for to see what happening?

krasserm commented 10 years ago

That's a regression. View snapshotting has been broken with this commit. Problem was that view snapshots are always orphan snapshots as no corresponding journal topic exists, so they were always ignored and replay always started from scratch.

The current solution is now a good compromise to deal with:

Actually, it should be the responsibility of akka-persistence to deal with these failure scenarios properly. I'll try to create a pull request for akka-persistence when I find some time.

Hope that helps for the moment. Please let me know and I'll cut another patch release.

Thanks, Martin