You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by pv...@apache.org on 2021/03/09 07:46:36 UTC

[nifi] branch support/nifi-1.13 updated: 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.

This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/support/nifi-1.13 by this push:
     new 2a00999  NIFI-8299: 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.
2a00999 is described below

commit 2a009991cfabdf4c7f2e0eafb304e0d83e7785dc
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Mon Mar 8 15:02:42 2021 -0500

    NIFI-8299: 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.
    
    Signed-off-by: Pierre Villard <pi...@gmail.com>
    
    This closes #4873.
---
 .../java/org/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 c32de77..e702b24 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++;
             }