Skip to content

Introduce allow_partial_results setting in ES|QL #122890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use MultiProjectPendingException more consistently (#123955)
Use the same exception class in more places where single lookup fails
due to the existence of multiple projects. This allows the exception to
be handled similarly, e.g. ignored in
ClusterApplierService#callClusterStateListener
  • Loading branch information
ywangd authored and dnhatn committed Mar 5, 2025
commit bd9536f7a476b0f7738c38dccf9d68cb2eb637a3
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