[ 
https://issues.apache.org/jira/browse/NIFI-6390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499014#comment-17499014
 ] 

ASF subversion and git services commented on NIFI-6390:
-------------------------------------------------------

Commit 483968bac38c946afef685e306884ff066b24769 in nifi's branch 
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=483968b ]

NIFI-6390, NIFI-1825: When we write to a FlowFile and that results in a 0-byte 
FlowFile, remove the content claim all together. This is more efficient to 
process, but far more importantly it prevents a 0-byte FlowFile from holding 
content in the Content Repository. Also fixed issue in which a Provenance Event 
cannot be replayed if there is no ContentClaim.

Signed-off-by: Matthew Burgess <[email protected]>

This closes #5810


> Avoid assigning Content Claim to FlowFile if claim has no data
> --------------------------------------------------------------
>
>                 Key: NIFI-6390
>                 URL: https://issues.apache.org/jira/browse/NIFI-6390
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Critical
>             Fix For: 1.16.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When a Processor writes to a FlowFile, it creates a Content Claim to write 
> to, and this Content Claim is assigned a Resource Claim (a file on disk in 
> the case of the FileSystemRepository). If no data is then written to the 
> FlowFile, the content claim remains. This means that the FlowFile is now 
> holding a reference to a Resource Claim that it doesn't really need.
> Unfortunately, this can potentially keep data in the Content Repository 
> longer than it needs to. Take, for example, the case where a FlowFile is 
> created and 0 bytes are written to it. Then, a Processor writes 10 MB to 
> another FlowFile. If these two FlowFIles hold claims to the same file on 
> disk, then even after the second FlowFile is destroyed, that 10 MB claim must 
> stay around until the 0-byte FlowFile is also destroyed, because it holds the 
> claim.
> Instead, the framework should detect that no data was written to the FlowFile 
> and destroy the content claim & decrement the claimant count on the Resource 
> Claim.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to