You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Nhat Nguyen <nh...@elastic.co.INVALID> on 2021/07/26 02:08:14 UTC

Re: Question for SoftDeletesRetentionMergePolicy#numDeletesToMerge

Hello,

Since the liveDocs of a CodecReader already excludes soft-deleted
documents, the condition "liveDocs.get(iterator.docId))" is always false. I
think we should use the "hardLiveDocs" of a segment reader here instead. I
will open an issue and PR for this.

Cheers,
Nhat

On Thu, Jul 22, 2021 at 9:14 AM zhangchao-so <80...@qq.com.invalid>
wrote:

> Hi,all
>
> I have a question for SoftDeletesRetentionMergePolicy#numDeletesToMerge
> funcation, the  highlight line:
>
> liveDocs.get(iterator.docID()
>
> It always seems to return false, I added a log when it returned true in
> elasticsearch 7.x(softdelete enable), then It ran for several hours with
> doc update operation, it never return true
>
> I understand a doc which has a SOFT_DELETE docvalue,it always has a zero
> value in liveDocs, so i understand that there is no need to judge in
> LiveDoc. I don't know if it is correct?
>
> Looking forward to your reply. Thank a lot!
>
>
>
> background:
>
>