summaryrefslogtreecommitdiffstats
path: root/clustercontroller-reindexer
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-12-07 14:14:33 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-12-07 14:14:33 +0100
commit494894f2c1fddae6582f2f1f2c2645447c0abce6 (patch)
tree72af193a672c582e0fc236089e81b1c76de13506 /clustercontroller-reindexer
parentc8b8988ee986fa0a08274aa8ef12b7fbddd90488 (diff)
Avoid transition RUNNING -> RUNNING
Diffstat (limited to 'clustercontroller-reindexer')
-rw-r--r--clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
index ef5e676e36b..e97425381b9 100644
--- a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
+++ b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
@@ -136,12 +136,12 @@ public class Reindexer {
return;
case RUNNING:
log.log(WARNING, "Unexpected state 'RUNNING' of reindexing of " + type);
- case READY: // Intentional fallthrough — must just assume we failed updating state when exiting previously.
- log.log(FINE, () -> "Running reindexing of " + type);
+ break;
+ case READY:
+ status.updateAndGet(Status::running);
}
// Visit buckets until they're all done, or until we are shut down.
- status.updateAndGet(Status::running);
AtomicReference<Instant> progressLastStored = new AtomicReference<>(clock.instant());
VisitorControlHandler control = new VisitorControlHandler() {
@Override
@@ -164,6 +164,7 @@ public class Reindexer {
VisitorParameters parameters = createParameters(type, status.get().progress().orElse(null));
parameters.setControlHandler(control);
Runnable sessionShutdown = visitorSessions.apply(parameters); // Also starts the visitor session.
+ log.log(FINE, () -> "Running reindexing of " + type);
// Wait until done; or until termination is forced, in which we shut down the visitor session immediately.
phaser.arriveAndAwaitAdvance(); // Synchronize with visitor completion.