You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Andi Vajda (JIRA)" <ji...@apache.org> on 2008/07/18 15:22:31 UTC

[jira] Created: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Add IndexReader.acquire() and release() methods using IndexReader's ref counting
--------------------------------------------------------------------------------

                 Key: LUCENE-1339
                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
             Project: Lucene - Java
          Issue Type: New Feature
            Reporter: Andi Vajda
             Fix For: 2.3.2


From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e

I have a server where a bunch of threads are handling search requests. I
have a another process that updates the index used by the search server and
that asks the searcher server to reopen its index reader after the updates
completed.

When I reopen() the index reader, I also close the old one (if the reopen()
yielded a new instance). This causes problems for the other threads that
are currently in the middle of a search request.

I'd like to propose the addition of two methods, acquire() and release() 
(attached to this bug report), that increment/decrement the ref count that IndexReader 
instances currently maintain for related purposes. That ref count prevents 
the index reader from being actually closed until it reaches zero.

My server's search threads, thus acquiring and releasing the index reader 
can be sure that the index reader they're currently using is good until 
they're done with the current request, ie, until they release() it.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless reassigned LUCENE-1339:
------------------------------------------

    Assignee: Michael McCandless

> Add IndexReader.acquire() and release() methods using IndexReader's ref counting
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-1339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Andi Vajda
>            Assignee: Michael McCandless
>             Fix For: 2.3.2
>
>         Attachments: lucene-1339.patch
>
>
> From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e
> I have a server where a bunch of threads are handling search requests. I
> have a another process that updates the index used by the search server and
> that asks the searcher server to reopen its index reader after the updates
> completed.
> When I reopen() the index reader, I also close the old one (if the reopen()
> yielded a new instance). This causes problems for the other threads that
> are currently in the middle of a search request.
> I'd like to propose the addition of two methods, acquire() and release() 
> (attached to this bug report), that increment/decrement the ref count that IndexReader 
> instances currently maintain for related purposes. That ref count prevents 
> the index reader from being actually closed until it reaches zero.
> My server's search threads, thus acquiring and releasing the index reader 
> can be sure that the index reader they're currently using is good until 
> they're done with the current request, ie, until they release() it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-1339.
----------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.3.2)
                   2.4
    Lucene Fields: [New, Patch Available]  (was: [Patch Available, New])

Thanks Andi!

> Add IndexReader.acquire() and release() methods using IndexReader's ref counting
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-1339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Andi Vajda
>            Assignee: Michael McCandless
>             Fix For: 2.4
>
>         Attachments: lucene-1339.patch
>
>
> From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e
> I have a server where a bunch of threads are handling search requests. I
> have a another process that updates the index used by the search server and
> that asks the searcher server to reopen its index reader after the updates
> completed.
> When I reopen() the index reader, I also close the old one (if the reopen()
> yielded a new instance). This causes problems for the other threads that
> are currently in the middle of a search request.
> I'd like to propose the addition of two methods, acquire() and release() 
> (attached to this bug report), that increment/decrement the ref count that IndexReader 
> instances currently maintain for related purposes. That ref count prevents 
> the index reader from being actually closed until it reaches zero.
> My server's search threads, thus acquiring and releasing the index reader 
> can be sure that the index reader they're currently using is good until 
> they're done with the current request, ie, until they release() it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Posted by "Andi Vajda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615001#action_12615001 ] 

Andi Vajda commented on LUCENE-1339:
------------------------------------

That would work just as well !
Andi..


> Add IndexReader.acquire() and release() methods using IndexReader's ref counting
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-1339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Andi Vajda
>             Fix For: 2.3.2
>
>         Attachments: lucene-1339.patch
>
>
> From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e
> I have a server where a bunch of threads are handling search requests. I
> have a another process that updates the index used by the search server and
> that asks the searcher server to reopen its index reader after the updates
> completed.
> When I reopen() the index reader, I also close the old one (if the reopen()
> yielded a new instance). This causes problems for the other threads that
> are currently in the middle of a search request.
> I'd like to propose the addition of two methods, acquire() and release() 
> (attached to this bug report), that increment/decrement the ref count that IndexReader 
> instances currently maintain for related purposes. That ref count prevents 
> the index reader from being actually closed until it reaches zero.
> My server's search threads, thus acquiring and releasing the index reader 
> can be sure that the index reader they're currently using is good until 
> they're done with the current request, ie, until they release() it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Posted by "Andi Vajda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andi Vajda updated LUCENE-1339:
-------------------------------

    Attachment: lucene-1339.patch

> Add IndexReader.acquire() and release() methods using IndexReader's ref counting
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-1339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Andi Vajda
>             Fix For: 2.3.2
>
>         Attachments: lucene-1339.patch
>
>
> From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e
> I have a server where a bunch of threads are handling search requests. I
> have a another process that updates the index used by the search server and
> that asks the searcher server to reopen its index reader after the updates
> completed.
> When I reopen() the index reader, I also close the old one (if the reopen()
> yielded a new instance). This causes problems for the other threads that
> are currently in the middle of a search request.
> I'd like to propose the addition of two methods, acquire() and release() 
> (attached to this bug report), that increment/decrement the ref count that IndexReader 
> instances currently maintain for related purposes. That ref count prevents 
> the index reader from being actually closed until it reaches zero.
> My server's search threads, thus acquiring and releasing the index reader 
> can be sure that the index reader they're currently using is good until 
> they're done with the current request, ie, until they release() it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (LUCENE-1339) Add IndexReader.acquire() and release() methods using IndexReader's ref counting

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614898#action_12614898 ] 

Michael McCandless commented on LUCENE-1339:
--------------------------------------------

Thanks Andi.  What would you think of just exposing incRef() & decRef() as expert public methods? -- Yonik suggested this on java-dev.

We would just add ensureOpen() to those methods and make them public.

> Add IndexReader.acquire() and release() methods using IndexReader's ref counting
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-1339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1339
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Andi Vajda
>             Fix For: 2.3.2
>
>         Attachments: lucene-1339.patch
>
>
> From: http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200807.mbox/%3cPine.OSX.4.64.0807170752080.1708@c5850-a3-2-62-147-22-102.dial.proxad.net%3e
> I have a server where a bunch of threads are handling search requests. I
> have a another process that updates the index used by the search server and
> that asks the searcher server to reopen its index reader after the updates
> completed.
> When I reopen() the index reader, I also close the old one (if the reopen()
> yielded a new instance). This causes problems for the other threads that
> are currently in the middle of a search request.
> I'd like to propose the addition of two methods, acquire() and release() 
> (attached to this bug report), that increment/decrement the ref count that IndexReader 
> instances currently maintain for related purposes. That ref count prevents 
> the index reader from being actually closed until it reaches zero.
> My server's search threads, thus acquiring and releasing the index reader 
> can be sure that the index reader they're currently using is good until 
> they're done with the current request, ie, until they release() it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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