[
https://issues.apache.org/jira/browse/NIFI-16344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115757#comment-18115757
]
ASF subversion and git services commented on NIFI-16344:
--------------------------------------------------------
Commit 28249a35ad108ac56c30b977ce2c077f6544255f in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=28249a35ad1 ]
NIFI-16344 Complete rewrittenSwapLocations rename in selective drop
Update remaining references in dropFlowFiles after renaming the local variable
per review feedback.
Co-authored-by: Cursor <[email protected]>
> Selective FlowFile drop can reorder swapped queue contents
> ----------------------------------------------------------
>
> Key: NIFI-16344
> URL: https://issues.apache.org/jira/browse/NIFI-16344
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {{SwappablePriorityQueue.dropFlowFiles(Predicate)}} can change swap-file
> ordering when only some swap files contain matching FlowFiles.
> During selective drop, a partially retained swap file is rewritten. Its
> replacement location is appended to swapLocations. If the rewritten file
> originally preceded an unchanged swap file, the unchanged file is
> subsequently swapped in first, violating FIFO ordering.
> Reproduction:
> 1. Create a queue with a swap threshold of 10 and default FIFO ordering.
> 2. Enqueue records numbered 0–29:
> - Active queue: 0–9
> - First swap file: 10–19
> - Second swap file: 20–29
> 3. Selectively drop record 10.
> 4. Poll the queue.
> Expected: Records are returned as 0–9, then 11–29.
> Actual: After 0–9, record 20 is returned because the rewritten first swap
> file was moved after the second swap file.
> The replacement swap location should retain the original location’s position.
> Add a regression test using multiple swap files that verifies the complete
> polling order after selective drop.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)