Because we now iterate over stored events in an unordered map, we need to update maxEventId to Math.max( <current value>, <next value> ) instead of just assigning the next value.
This closes
@@ -329,7 +329,7 @@ public class WriteAheadStorePartition implements EventStorePartition {
final StorageSummary summaryWithIndex = new StorageSummary(writerSummary.getEventId(), writerSummary.getStorageLocation(), this.partitionName,
writerSummary.getBlockIndex(), writerSummary.getSerializedLength(), writerSummary.getBytesWritten());
locationMap.put(eventRecord, summaryWithIndex);
- maxId = summaryWithIndex.getEventId();
+ maxId = Math.max(maxId, summaryWithIndex.getEventId());
numEvents++;
}
