[jira] [Commented] (LUCENE-5434) Let NRT Readers prevent their files from being removed.

2014-02-04 Thread Michael McCandless (JIRA)

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

Michael McCandless commented on LUCENE-5434:


+1 for the change: the less we rely on OS/filesystem specific semantics, like 
"delete on last close", the better.

On the patch, maybe move the incRef into IW.getReader?  And, maybe move the 
decRef into a new package private IW method that's called from SDR.onClose?  
I'd just rather have the "sync'd on writer" code inside IW's sources 

> Let NRT Readers prevent their files from being removed.
> ---
>
> Key: LUCENE-5434
> URL: https://issues.apache.org/jira/browse/LUCENE-5434
> Project: Lucene - Core
>  Issue Type: Improvement
>Reporter: Mark Miller
> Fix For: 5.0, 4.7
>
>
> See SOLR-5693 and our HDFS support - for something like HDFS to work with 
> NRT, we need an ability for near realtime readers to hold references to their 
> files to prevent deletes.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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



[jira] [Commented] (LUCENE-5434) Let NRT Readers prevent their files from being removed.

2014-02-04 Thread Mark Miller (JIRA)

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

Mark Miller commented on LUCENE-5434:
-

My first thought on this was that since it was not needed by windows or unix, 
it could be optional. My second thought was that it doesn't really change 
anything for windows or unix either - the deletes will happen at roughly 
equivalent times. Perhaps this is just a better way to handle deletion file 
references in general.

> Let NRT Readers prevent their files from being removed.
> ---
>
> Key: LUCENE-5434
> URL: https://issues.apache.org/jira/browse/LUCENE-5434
> Project: Lucene - Core
>  Issue Type: Improvement
>Reporter: Mark Miller
> Fix For: 5.0, 4.7
>
>
> See SOLR-5693 and our HDFS support - for something like HDFS to work with 
> NRT, we need an ability for near realtime readers to hold references to their 
> files to prevent deletes.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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



[jira] [Commented] (LUCENE-5434) Let NRT Readers prevent their files from being removed.

2014-02-04 Thread Mark Miller (JIRA)

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

Mark Miller commented on LUCENE-5434:
-

for example:

{noformat}
diff --git 
a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java 
b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
index 
18d84634bbc2fb79aa476a6eb1e2b20eb303bba5..75cea119d6066d4861c1551a2607f64d47c63f67
 100644
--- a/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/StandardDirectoryReader.java
@@ -118,6 +118,11 @@ final class StandardDirectoryReader extends 
DirectoryReader {
 }
   }
 }
+
+synchronized (writer) {
+  writer.deleter.incRef(segmentInfos, false);
+}
+
 return new StandardDirectoryReader(dir, readers.toArray(new 
SegmentReader[readers.size()]),
   writer, segmentInfos, writer.getConfig().getReaderTermsIndexDivisor(), 
applyAllDeletes);
   }
@@ -354,6 +359,10 @@ final class StandardDirectoryReader extends 
DirectoryReader {
 }
 
 if (writer != null) {
+  synchronized (writer) {
+writer.deleter.decRef(segmentInfos);
+  }
+
   // Since we just closed, writer may now be able to
   // delete unused files:
   writer.deletePendingFiles();
-- 

{noformat}

> Let NRT Readers prevent their files from being removed.
> ---
>
> Key: LUCENE-5434
> URL: https://issues.apache.org/jira/browse/LUCENE-5434
> Project: Lucene - Core
>  Issue Type: Improvement
>Reporter: Mark Miller
>
> See SOLR-5693 and our HDFS support - for something like HDFS to work with 
> NRT, we need an ability for near realtime readers to hold references to their 
> files to prevent deletes.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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