Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private Metadata updateSingleProject(Function<ProjectMetadata, ProjectMetadata>
reservedStateMetadata
);
} else {
throw new UnsupportedOperationException("There are multiple projects " + projectMetadata.keySet());
throw new MultiProjectPendingException("There are multiple projects " + projectMetadata.keySet());
}
}

Expand Down Expand Up @@ -1310,7 +1310,7 @@ private ProjectMetadata.Builder getSingleProject() {
if (projectMetadata.isEmpty()) {
createDefaultProject();
} else if (projectMetadata.size() != 1) {
throw new UnsupportedOperationException("There are multiple projects " + projectMetadata.keySet());
throw new MultiProjectPendingException("There are multiple projects " + projectMetadata.keySet());
}
return projectMetadata.values().iterator().next();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.cluster.DiffableUtils;
import org.elasticsearch.cluster.DiffableUtils.KeySerializer;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.cluster.metadata.Metadata.MultiProjectPendingException;
import org.elasticsearch.cluster.metadata.ProjectId;
import org.elasticsearch.cluster.metadata.ProjectMetadata;
import org.elasticsearch.common.collect.ImmutableOpenMap;
Expand Down Expand Up @@ -134,7 +135,7 @@ public RoutingTable getRoutingTable() {
return switch (routingTables.size()) {
case 0 -> RoutingTable.EMPTY_ROUTING_TABLE;
case 1 -> routingTables.values().iterator().next();
default -> throw new IllegalStateException("There are multiple project routing tables [" + routingTables.keySet() + "]");
default -> throw new MultiProjectPendingException("There are multiple project routing tables [" + routingTables.keySet() + "]");
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ private static void callClusterStateListener(
listener.clusterChanged(clusterChangedEvent);
}
} catch (Metadata.MultiProjectPendingException e) {
// don't warn, this fills the logs
// don't warn, this fills the logs and also slow down applier thread in CI which could cause unrelated failures
logger.trace("ClusterStateListener not multi-project compatible", e);
} catch (Exception ex) {
logger.warn("failed to notify ClusterStateListener", ex);
Expand Down