apache / apache/lucene

Add a timeout for forceMergeDeletes in IndexWriter

Open
#14,431 11 comments 0 reactions 0 assignees View on GitHub
type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

### Description

Using IndexWriter's `forceMergeDeletes` to eliminate merge debt is a very useful feature -- especially during initial indexing. However, larger indexes can require 20+ minutes to finish a `forceMergeDeletes` call. It would be a useful feature if we add an API for specifying a timeout for the existing `doWait` argument. Instead of blocking until `forceMergeDeletes` finishes, we should block until either `forceMergeDeletes` finishes or the timeout is reached, whichever comes first.

Contributor guide

Open the contributing guide

Research direction

Start at IndexWriter's forceMergeDeletes API and trace how its existing doWait argument waits for completion. Determine where a timeout can be specified and how the call should behave when the timeout is reached. Done means the API returns after completion or timeout without blocking indefinitely, with behavior covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.