[
https://issues.apache.org/jira/browse/LUCENE-8381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532387#comment-16532387
]
Simon Willnauer commented on LUCENE-8381:
-----------------------------------------
I think we should go with the inline patch.
For this:
{code:java}
public boolean get(int index) {
return hardLiveDocs.get(index) && (wrappedLiveDocs == null ||
wrappedLiveDocs.get(index));
}
{code}
I think we can check if the _wrappedLiveDocs_ is null before and in this case
we just pass in the hardLiveDocs instead of wrapping it?
here I think we should just use _hardLiveDocs.lenght()_
{code:java}
+ @Override
+ public int length() {
+ return reader.maxDoc();
+ }
{code}
LGTM otherwise. I think we should port this fix to branch_7_4 to get this in
the next bugfix release.
> PendingSoftDeletes#onNewReader should adjust soft-delete count
> --------------------------------------------------------------
>
> Key: LUCENE-8381
> URL: https://issues.apache.org/jira/browse/LUCENE-8381
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 7.4
> Reporter: Nhat Nguyen
> Assignee: Simon Willnauer
> Priority: Major
> Fix For: master (8.0), 7.5, 7.4.1
>
> Attachments: LUCENE-8381-inline.patch, LUCENE-8381-merge.patch,
> LUCENE-8381.patch, LUCENE-8381.patch, merge-soft-hard-deletes.patch
>
>
> The current PendingSoftDeletes#onNewReader does not handle these two edge
> cases correctly.
> # If the soft-deletes DV was applied to PendingSoftDeletes already,
> newDelCount should be less than the soft delete count recorded in
> SegmentInfo. testSoftDeleteWithTryUpdateDocValue trips the newSoftDelCount
> assertion.
> # If the soft-deleted docs were hard-deleted, we should reduce the
> softDelCount in the segmentInfo on a new reader.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]