Allow segmented journal to flush periodically 80/110880/5
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 19 Mar 2024 20:42:14 +0000 (21:42 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 26 Mar 2024 11:46:37 +0000 (12:46 +0100)
commit75304124258a0277426061a4cfb5f79b7967faa4
tree9bc5f0dbf30f71cc4b3b8dc0ebf7e00484ecc2f7
parentb8ffb53727577325903dc487e2ac65bef668e058
Allow segmented journal to flush periodically

Flushes to disk end up dominating our use of disk resources, as we issue
a flush after each write. This is not entirely efficient, as we may have
multiple outstanding writes in the actor queue -- and we ignore the
batching opportunity.

This patch makes it possible to configure an upper bound of the number
of outstanding bytes written which can remainin unflushed.

We flush whenever we reach this watermark or when we flush all messages
that have been submitted at the time the flush batch has been started.

JIRA: CONTROLLER-2108
Change-Id: I6f18de7871c89b5feffecc71580e1f440024f2a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/DataJournal.java
opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/DataJournalV0.java
opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournal.java
opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedJournalActor.java
opendaylight/md-sal/sal-akka-segmented-journal/src/test/java/org/opendaylight/controller/akka/segjournal/PerformanceTest.java
opendaylight/md-sal/sal-akka-segmented-journal/src/test/java/org/opendaylight/controller/akka/segjournal/SegmentedFileJournalTest.java
opendaylight/md-sal/sal-akka-segmented-journal/src/test/resources/SegmentedFileJournalTest.conf
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/factory-akka.conf
opendaylight/md-sal/sal-distributed-datastore/src/test/resources/segmented.conf