You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alexandre Rafalovitch (JIRA)" <ji...@apache.org> on 2018/07/05 18:08:00 UTC
[jira] [Closed] (SOLR-22) BitDocSet can get corrupt size info?
[ https://issues.apache.org/jira/browse/SOLR-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexandre Rafalovitch closed SOLR-22.
-------------------------------------
> BitDocSet can get corrupt size info?
> ------------------------------------
>
> Key: SOLR-22
> URL: https://issues.apache.org/jira/browse/SOLR-22
> Project: Solr
> Issue Type: Bug
> Reporter: Hoss Man
> Assignee: Yonik Seeley
> Priority: Major
>
> I don't have a test case demonstrating this yet, but i wnated to file it before i forget.
> Glancing at the code for BitDocSet this morning i think i see a way for the size information (which is cached) to be corrupted.
> If a client tries to be helpful by using addUnique when it knows it can, but the size cache is already invalid, then the size will be recorded incorrectly as 0 (which will now be considered a valid (but incorect) size, which may be further trusted for additional addUnique calls)
> ie...
> DocSet a = ... # get a BitDocSet from somewhere
> a.add(42); # this internal sets size=-1 since we don't know if 42 was alreayd set so we don't trust the cache
> if (! a.exists(666) ) {
> ... # client does it's thing
> a.addUnique(666); # client tries to be helpfull, but at this point size is incrimented to 0, making it a legal value
> }
> int s = a.size(); # bogus 0 is returned.
> the most straight forward fix may be to decouple a boolean indicating wether the cached value is valid from the actual cached value.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org