You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by markap14 <gi...@git.apache.org> on 2018/08/16 18:09:58 UTC

[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

GitHub user markap14 opened a pull request:

    https://github.com/apache/nifi/pull/2954

    NIFI-5514: Fixed bugs in MergeRecord around minimum thresholds not be…

    …ing honored and validation not being performed to ensure that minimum threshold is smaller than max threshold (would previously allow min record = 100, max records = 2 as a valid configuration)
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [ ] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [ ] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/markap14/nifi NIFI-5514

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2954.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2954
    
----
commit 8f13109e9064c6721f3bcb3dc472ec94e481835b
Author: Mark Payne <ma...@...>
Date:   2018-08-16T18:08:43Z

    NIFI-5514: Fixed bugs in MergeRecord around minimum thresholds not being honored and validation not being performed to ensure that minimum threshold is smaller than max threshold (would previously allow min record = 100, max records = 2 as a valid configuration)

----


---

[GitHub] nifi issue #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum thresh...

Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/2954
  
    +1, merging to master, thanks @markap14 


---

[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/2954


---

[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2954#discussion_r219683471
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeRecord.java ---
    @@ -304,13 +336,25 @@ public void onTrigger(final ProcessContext context, final ProcessSessionFactory
                 session.commit();
             }
     
    +        // If there is no more data queued up, complete any bin that meets our minimum threshold
    +        int completedBins = 0;
    +        final QueueSize queueSize = session.getQueueSize();
    --- End diff --
    
    @markap14 
    Test for MinRecords is successful, but actual flow doesn't work as expected and still doesn't respect Min Records setting.
    There is my set up:
    ![image](https://user-images.githubusercontent.com/19496093/45922181-efa6f880-be92-11e8-92b1-4f6daf756463.png)
    
    ![image](https://user-images.githubusercontent.com/19496093/45922183-02b9c880-be93-11e8-9565-fe8ef8908245.png)
    
    The problem is in different behavior of MockProcessSession and StandardProcessSession.
    MockProcessSession.getQueueSize() will return 0, after session.get(...)
    StandardProcessSession.getQueueSize() will return same number as before session.get(...), regardless flow files have been polled or not.
    As a result, this condition will block from actually emitting FF when min requirements are reached.
    
    I would recommend to change this condition to:
    if (flowFiles.size() != 0) {...}
    
    In parallel, we probably need to open a JIRA for inconsistency between MockProcessSession and StandardProcessSession.



---

[GitHub] nifi pull request #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum...

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2954#discussion_r219837666
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeRecord.java ---
    @@ -304,13 +336,25 @@ public void onTrigger(final ProcessContext context, final ProcessSessionFactory
                 session.commit();
             }
     
    +        // If there is no more data queued up, complete any bin that meets our minimum threshold
    +        int completedBins = 0;
    +        final QueueSize queueSize = session.getQueueSize();
    --- End diff --
    
    @bdesert that's a great catch! I have pushed a new commit that updates the code like you suggested, to just check the size of the flowFiles list. I also created NIFI-5626 to address the inconsistency between MockProcessSession and StandardProcessSession.


---

[GitHub] nifi issue #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum thresh...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on the issue:

    https://github.com/apache/nifi/pull/2954
  
    Reviewing...


---

[GitHub] nifi issue #2954: NIFI-5514: Fixed bugs in MergeRecord around minimum thresh...

Posted by bdesert <gi...@git.apache.org>.
Github user bdesert commented on the issue:

    https://github.com/apache/nifi/pull/2954
  
    +1 LGTM.
    Test case updated.
    Live test on local env (up to date) succeeded. Works as expected.
    Travis is failing for JP only (US and FR are OK). Can be merged.


---