RS146BIJAY commented on issue #12228:
URL: https://github.com/apache/lucene/issues/12228#issuecomment-1501830603

   @rmuir  Thanks for response. For non tragic exceptions, IndexWriter [even 
now deletes unreferenced 
files](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L2500).
 With the above [commit](https://issues.apache.org/jira/browse/LUCENE-6579) I 
believe it is not deleting un-referenced files for tragedy.
   
   Also we tried to delete unreferenced files incase segment merge fails by 
creating a new index writer instance. Issue here is Segment merge thread inside 
Lucene [removes 
lock](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L2514)
 asynchronously after [tragedy event is 
set](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L5604)
 and [response is 
returned](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L2137)
 to OpenSearch. So there was race condition scenario that when we tried to 
create new index writer instance it maybe possible that previous instance of 
index writer (on which we called force merge) has not removed the lock yet and 
instance creation failed due to new IndexWriter unable to obtain lock.
   
   Let me know if you have any suggestions


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to