-
Notifications
You must be signed in to change notification settings - Fork 100
Improve indexing performance for Cassandra event log #361
Comments
Hi guys, I'd like to add some more detail to this issue. According to my observation the index updating mechanism can indeed fall behind the actual event persistance. This problem gets more evident as soon as you increase the write-batch size with a high write load (as mentioned by @DavidTegtmeyer already). In that case the index updating which effectively consists of a read-write-loop on the event log itself can't catch up with the events written in the meantime. This could be acceptable in some cases but it gets more problematic when the index updating can't catch up at all. As soon as only one read or write of the index updating fails, the whole index updater restarts from the beginning (= the last time the index updater finished completely). I kind of reduced the impact of this problem by propagating the @krasserm I am happy to make a PR out of this 'fix' if it makes any sense :-) Cheers, |
One reason for rather slow index writes is that events are (redundantly) written to the |
Hi @krasserm , I would like to add some more information to this issue. The workaround we introduced with #368 helps only as long as the eventlog doesn't use I have modified the Any thoughts and/or interested in a PR? :-) Cheers, |
Can you please elaborate?
Can you please further explain, not sure I follow ...
Awesome 😃 |
|
Your approach will introduce cross-partition batch writes which are no longer isolated, see #73 and krasserm/akka-persistence-cassandra#48. Isolation is needed for sequential read consistency. |
Not sure if I understand correctly but I do write the aggregate-events in |
How do you recover from write failures? |
... more precisely, how do you recover from partial write failures? |
Write failures are handled just as they are handled right now via |
Ok but we still might end up in a situation where events in the aggregate index are visible before they are visible in the main log. This breaks existing guarantees of Eventuate. This can only be avoided by writing the aggregate events after the main log has been successfully written which significantly reduces throughput. |
OTOH turning off the indexer also decreases load on Cassandra (no read load anymore) and your changes would also significantly decrease complexity of the Cassandra plugin. Please create a PR, looking forward to review it. Thanks! |
When persisting large amounts of events too fast the index performance for the Cassandra event log seems unsufficient. In our case 5000000 events were persisted in batches of 1024. While 5000000 were actually persisted in corresponding cassandra table the event log took way more than 10m to recover its state, causing LoadSnaphot requests to timeout.
The text was updated successfully, but these errors were encountered: