Skip to content

[BUG] Upgraded indices aren't considered compatible for upgrade to 3.0.0 #18717

@ShowMeTheGita

Description

@ShowMeTheGita

Describe the bug

Also available here


Versions):
OpenSearch 2.19.2
OpenSearch 3.0.0

Describe the issue:
During an upgrade from OpenSearch 2.19.2 to 3.0.0, we're encountering compatibility errors with system indices (primarily .kibana_* indices) that were originally created in Elasticsearch 7.10.2 but have been upgraded to OpenSearch 2.19.0 at some point in the past:

The index [[.kibana_xxx/uuid]] was created with version [7.10.2] but the minimum compatible version is [2.0.0]. It should be re-indexed in OpenSearch 2.x before upgrading to 3.0.0.

Checking the _settings?human for that index returns the following:

        "version": {
          "upgraded": "136407827",
          "created_string": "7.10.2",
          "upgraded_string": "2.19.0",
          "created": "7100299"
        }

Is it expected behavior that system indices (.kibana_*, etc.) that were originally created in Elasticsearch 7.x (but upgraded since) would cause compatibility issues during an upgrade? These indices contain configuration data and are usually managed by OpenSearch.

The upgrade documentation index compatibility reference ends in OpenSearch versions 2.13.0/2.14.0 which suggests that anything above that would likely be compatible with 3.0.0, or is this a misinterpretation?

The indices function correctly in OpenSearch 2.19.2 and contain the upgraded_string: "2.19.0" field.

Could it be that this validation is only looking at created_string and not upgraded_string? Is this expected behavior?
I'm afraid I couldn't find much documentation specifying the impact of these attributes inside version related to the upgrade process.

I'm still in the process of developing an automated workaround for this, but so far it has involved doing the following steps:

  • Create a temporary index with the same template as the original
  • Reindex the original index to the temporary index
  • Delete the original index
  • Create a new index with the same original index name and template
  • Reindex from the temporary index back to the new one

EDIT: From the reindexing process mentioned above we came to understand a couple of things:

  • The old indexes that existed with incremental suffixes such as _1 and _2 seem to have been created during other upgrade activities. We confirmed that they were simply old aliases that were no longer being used. After this finding, we were able to simply delete them and only keep the last _* index which indeed was aliased to the same index name, but without the suffix
  • Reindexing by itself was not enough because after it is complete, the new index does not contain the alias as the original one. To fix this, we simply added the alias back after the reindexing was completed
  • All of the above being said, we still had internal indexes from plugins such as .opendistro_alerting that did require a reindexing even though they did not have an alias. Since we do not use most of those plugins, we went ahead with the rendexing and it didn't seem to break any functionality. Still, our showstopper as of right now is the .opendistro_security as we do not know what the outcome will be of reindexing this sensitive index. We're consdering reindexing it after having a security backup using the securityadmin.sh script. Our main concern is the reindexing process breaking something and not being able to even login as admin user

I've added the link to this other forum post below, but want to underline this since it does seem to be the same problem

Do be aware that this is just a proof of concept, but doing so seems to not have broken any functionality, and the new index settings now shows the following:

        "version": {
          "created_string": "2.19.2",
          "created": "136408027"
        }

... which I'm hopeful will fix the issue.

However, two questions remain:

  • Is this a bug or expected behavior? Should upgraded indices (system or otherwise) not be considered compatible?
  • Are system indices also supposed to be reindexed to match the compatibility reference table constraints? I ask because it always raises some suspicions when these indices need to be tampered with at all.

Thanks.


Relevant links
Impossible upgrade Opensearch 1.3.2 to 2.0.0 - index version incompatible

Related component

Other

To Reproduce

  1. Upgrade an incompatible index to a newer version
  2. Attempt to upgrade from 2.X,X to major 3.X.X

Expected behavior

Upgraded indices are considered compatible according to index compatibility reference

Additional Details

Plugins
n/a

Screenshots
n/a

Host/Environment (please complete the following information):

  • OS: RHEL
  • Version 7.9

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    OtherbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions