On 10/12/2016 12:18 AM, Reinhard Budenstecher wrote:
> Is my assumption correct that an OPTIMIZE of index would block all
> inserts? So that all processes have to pause when I will start an
> hour-running OPTIMIZE? If so, this would also be no option for the moment.

That is not correct as of version 4.0.

The only kind of update I've run into that cannot proceed at the same
time as an optimize is a deleteByQuery operation.  If you do that, then
it will block until the optimize is done, and I think it will also block
any update you do after it.

Inserts, updates, deletes by ID (uniqueKey field), and commits will all
work perfectly while an optimize is underway.

There is a workaround in USER code for the deleteByQuery problem. 
Change all deleteByQuery updates in your indexing program(s) into a two
step process where you do a query with fl set to the uniqueKey field, to
gather a complete list of IDs, then do a series of delete by ID requests
with those IDs.  If the query matches a large number of docs, using
cursorMark to page through them might be a good idea.

I have no idea whether the deleteByQuery problem should be considered a
bug or not, because I do not know enough about what's actually happening
when it occurs.

Thanks,
Shawn

Reply via email to