0

I created a chronicle map with createOrRecoverPersistedTo method. But after restarting the jvm process some entries disappeared. How long will it take to persist the latest key-value after I put the entry? Is there anyway forcing the latest data to be persisted?

Hui Li
  • 51
  • 2

1 Answers1

0

Theoretically, unless some "failure" events happen like JVM process crash or kill, or the server shutdown, you shouldn't wait until entries are persisted, OS memory subsystem takes care of that.

As was explained here in details, using createOrRecoverPersistedTo() after "normal" server restart (moreover, just the JVM process restart) is a harmful antipattern. You should simply use createPersistedTo().

Moreover, in the recent issue entry disappearence was also reported when ChronicleMap recovered without catastrophic events, that could be a bug in the recovery proceduces in Chronicle Map.

If you restart your server, mapped memory may not be fully flushed to files, e. g. in Linux the "safe" timeout when memory should be flushed is defined in "vm.dirty_expire_centisecs" configuration (google it), which should be 30 seconds by default.

leventov
  • 14,760
  • 11
  • 69
  • 98