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

Michael McCandless commented on LUCENE-7344:
--------------------------------------------

This is indeed a bug, but I can't yet see how we can fix it.

The hairy code that resolves deletes and DV updates 
({{BufferedUpdateStream.java}} has a hard assumption that segments are 
write-once as far as queries resolving to docIDs is concerned, and updatable 
DVs breaks that assumption.

To properly fix this, at a high level, the code would need to do something 
along the lines of merge-sorting all DV updates and delete-by-query in order of 
their arrival to {{IndexWriter}} ({{docIDUpto}} proxies this), and then apply 
these in order, but after any DV update and just before a delete-by-query, we'd 
need to open a new {{LeafReader}} on that segment so it would reflect the DV 
updates (maybe just calling {{ReadersAndUpdates.writeFieldUpdates}}, and then 
pulling the reopened reader, would suffice for this).

But even if we can fix that, the code would then have an inherent terrible 
adversarial worst case of alternating DV update / DBQ.

Rather than fix this bug, I would lean towards requiring/documenting that DBQ 
must not use queries that rely on updated doc values.

> Deletion by query of uncommitted docs not working with DV updates
> -----------------------------------------------------------------
>
>                 Key: LUCENE-7344
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7344
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ishan Chattopadhyaya
>         Attachments: LUCENE-7344.patch
>
>
> When DVs are updated, delete by query doesn't work with the updated DV value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to