Manual reindex lucene index files cluster loading needs to happen after all async reindex jobs finish

Description

On manual reindex, we do a sync delete, following by many async reindexing. If we kick off a cluster loading request right after submitted all async jobs, there is a big chance that cluster peer is seeing a incomplete index dump(especially when there is a lot of async jobs).

This fix enforce a backend MessageBus synchronizer right after we submit all async jobs. Due to Liferay ThreadPool ensures FIFO, once we notice all search writer threads are synced up on the synchronizer, we know for sure all async reindexing are finish, then it is safe to trigger a cluster index files loading.

There is a window time that starting from first search writer thread arrives synchronizer, ending at last search writer thread arrives synchronizer, within this window time search writer ThreadPool's performance is declining linearly down to 0, then immediately backup to 100%.
The window time Tw depends on the ThreadPool size N and potential reindexing complexity for single element C.
Tw=(N-1)*ave(C)

Generally, N is about 5~20, C is at about 1~100 ms level, so Tw is actually really small.
But to ensure robustness, a timeout is added to synchronizer waiting. Default to 1 min, should be more than enough. On timeout(this will be really rare case), the current reindex may not be properly replicated to cluster peer(but the local index files should be correct), an error log will be outputed, administrator should schedule another reindex to fix this.

Activity

Show:

Michael Saechang June 28, 2012 at 3:36 PM

Committed on:
Portal 6.1.x CE GIT ID: c535fea32e103461c1dd5d0c8eaf91ee45c9d260.
Portal 6.2.x GIT ID: 626ebb14beeb8e5a647d3c4820b2d11973b87c22.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Branch Version/s

6.1.x
6.0.x

Backported to Branch

Committed

Priority

Zendesk Support

Created May 24, 2012 at 5:55 PM
Updated June 24, 2023 at 4:00 PM
Resolved May 25, 2012 at 11:05 AM