From dc94ef568a1da1617ddb3cb18b82d3913219a6b4 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Mon, 8 Mar 2021 15:02:42 -0500 Subject: [PATCH] NIFI-8299: Because we now iterate over stored events in an unordered map, we need to update maxEventId to Math.max( , ) instead of just assigning the next value. Signed-off-by: Pierre Villard This closes #4873. --- .../apache/nifi/provenance/store/WriteAheadStorePartition.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/store/WriteAheadStorePartition.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/store/WriteAheadStorePartition.java index c32de77336..e702b24f66 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/store/WriteAheadStorePartition.java +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/store/WriteAheadStorePartition.java @@ -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++; }