private static Reindexing.State toState(String value) {
            switch (value) {
                case "ready": return Reindexing.State.READY;
                case "running": return Reindexing.State.RUNNING;
                case "successful": return Reindexing.State.SUCCESSFUL;
                case "failed": return Reindexing.State.FAILED;
                default: throw new IllegalArgumentException("Unknown state '" + value + "'");
            }
        }
This lock must be held to manipulate reindexing state, or by whoever has a running visitor.
clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/ReindexingCurator.java