akka / akka-edge-rs

Akka Edge support in Rust
https://doc.akka.io/docs/akka-edge/current/
Other
9 stars 1 forks source link

Is compaction enabled? #50

Closed patriknw closed 1 year ago

patriknw commented 1 year ago

I tried to test compaction, but there is something I don't understand. I stopped the iot-service-scala, and updated the temperature over 100 times for the same entity. Then I expected that it would only keep the last 10 events. When starting iot-service-scala I still see all TemperatureRead events emitted over grpc and stored in the iot-service-scala db.

By adding println in on_event of the temperature entity I can also see that all events are replayed on startup.

huntc commented 1 year ago

Compaction kicks in when a 64K block is filled.

patriknw commented 1 year ago

ah, ok. What will happen with the Registered event if there are many TemperatureRead after that, for same entity? We shouldn't loose the registration, right?

huntc commented 1 year ago

No, we shouldn’t lose the registration. Compaction happens by record type.

patriknw commented 1 year ago

good, closing

patriknw commented 1 year ago

I just want to mention that I have retested compaction, and see the expected result. Reached the 64k limit while having the scala service stopped. Then started scala service and it received the events, with compaction gaps. It filled the gaps as expected.