[ https://issues.apache.org/jira/browse/NIFI-6339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16861384#comment-16861384 ]
Mark Payne commented on NIFI-6339: ---------------------------------- Thanks [~s9514171]. The code snippet above is comparing the new value to {{propertyModComparisonValue}}, which in this case, is coming from the result of calling {{this.properties.get(descriptor);}} - so it does appear to be comparing against the correct value. What is wrong, I believe, is that we are calling methods that are annotated with {{@OnConfigurationRestored}} every time a component is created (for example, on restart) even though the configuration has not been restored. So, as a result, when we get to the following code snippet in ListHDFS: {code:java} @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (isConfigurationRestored() && (descriptor.equals(DIRECTORY) || descriptor.equals(FILE_FILTER))) { this.resetState = true; } }{code} The call to {{isConfigurationRestored()}} is returning {{true}} when it should return {{false}}. I have submitted a Pull Request that addresses this, so that when a Processor/Controller Service/Reporting Task is created, it only calls the {{@OnConfigurationRestored}} methods if the Flow Controller has been fully initialized (i.e., if the flow configuration has indeed been restored). > ListHDFS processor will list files without using previous state when cluster > startup > ------------------------------------------------------------------------------------ > > Key: NIFI-6339 > URL: https://issues.apache.org/jira/browse/NIFI-6339 > Project: Apache NiFi > Issue Type: Bug > Components: Core Framework > Affects Versions: 1.9.0, 1.9.1, 1.9.2 > Reporter: Hsin-Ying Lee > Priority: Major > Attachments: NIFI-6339.v0.patch > > Time Spent: 10m > Remaining Estimate: 0h > > When the node startup, NiFi will create processor and load the property & > state. > But ListHDFS will ignore the previous listed-state stored on Zookeeper, and > relist all file again. > > And I found when we call the function setProperty, we only check the value > between default and newValue. If oldValue is same with newValue, it'll also > trigger function onPropertyModified. > It casue ListHDFS loaclVariable: resetState to be true. When ListHDFS be > triggered, it'll clear the state empty, and relist all the files in the > directory. > > {code:java} > // AbstractComponentNode.java > if (!value.equals(propertyModComparisonValue)) { > try { > onPropertyModified(descriptor, oldValue, value); > } catch (final Exception e) { > // nothing really to do here... > } > } > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)