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

Warn about index.mapper.dynamic usage instead of erroring #11193

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

peternied
Copy link
Member

@peternied peternied commented Nov 14, 2023

Description

When migrating from older versions of Elasticsearch/OpenSearch index.mapper.dynamic could be present, use the deprecation system to warn about this state and ignore this legacy setting so the index is usable.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • 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.

@peternied
Copy link
Member Author

@shwetathareja Could you take a look into this issue? I'd would also like to backport this change to 2.12 and 1.3

Copy link
Contributor

❕ Gradle check result for 747f7c5: UNSTABLE

  • TEST FAILURES:
      3 org.opensearch.cluster.coordination.AwarenessAttributeDecommissionIT.testConcurrentDecommissionAction

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@peternied peternied marked this pull request as ready for review February 21, 2024 00:15
Copy link
Contributor

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

@reta
Copy link
Collaborator

reta commented Feb 21, 2024

@peternied the DCO check is failing ... :(

Copy link
Contributor

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

@peternied
Copy link
Member Author

This because of the version bump is midflight?

=== Standard output of node `node{:qa:mixed-cluster:v2.13.0-0}` ===

»    ↓ errors and warnings from /var/jenkins/workspace/gradle-check/search/qa/mixed-cluster/build/testclusters/v2.13.0-0/logs/opensearch.stdout.log ↓
» WARN ][o.o.g.DanglingIndicesState] [v2.13.0-0] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
» WARN ][o.o.d.FileBasedSeedHostsProvider] [v2.13.0-0] expected, but did not find, a dynamic hosts list at [/var/jenkins/workspace/gradle-check/search/qa/mixed-cluster/build/testclusters/v2.13.0-0/config/unicast_hosts.txt]
»   ↑ repeated 4 times ↑
» ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [v2.13.0-0] uncaught exception in thread [main]
»  org.opensearch.bootstrap.StartupException: OpenSearchException[failed to bind service]; nested: IndexFormatTooNewException[Format version is not supported (resource BufferedChecksumIndexInput(NIOFSIndexInput(path="/var/jenkins/workspace/gradle-check/search/qa/mixed-cluster/build/testclusters/v2.13.0-0/data/nodes/0/_state/_5.cfs") [slice=_5.fnm])): 1 (needs to be between 0 and 0)];
»  	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:185) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:172) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) ~[opensearch-cli-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.cli.Command.main(Command.java:101) ~[opensearch-cli-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:138) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:104) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  Caused by: org.opensearch.OpenSearchException: failed to bind service
»  	at org.opensearch.node.Node.<init>(Node.java:1331) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.node.Node.<init>(Node.java:413) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:242) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:404) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:181) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
»  	... 6 more

@reta
Copy link
Collaborator

reta commented Feb 21, 2024

This because of the version bump is midflight?

I think should be fixed, we've just merged #12394 to main

Copy link
Contributor

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

Copy link
Contributor

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

When migrating from older versions of OpenSearch index.mapper.dynamic
could be present, use the deprecation system to warn about this state and
ignore this legacy setting so the index is usable.

Signed-off-by: Peter Nied <petern@amazon.com>
@peternied peternied changed the title Warn about deprecated and ignored index.mapper.dynamic index setting for better backwards compatibility Warn about index.mapper.dynamic usage instead of erroring Feb 21, 2024
@github-actions github-actions bot added v2.13.0 Issues and PRs related to version 2.13.0 v3.0.0 Issues and PRs related to version 3.0.0 labels Feb 21, 2024
Copy link
Contributor

❕ Gradle check result for 7e28535: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.index.IndexServiceTests.testAsyncTranslogTrimTaskOnClosedIndex

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@peternied peternied merged commit f34ca96 into opensearch-project:main Feb 21, 2024
33 checks passed
@peternied peternied deleted the unset-dynamic-mapper branch February 21, 2024 14:51
@peternied peternied added the backport 2.x Backport to 2.x branch label Feb 21, 2024
@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-11193-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f34ca960149c4f37f18bddfa4a0b0d7d2dcee9e4
# Push it to GitHub
git push --set-upstream origin backport/backport-11193-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-11193-to-2.x.

@reta
Copy link
Collaborator

reta commented Feb 21, 2024

@peternied it seems like this fix is incomplete, nonetheless the value of INDEX_MAPPER_DYNAMIC_SETTING should be ignored, it won't be, org.opensearch.action.support.AutoCreateIndex:

    public AutoCreateIndex(
        Settings settings,
        ClusterSettings clusterSettings,
        IndexNameExpressionResolver resolver,
        SystemIndices systemIndices
    ) {
        this.resolver = resolver;
        dynamicMappingDisabled = !MapperService.INDEX_MAPPER_DYNAMIC_SETTING.get(settings);
        this.systemIndices = systemIndices;
        this.autoCreate = AUTO_CREATE_INDEX_SETTING.get(settings);
        clusterSettings.addSettingsUpdateConsumer(AUTO_CREATE_INDEX_SETTING, this::setAutoCreate);
    }

peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Mar 1, 2024
…ch-project#11193)

When migrating from older versions of OpenSearch index.mapper.dynamic
could be present, use the deprecation system to warn about this state and
ignore this legacy setting so the index is usable.

Signed-off-by: Peter Nied <petern@amazon.com>
amkhar pushed a commit to amkhar/OpenSearch that referenced this pull request Mar 12, 2024
…ch-project#11193)

When migrating from older versions of OpenSearch index.mapper.dynamic
could be present, use the deprecation system to warn about this state and
ignore this legacy setting so the index is usable.

Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: Aman Khare <amkhar@amazon.com>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
…ch-project#11193)

When migrating from older versions of OpenSearch index.mapper.dynamic
could be present, use the deprecation system to warn about this state and
ignore this legacy setting so the index is usable.

Signed-off-by: Peter Nied <petern@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…ch-project#11193)

When migrating from older versions of OpenSearch index.mapper.dynamic
could be present, use the deprecation system to warn about this state and
ignore this legacy setting so the index is usable.

Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
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 bug Something isn't working Indexing & Search v2.13.0 Issues and PRs related to version 2.13.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
3 participants