Fix online reindexer not starting

Since Ie88b7effd, the online reindexer was no longer starting
automatically.

Before that change, the OnlineReindexer was only created if index
version was not the latest. The intention of that change was to always
create the OnlineReindexer for the latest index version to allow
forcing a reindex using the ssh command.

The problem is that the way it was implemented, the OnlineReindexer was
created but never started.

Fix this by always creating the OnlineReindexer and starting it if index
version is not latest.

Change-Id: I34c99c041d4665a3dbe76aaeb70e5e759f827ceb
This commit is contained in:
Hugo Arès
2016-08-11 11:23:53 -04:00
parent c62eee3b8c
commit 3df01eb1c6

View File

@@ -164,10 +164,10 @@ public class LuceneVersionManager implements LifecycleListener {
int latest = write.get(0).version;
OnlineReindexer<K, V, I> reindexer = new OnlineReindexer<>(def, latest);
reindexers.put(def.getName(), reindexer);
if (onlineUpgrade && latest != search.version) {
synchronized (this) {
if (!reindexers.containsKey(def.getName())) {
synchronized (this) {
if (!reindexers.containsKey(def.getName())) {
reindexers.put(def.getName(), reindexer);
if (onlineUpgrade && latest != search.version) {
reindexer.start();
}
}