Skip to content

Enable plugins.query.pruning.enabled by default - #5759

Draft
dai-chen wants to merge 1 commit into
opensearch-project:mainfrom
dai-chen:enable-index-pruning-by-default
Draft

Enable plugins.query.pruning.enabled by default#5759
dai-chen wants to merge 1 commit into
opensearch-project:mainfrom
dai-chen:enable-index-pruning-by-default

Conversation

@dai-chen

Copy link
Copy Markdown
Collaborator

Description

Index pruning shipped in PR #5727 turned off behind plugins.query.pruning.enabled. As the required resolve index and fields cap permissions added to ppl_full_access role in opensearch-project/security#6471, this PR enables it by default. The setting remains dynamic, so a cluster hit by one of the documented limitations can turn pruning off at runtime, as the user manual shows.

Related Issues

Part of #5698

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By 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.

@dai-chen dai-chen self-assigned this Sep 10, 2026
@dai-chen dai-chen added enhancement New feature or request PPL Piped processing language labels Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 59b832c)

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Latest suggestions up to 59b832c

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use boolean-specific assertion methods

Use assertTrue and assertFalse instead of assertEquals with boolean literals for
better readability and more idiomatic JUnit assertions. This makes the test intent
clearer and provides better failure messages.

opensearch/src/test/java/org/opensearch/sql/opensearch/setting/OpenSearchSettingsTest.java [134-137]

-assertEquals(true, settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
+assertTrue(settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
 
 settings.new Updater(Settings.Key.QUERY_PRUNING_ENABLED).accept(false);
-assertEquals(false, settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
+assertFalse(settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
Suggestion importance[1-10]: 5

__

Why: Using assertTrue and assertFalse instead of assertEquals with boolean literals is a valid improvement for code readability and provides more idiomatic JUnit assertions. However, this is a minor style improvement that doesn't affect functionality or correctness.

Low

Previous suggestions

Suggestions up to commit 38a4b67
CategorySuggestion                                                                                                                                    Impact
General
Use boolean-specific assertion methods

Use assertTrue() instead of assertEquals(true, ...) for better readability and more
descriptive assertion failures. Similarly, use assertFalse() for the boolean false
check below.

opensearch/src/test/java/org/opensearch/sql/opensearch/setting/OpenSearchSettingsTest.java [134]

-assertEquals(true, settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
+assertTrue(settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
Suggestion importance[1-10]: 4

__

Why: While using assertTrue() instead of assertEquals(true, ...) is a valid improvement for test readability and more descriptive failure messages, this is a minor code style enhancement that doesn't affect functionality or correctness.

Low
Suggestions up to commit d2ba155
CategorySuggestion                                                                                                                                    Impact
General
Use boolean-specific assertions

Use assertTrue and assertFalse instead of assertEquals with boolean literals for
better readability and more descriptive test failures. This follows JUnit best
practices for boolean assertions.

opensearch/src/test/java/org/opensearch/sql/opensearch/setting/OpenSearchSettingsTest.java [134-137]

-assertEquals(true, settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
+assertTrue(settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
 
 settings.new Updater(Settings.Key.QUERY_PRUNING_ENABLED).accept(false);
-assertEquals(false, settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
+assertFalse(settings.getSettingValue(Settings.Key.QUERY_PRUNING_ENABLED));
Suggestion importance[1-10]: 5

__

Why: Using assertTrue and assertFalse instead of assertEquals with boolean literals is a valid improvement that enhances test readability and provides clearer failure messages. However, this is a minor style improvement that doesn't affect functionality or correctness.

Low

@dai-chen
dai-chen force-pushed the enable-index-pruning-by-default branch from d2ba155 to 38a4b67 Compare September 11, 2026 16:34
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 38a4b67

@dai-chen
dai-chen force-pushed the enable-index-pruning-by-default branch from 38a4b67 to 04e5334 Compare September 11, 2026 16:53
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 04e5334

The permissions its probes need were added to ppl_full_access in
opensearch-project/security#6471.

Signed-off-by: Chen Dai <daichen@amazon.com>
@dai-chen
dai-chen force-pushed the enable-index-pruning-by-default branch from 04e5334 to 59b832c Compare September 11, 2026 16:59
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 59b832c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PPL Piped processing language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant