-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Apply fast date histogram optimization at the segment level #12073
Apply fast date histogram optimization at the segment level #12073
Conversation
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Compatibility status:Checks if related components are compatible with change e1dbcea Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/performance-analyzer.git] |
❌ Gradle check result for e963981: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 85ef307: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 0a78297: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❕ Gradle check result for e1dbcea: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
|
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-12073-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9a0a69fb530732e49834a2f2ddc3011cca82b26c
# Push it to GitHub
git push --set-upstream origin backport/backport-12073-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
--------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> (cherry picked from commit 9a0a69f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Apparently related to this change:
Reference https://build.ci.opensearch.org/job/gradle-check/33522/ |
…level (#12279) * Apply fast date histogram optimization at the segment level (#12073) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> (cherry picked from commit 9a0a69f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix: reset the filter built at segment level for date histogram optimization (#12267) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…level (#12279) * Apply fast date histogram optimization at the segment level (#12073) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> (cherry picked from commit 9a0a69f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix: reset the filter built at segment level for date histogram optimization (#12267) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 25c2fde) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…level (#12279) (#12284) * Apply fast date histogram optimization at the segment level (#12073) --------- (cherry picked from commit 9a0a69f) * Fix: reset the filter built at segment level for date histogram optimization (#12267) --------- --------- (cherry picked from commit 25c2fde) Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ch-project#12073) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
…ch-project#12073) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
…ch-project#12073) --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
This PR mainly aims to handle the segment level functionally match all scenario. And is a follow up of #11083 and #11505
Context: match all is one of the pre-condition before doing this filter rewrite and weight count optimization. Previously, we check this by seeing if the query is of type MatchAllQuery, FieldExists or PointRangeQuery on the same field on the shard level. All 3 scenarios mean it's safe to rewrite the date histogram configuration into set of range filter query, and later use the query weight to count how many documents are in each filter or bucket.
This PR checks if it's functionally match all at segment level if not able to create filter at shard level. This can happen if the query part of the aggregation request is not of above 3 types, while it doesn't have real effect on the current processed segment. So we can still do the filter rewrite for this segment. To make sure the results of this segment conform to the shard level bucket results. We build filter by using the shard level min max value bounds and considering the PointRangeQuery on the same field.
This PR refactors the logic that is bind to data from Aggregator into a inner class of Aggregator so those instance fields are easily accessed. While still keeps the common logic in the Helper as methods in the abstract base class or static methods.
This PR add logic to handle the existence of doc count field.
Optimization logic illustration
Related Issues
Resolves
Check List
New functionality includes testing.New functionality has been documented.Public documentation issue/PR createdBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.