Catch JournalReader.next() violations in Mode.COMMITS 90/110690/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2024 09:39:30 +0000 (10:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2024 09:58:45 +0000 (10:58 +0100)
commit86ff19a91c2d4aa71f88135898ebc75fd3caee85
treedb075e0ce392399eb97866bdf5d3e990dd014479
parent10622ac62c756d5cacef0f32cb567a128712bbf1
Catch JournalReader.next() violations in Mode.COMMITS

JournalReader.next() is specified as an Iterator and should be throwing
NSEs. This is not the case when we ask for only commits, as the
corresponding check is done only in hasNext() and thus we would give out
uncommitted entries.

Fix this by adding an override to check for this condition.

JIRA: CONTROLLER-2106
Change-Id: I1f391cc19b9674646786c93656b83519e0f1f47b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
atomix-storage/src/main/java/io/atomix/storage/journal/CommitsSegmentJournalReader.java
atomix-storage/src/main/java/io/atomix/storage/journal/JournalReader.java
atomix-storage/src/main/java/io/atomix/storage/journal/SegmentedJournalReader.java
atomix-storage/src/test/java/io/atomix/storage/journal/AbstractJournalTest.java