Akka persistence cassandra and large partitions

(Tomassino Ferrauto) #1

Hi, I’m using akka-persistence-cassandra and I have messages in cassandra logs regarding partitions being too big, for example:

WARN  [CompactionExecutor:17237] 2019-04-04 11:46:17,666 BigTableWriter.java:211 - Writing large partition eventhive_persistence/messages:ep-policy-events-actor-448644859754971136:2 (429.061MiB) to sstable /var/lib/cassandra/data/eventhive_persistence/messages-882aeb401af311e9a5b643a0f134657c/mc-91-big-Data.db

As far as I understand akka-persistence-cassandra messages table has a partition key that is made up of two parts: the persistence id and a sequential number (partition_nr). This number is incremented every target-partition-size events (500000 by default) and this means that to have partitions smaller than 100MB (the suggested maximum cassandra partition size, as far as I know) events should be on average less than 200 bytes. For some actors, persisted events are quite bigger than that and there can be a lot of them: do you suggest decreasing target-partition-size? What cons does a lower value for target-partition-size have? Is there any suggested way of changing this value after a system has been deployed?

P.S.: We are still using a pre 0.80 version of akka-persistence-cassandra (with materialized views for tags), but I suppose this problem is unrelated to the version we are using