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

[UA] Ensure that old indices are detected for reindexing #203082

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@
"details": "[[type: tweet, field: liked]]",
"resolve_during_rolling_upgrade": false
}
],
"myindex": [
{
"level": "critical",
"message": "Old index with a compatibility version < 8.0",
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
"details": "This index has version: 7.17.25",
"resolve_during_rolling_upgrade": false
}
]
},
"data_streams": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ type EsMetadata = Actions & {
[key: string]: string;
};

// TODO(jloleysens): Replace these regexes once this issue is addressed https://github.com/elastic/elasticsearch/issues/118062
const ES_INDEX_MESSAGES_REQIURING_REINDEX = [
/Index created before/,
/index with a compatibility version \</,
];

export const getCorrectiveAction = (
message: string,
metadata: EsMetadata,
Expand All @@ -31,7 +37,9 @@ export const getCorrectiveAction = (
const clusterSettingDeprecation = metadata?.actions?.find(
(action) => action.action_type === 'remove_settings' && typeof indexName === 'undefined'
);
const requiresReindexAction = /Index created before/.test(message);
const requiresReindexAction = ES_INDEX_MESSAGES_REQIURING_REINDEX.some((regexp) =>
regexp.test(message)
);
const requiresIndexSettingsAction = Boolean(indexSettingDeprecation);
const requiresClusterSettingsAction = Boolean(clusterSettingDeprecation);
const requiresMlAction = /[Mm]odel snapshot/.test(message);
Expand Down
Loading