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

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

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

NIFI-8210: When Index Reader/Searcher is used, do not allow the Lucene Index to 
be deleted until the reader/searcher is finsihed being used and closed.

Signed-off-by: Matthew Burgess <mattyb...@apache.org>

This closes #4812


> If Provenance Repository ages off a Lucene Index while it's being searched, 
> can lead to index corruption
> --------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-8210
>                 URL: https://issues.apache.org/jira/browse/NIFI-8210
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>             Fix For: 1.13.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When all events have been aged off from a Provenance Lucene Index, the lucene 
> index can be deleted. However, before deleting it, the repository needs to 
> ensure that there are no active readers or writers. Currently, the repository 
> only ensures that there are no active writers. As a result, we can have an 
> active Index Reader/Index Searcher and still delete the index directory. When 
> this happens, we end up with an error similar to:
> {code:java}
> org.apache.lucene.index.IndexNotFoundException: no segments* file found in 
> MMapDirectory@/Users/mpayne/devel/nifi/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/target/6e442c6d-14f3-48bb-9500-534c136942aa
>  lockFactory=org.apache.lucene.store.NativeFSLockFactory@161b062a: files: []
>       at 
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:675)
>       at 
> org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:81)
>       at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
>       at 
> org.apache.nifi.provenance.lucene.StandardIndexManager.borrowIndexSearcher(StandardIndexManager.java:128)
> ...{code}
> We need to ensure that we account for any Readers/Searchers that are active 
> also



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to