Skip to content

Commit

Permalink
[8.18] [UA] Exclude enterprise search indices "Old index" deprecations (
Browse files Browse the repository at this point in the history
elastic#210526) (elastic#211162)

# Backport

This will backport the following commits from `8.x` to `8.18`:
- [[UA] Exclude enterprise search indices "Old index"
deprecations (elastic#210526)](elastic#210526)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2025-02-13T18:23:43Z","message":"[UA]
Exclude enterprise search indices \"Old index\" deprecations
(elastic#210526)\n\n## Summary\r\n\r\nExclude any \"Old data\" deprecations for
`.ent-search-` indices. Note,\r\nother deprecations will still be
present like frozen index deprecations:\r\n\r\n<img width=\"1219\"
alt=\"Screenshot 2025-02-11 at 11 23
14\"\r\nsrc=\"https://github.com/user-attachments/assets/f896b919-f7e0-4a7e-b2ee-418db2bc1724\"\r\n/>","sha":"058845046e698cd8a57b7dce1ea2fe3397569ce9","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["blocked","Team:Core","release_note:skip","Feature:Upgrade
Assistant","backport:version","v8.18.0","v8.19.0"],"title":"[UA] Exclude
enterprise search indices \"Old index\"
deprecations","number":210526,"url":"https://github.com/elastic/kibana/pull/210526","mergeCommit":{"message":"[UA]
Exclude enterprise search indices \"Old index\" deprecations
(elastic#210526)\n\n## Summary\r\n\r\nExclude any \"Old data\" deprecations for
`.ent-search-` indices. Note,\r\nother deprecations will still be
present like frozen index deprecations:\r\n\r\n<img width=\"1219\"
alt=\"Screenshot 2025-02-11 at 11 23
14\"\r\nsrc=\"https://github.com/user-attachments/assets/f896b919-f7e0-4a7e-b2ee-418db2bc1724\"\r\n/>","sha":"058845046e698cd8a57b7dce1ea2fe3397569ce9"}},"sourceBranch":"8.x","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
jloleysens authored Feb 14, 2025
1 parent 4bcd166 commit d916369
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
{
"level": "critical",
"message": "Index created before 7.0",
"url":
"https: //www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html",
"url": "https: //www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html",
"details": "This index was created using version: 6.8.13",
"resolve_during_rolling_upgrade": false
}
Expand Down Expand Up @@ -105,10 +104,8 @@
{
"level": "warning",
"message": "Setting [index.routing.allocation.include._tier] is deprecated",
"url":
"https://www.elastic.co/guide/en/elasticsearch/reference/7.16/migrating-7.13.html#deprecate-tier-filter-setting",
"details":
"Remove the [index.routing.allocation.include._tier] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/7.16/migrating-7.13.html#deprecate-tier-filter-setting",
"details": "Remove the [index.routing.allocation.include._tier] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
"resolve_during_rolling_upgrade": false,
"_meta": {
"actions": [
Expand Down Expand Up @@ -175,33 +172,71 @@
"details": "This index has version: 7.17.25",
"resolve_during_rolling_upgrade": false
}
],
".ent-search-1": [
{
"level": "critical",
"message": "Old index with a compatibility version < 8.0",
"url": "https: //www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking-changes-8.0",
"details": "This index has version: 7.17.28-8.0.0",
"resolve_during_rolling_upgrade": false,
"_meta": {
"reindex_required": true
}
}
],
".ent-search-2": [
{
"level": "critical",
"message": "Old index with a compatibility version < 8.0",
"url": "https: //www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking-changes-8.0",
"details": "This index has version: 7.17.28-8.0.0",
"resolve_during_rolling_upgrade": false,
"_meta": {
"reindex_required": true
}
}
],
".ent-search-3": [
{
"level": "critical",
"message": "Old index with a compatibility version < 8.0",
"url": "https: //www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking-changes-8.0",
"details": "This index has version: 7.17.28-8.0.0",
"resolve_during_rolling_upgrade": false,
"_meta": {
"reindex_required": true
}
}
]
},
"data_streams": {
"my-v7-data-stream" : [{
"level" : "critical",
"message" : "Old data stream with a compatibility version < 8.0",
"url" : "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
"details" : "This data stream has backing indices that were created before Elasticsearch 8.0.0",
"resolve_during_rolling_upgrade" : false,
"_meta": {
"backing_indices": {
"count": 52,
"need_upgrading": {
"count": 37,
"searchable_snapshot": {
"count": 23,
"fully_mounted": {
"count": 7
},
"partially_mounted": {
"count": 16
"my-v7-data-stream": [
{
"level": "critical",
"message": "Old data stream with a compatibility version < 8.0",
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-9.0.html",
"details": "This data stream has backing indices that were created before Elasticsearch 8.0.0",
"resolve_during_rolling_upgrade": false,
"_meta": {
"backing_indices": {
"count": 52,
"need_upgrading": {
"count": 37,
"searchable_snapshot": {
"count": 23,
"fully_mounted": {
"count": 7
},
"partially_mounted": {
"count": 16
}
}
}
}
}
}
}]
]
},
"ilm_policies": {
"myfreezepolicy": [
Expand All @@ -224,4 +259,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,69 @@ describe('getESUpgradeStatus', () => {
expect(upgradeStatus.totalCriticalDeprecations).toBe(0);
});

it('filters out old index deprecations enterprise search indices', async () => {
esClient.asCurrentUser.migration.deprecations.mockResponse({
cluster_settings: [],
node_settings: [],
ml_settings: [],
index_settings: {
'.ent-search-1': [
{
level: 'critical',
message: 'Old index with a compatibility version < 8.0',
url: 'https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.0.html#breaking-changes-8.0',
details: 'This index has version: 7.17.28-8.0.0',
resolve_during_rolling_upgrade: false,
_meta: { reindex_required: true },
},
{
level: 'critical',
message:
'Index [.ent-search-1] is a frozen index. The frozen indices feature is deprecated and will be removed in version 9.0.',
url: 'https://www.elastic.co/guide/en/elasticsearch/reference/master/frozen-indices.html',
details:
'Frozen indices must be unfrozen before upgrading to version 9.0. (The legacy frozen indices feature no longer offers any advantages. You may consider cold or frozen tiers in place of frozen indices.)',
resolve_during_rolling_upgrade: false,
},
],
'.ent-search-2': [
{
level: 'critical',
message:
'Index [.ent-search-2] is a frozen index. The frozen indices feature is deprecated and will be removed in version 9.0.',
url: 'https://www.elastic.co/guide/en/elasticsearch/reference/master/frozen-indices.html',
details:
'Frozen indices must be unfrozen before upgrading to version 9.0. (The legacy frozen indices feature no longer offers any advantages. You may consider cold or frozen tiers in place of frozen indices.)',
resolve_during_rolling_upgrade: false,
},
],
},
data_streams: {},
// @ts-expect-error not in types yet
ilm_policies: {},
templates: {},
});

const upgradeStatus = await getESUpgradeStatus(esClient, {
...featureSet,
});

expect(upgradeStatus.migrationsDeprecations).toHaveLength(2);
expect(
upgradeStatus.migrationsDeprecations.find((dep) => dep.correctiveAction?.type === 'reindex')
).toBeUndefined();

expect(
upgradeStatus.migrationsDeprecations.find((dep) => dep.index === '.ent-search-1')
).toMatchObject({
details: expect.stringContaining('Frozen indices'),
});
expect(
upgradeStatus.migrationsDeprecations.find((dep) => dep.index === '.ent-search-2')
).toMatchObject({
details: expect.stringContaining('Frozen indices'),
});
});
it('filters out frozen indices if old index deprecations exist for the same indices', async () => {
esClient.asCurrentUser.migration.deprecations.mockResponse({
cluster_settings: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const normalizeEsResponse = (migrationsResponse: EsDeprecations) => {
].flat();
};

const ENT_SEARCH_INDICES_PREFIX = '.ent-search-';

export const getEnrichedDeprecations = async (
dataClient: IScopedClusterClient
): Promise<EnrichedDeprecationInfo[]> => {
Expand Down Expand Up @@ -159,14 +161,23 @@ export const getEnrichedDeprecations = async (
}
}
})
.map((deprecation) => {
.flatMap((deprecation) => {
const correctiveAction = getCorrectiveAction(
deprecation.type,
deprecation.message,
deprecation.metadata as EsMetadata,
deprecation.index
);

if (
// Early exclusion of enterprise search indices that need to be reindexed
deprecation.index &&
deprecation.index.startsWith(ENT_SEARCH_INDICES_PREFIX) &&
correctiveAction?.type === 'reindex'
) {
return [];
}

// If we have found deprecation information for index/indices
// check whether the index is open or closed.
if (deprecation.type === 'index_settings' && correctiveAction?.type === 'reindex') {
Expand Down

0 comments on commit d916369

Please sign in to comment.