Mailing List Archive

Question for SoftDeletesRetentionMergePolicy#numDeletesToMerge
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?
Re: Question for SoftDeletesRetentionMergePolicy#numDeletesToMerge [ In reply to ]
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 <80152403@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?
>
>