Skip to content
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

make QueryGroups durable #16370

Merged

Conversation

kaushalmahi12
Copy link
Contributor

Description

This change enables QueryGroupMetadata type to be persistable. To make a Metadata.Custom type persistable in ClusterState, we need to register the new Custom type in ClusterModule at two places

  1. ClusterModule#getNamedXWriteables
  2. ClusterModule#getNamedWriteables
    We were missing the 1 step in this, hence it was being saved onto the disk but not getting reloaded since XContentRegistry did not had any information about this Custom type.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Signed-off-by: Kaushal Kumar <[email protected]>
Copy link
Contributor

❌ Gradle check result for ff9a37b: 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?

@dbwiddis
Copy link
Member

Execution failed for task ':server:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/opensearch/cluster/ClusterModuleTests.java
          @@ -340,7 +340,9 @@
           
           ········assertTrue(
           ············customXEntries.stream()
          -················.anyMatch(entry·->·entry.categoryClass·==·Metadata.Custom.class·&&·entry.name.getPreferredName().equals(QueryGroupMetadata.TYPE))
          +················.anyMatch(
          +····················entry·->·entry.categoryClass·==·Metadata.Custom.class·&&·entry.name.getPreferredName().equals(QueryGroupMetadata.TYPE)
          +················)
           ········);
           ····}

Signed-off-by: Kaushal Kumar <[email protected]>
Signed-off-by: Kaushal Kumar <[email protected]>
@kaushalmahi12 kaushalmahi12 self-assigned this Oct 17, 2024
@kaushalmahi12 kaushalmahi12 added the backport 2.x Backport to 2.x branch label Oct 17, 2024
Copy link
Contributor

❌ Gradle check result for 8c15efe: 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?

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Kaushal Kumar <[email protected]>
Copy link
Contributor

❌ Gradle check result for 81641ce: 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?

@jainankitk
Copy link
Collaborator

Unrelated failures:

[Test Result](https://build.ci.opensearch.org/job/gradle-check/49655/testReport/) (2 failures / +2)

    [org.opensearch.indices.settings.SearchOnlyReplicaIT.testFailoverWithSearchReplica_WithoutWriterReplicas](https://build.ci.opensearch.org/job/gradle-check/49655/testReport/junit/org.opensearch.indices.settings/SearchOnlyReplicaIT/testFailoverWithSearchReplica_WithoutWriterReplicas/)
    [org.opensearch.search.SearchTimeoutIT.testSimpleTimeout {p0={"search.concurrent_segment_search.enabled":"false"}}](https://build.ci.opensearch.org/job/gradle-check/49655/testReport/junit/org.opensearch.search/SearchTimeoutIT/testSimpleTimeout__p0___search_concurrent_segment_search_enabled___false___/)

Copy link
Contributor

❕ Gradle check result for 81641ce: 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.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.02%. Comparing base (dc8a435) to head (81641ce).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16370      +/-   ##
============================================
+ Coverage     71.96%   72.02%   +0.06%     
- Complexity    64791    64807      +16     
============================================
  Files          5307     5307              
  Lines        302714   302726      +12     
  Branches      43733    43734       +1     
============================================
+ Hits         217836   218036     +200     
+ Misses        67013    66735     -278     
- Partials      17865    17955      +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jainankitk jainankitk merged commit 3b004bf into opensearch-project:main Oct 18, 2024
38 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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-16370-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3b004bfb2aa8377f5f7912e657cd16bd5e525518
# Push it to GitHub
git push --set-upstream origin backport/backport-16370-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 base branch is 2.x and the compare/head branch is backport/backport-16370-to-2.x.

dbwiddis pushed a commit to dbwiddis/OpenSearch that referenced this pull request Oct 18, 2024
…ect#16370)

* add QueryGroupMetadata to namedXContentWritables

Signed-off-by: Kaushal Kumar <[email protected]>

* add UT

Signed-off-by: Kaushal Kumar <[email protected]>

* apply spotless

Signed-off-by: Kaushal Kumar <[email protected]>

* add CHANGELOG entry

Signed-off-by: Kaushal Kumar <[email protected]>

* improve changelog comment

Signed-off-by: Kaushal Kumar <[email protected]>

---------

Signed-off-by: Kaushal Kumar <[email protected]>
dbwiddis pushed a commit to dbwiddis/OpenSearch that referenced this pull request Oct 18, 2024
…ect#16370)

* add QueryGroupMetadata to namedXContentWritables

Signed-off-by: Kaushal Kumar <[email protected]>

* add UT

Signed-off-by: Kaushal Kumar <[email protected]>

* apply spotless

Signed-off-by: Kaushal Kumar <[email protected]>

* add CHANGELOG entry

Signed-off-by: Kaushal Kumar <[email protected]>

* improve changelog comment

Signed-off-by: Kaushal Kumar <[email protected]>

---------

Signed-off-by: Kaushal Kumar <[email protected]>
kaushalmahi12 added a commit to kaushalmahi12/OpenSearch that referenced this pull request Oct 18, 2024
…ect#16370)

* add QueryGroupMetadata to namedXContentWritables

Signed-off-by: Kaushal Kumar <[email protected]>

* add UT

Signed-off-by: Kaushal Kumar <[email protected]>

* apply spotless

Signed-off-by: Kaushal Kumar <[email protected]>

* add CHANGELOG entry

Signed-off-by: Kaushal Kumar <[email protected]>

* improve changelog comment

Signed-off-by: Kaushal Kumar <[email protected]>

---------

Signed-off-by: Kaushal Kumar <[email protected]>
@kaushalmahi12 kaushalmahi12 deleted the query_group-state-fix branch October 18, 2024 05:21
dbwiddis pushed a commit that referenced this pull request Oct 18, 2024
* add QueryGroupMetadata to namedXContentWritables



* add UT



* apply spotless



* add CHANGELOG entry



* improve changelog comment



---------

Signed-off-by: Kaushal Kumar <[email protected]>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…ect#16370)

* add QueryGroupMetadata to namedXContentWritables

Signed-off-by: Kaushal Kumar <[email protected]>

* add UT

Signed-off-by: Kaushal Kumar <[email protected]>

* apply spotless

Signed-off-by: Kaushal Kumar <[email protected]>

* add CHANGELOG entry

Signed-off-by: Kaushal Kumar <[email protected]>

* improve changelog comment

Signed-off-by: Kaushal Kumar <[email protected]>

---------

Signed-off-by: Kaushal Kumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants