Skip to content
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 @@ -50626,12 +50626,12 @@
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexButton.tryAgainLabel": "Réessayer",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexText": "L'opération de réindexation permet de transformer un index en index compatible. Elle copiera tous les documents existants dans un nouvel index, et supprimera l'ancien index. En fonction de la taille et des ressources, la réindexation peut prendre beaucoup de temps, et vos données seront en lecture seule jusqu'à la fin de la tâche.",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.startIndexReadonlyButton": "Marquer en lecture seule",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.description": "Si vous n'en avez plus besoin, vous pouvez également supprimer l'index de {indexManagementLinkHtml}.",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.title": "Alternative: Supprimer l'index",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.description": "Dégelez cet index et marquez-le en lecture seule. Cela vous assurera que cet index restera compatible avec la version majeure suivante.",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.title": "Option 1 : Dégeler l'index",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.description": "Vous pouvez également réindexer les données sous un index compatible. Tous les documents existants seront copiés vers le nouvel index, et l'ancien index sera supprimé. En fonction de la taille de l'index et des ressources disponibles, l'opération de réindexation peut prendre un certain temps. Vos données seront en lecture seule jusqu'à la fin de la réindexation.",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.title": "Option 2 : Réindexer les données",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.description": "Si vous n'en avez plus besoin, vous pouvez également supprimer l'index de {indexManagementLinkHtml}.",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.title": "Option 3 : Supprimer l'index",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreezeIndexButton": "Dégeler",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.flyoutHeader": "Mettre à jour {index}",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.frozenCallout.reindexFrozenIndex": "Les index gelés ne seront plus compatibles après la mise à niveau. Ainsi, cet index sera transformé en index non gelé lors de l'opération de mise à jour. {docsLink}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50585,12 +50585,12 @@
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexButton.tryAgainLabel": "再試行",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexText": "再インデックス処理により、インデックスを互換性のある新しいインデックスに変換できます。この処理では、既存のすべてのドキュメントを新しいインデックスにコピーし、古いインデックスを削除します。サイズとリソースによっては、再インデックス化に時間がかかることがあり、ジョブが完了するまではデータが読み取り専用状態になります。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.startIndexReadonlyButton": "読み込み専用に設定",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.description": "不要になった場合は、{indexManagementLinkHtml}からインデックスを削除することもできます。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.title": "代替:インデックスの削除",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.description": "このインデックスの状態をフローズンから変更し、読み取り専用にします。これにより、インデックスは次のメジャーバージョンでも互換性が保証されます。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.title": "オプション 1:インデックスのフローズン状態を解除",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.description": "あるいは、新しい互換性のあるインデックスにデータを再インデックス化することもできます。既存のすべてのドキュメントは新しいインデックスにコピーされ、古いインデックスは削除されます。インデックスの規模と利用可能なリソースによっては、再インデックス処理に時間がかかる場合があります。再インデックス処理が完了するまで、データは読み取り専用モードになります。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.title": "オプション 2:データを再インデックス化",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.description": "不要になった場合は、{indexManagementLinkHtml}からインデックスを削除することもできます。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.title": "オプション3:インデックスの削除",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreezeIndexButton": "フローズン状態を解除",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.flyoutHeader": "{index}を更新",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.frozenCallout.reindexFrozenIndex": "アップグレード後は、フローズンインデックスはサポートされなくなります。その結果、このインデックスは更新処理中に非フローズンインデックスに変換されます。{docsLink}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50670,12 +50670,12 @@
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexButton.tryAgainLabel": "重试",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindexText": "借助重新索引操作,可以将索引转换为新的兼容索引。这会将所有现有文档复制到新索引中,然后删除旧版索引。根据大小和资源限制,重新索引可能需要很长时间,您的数据将处于只读状态,直到作业完成。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.startIndexReadonlyButton": "标记为只读",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.description": "如果不再需要该索引,还可以将其从 {indexManagementLinkHtml} 中删除。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.alternativeOption.title": "选择:删除索引",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.description": "取消冻结此索引并将其标记为只读。这将确保该索引仍然兼容下一主要版本。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option1.title": "选项 1:取消冻结索引",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.description": "或者,您可以将数据重新索引到新的兼容索引中。所有现有文档将复制到新索引中,并会删除旧版索引。根据索引大小和可用资源,重新索引操作可能需要一些时间。您的数据将处于只读模式,直到重新索引完成。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option2.title": "选项 2:为数据重建索引",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.description": "如果不再需要该索引,还可以将其从 {indexManagementLinkHtml} 中删除。",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreeze.option3.title": "选项 3:删除索引",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.unfreezeIndexButton": "取消冻结",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.flyoutHeader": "更新 {index}",
"xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.frozenCallout.reindexFrozenIndex": "升级后将不再支持已冻结索引。因此,会在更新操作期间将此索引转换为非冻结索引。{docsLink}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export const MOCK_REINDEX_DEPRECATION: EnrichedDeprecationInfo = {
index: 'reindex_index',
correctiveAction: {
type: 'reindex',
metadata: {
isClosedIndex: false,
isFrozenIndex: false,
isInDataStream: false,
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const defaultReindexStatusMeta: ReindexStatusResponse['meta'] = {
aliases: [],
isFrozen: false,
isReadonly: false,
isInDataStream: false,
};

describe('Reindex deprecation flyout', () => {
Expand Down
43 changes: 26 additions & 17 deletions x-pack/platform/plugins/private/upgrade_assistant/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ReindexStatusResponse {
aliases: string[];
isReadonly: boolean;
isFrozen: boolean;
isInDataStream: boolean;
};
warnings?: IndexWarning[];
reindexOp?: ReindexOperation;
Expand Down Expand Up @@ -193,16 +194,22 @@ export interface DeprecationInfo {
export interface IndexSettingsDeprecationInfo {
[indexName: string]: DeprecationInfo[];
}
export interface ReindexAction {
type: 'reindex';

export interface IndexMetadata {
isFrozenIndex: boolean;
isInDataStream: boolean;
isClosedIndex: boolean;
}

export interface IndexAction {
/**
* Indicate what blockers have been detected for calling reindex
* against this index.
*
* @remark
* In future this could be an array of blockers.
* Includes relevant information about the index related to this action
*/
blockerForReindexing?: 'index-closed'; // 'index-closed' can be handled automatically, but requires more resources, user should be warned
metadata: IndexMetadata;
}

export interface ReindexAction extends IndexAction {
type: 'reindex';

/**
* The transform IDs that are currently targeting this index
Expand All @@ -215,7 +222,7 @@ export interface ReindexAction {
excludedActions?: string[];
}

export interface UnfreezeAction {
export interface UnfreezeAction extends IndexAction {
type: 'unfreeze';
}

Expand All @@ -242,6 +249,15 @@ export interface HealthIndicatorAction {
impacts: HealthReportImpact[];
}

export type CorrectiveAction =
| ReindexAction
| UnfreezeAction
| MlAction
| IndexSettingAction
| ClusterSettingAction
| DataStreamsAction
| HealthIndicatorAction;

export interface EnrichedDeprecationInfo
extends Omit<
estypes.MigrationDeprecationsDeprecation,
Expand All @@ -256,14 +272,7 @@ export interface EnrichedDeprecationInfo
isCritical: boolean;
status?: estypes.HealthReportIndicatorHealthStatus;
index?: string;
correctiveAction?:
| ReindexAction
| UnfreezeAction
| MlAction
| IndexSettingAction
| ClusterSettingAction
| DataStreamsAction
| HealthIndicatorAction;
correctiveAction?: CorrectiveAction;
resolveDuringUpgrade: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export const DurationClarificationCallOut: React.FunctionComponent<Props> = ({
/>
<br />
<br />
<FormattedMessage
id="xpack.upgradeAssistant.dataStream.migration.flyout.warningsStep.backingIndicesUnfrozen"
defaultMessage="If any of the backing indices of the data stream are frozen, they will be converted to non-frozen indices during the update process."
/>
<br />
<br />
<FormattedMessage
id="xpack.upgradeAssistant.dataStream.migration.flyout.warningsStep.suggestReadOnly"
defaultMessage="Depending on size and resources, reindexing may take extended time and your data will be in a read-only state until the job has completed. {learnMoreHtml}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { createContext, useContext } from 'react';
import { ApiService } from '../../../../lib/api';
import { useReindex, ReindexState } from './use_reindex';
import { UpdateIndexState, useUpdateIndex } from './use_update_index';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
import { EnrichedDeprecationInfo, IndexAction } from '../../../../../../common/types';

export interface IndexStateContext {
deprecation: EnrichedDeprecationInfo;
Expand Down Expand Up @@ -43,9 +43,13 @@ export const IndexStatusProvider: React.FunctionComponent<Props> = ({
children,
}) => {
const indexName = deprecation.index!;
const indexAction = deprecation.correctiveAction as IndexAction;
const { reindexState, startReindex, cancelReindex } = useReindex({
indexName,
api,
isInDataStream: Boolean(indexAction?.metadata.isInDataStream),
isFrozen: Boolean(indexAction?.metadata.isFrozenIndex),
isClosedIndex: Boolean(indexAction?.metadata.isClosedIndex),
});

const { updateIndexState, updateIndex } = useUpdateIndex({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ export const IndexFlyout: React.FunctionComponent<IndexFlyoutProps> = ({
switch (flyoutStep) {
case 'details':
return correctiveAction?.type === 'unfreeze' ? (
// we will show specific unfreeze details/flow for:
// A) 7.x indices that are frozen AND read-only (should be an edge case)
<UnfreezeDetailsFlyoutStep
closeFlyout={closeFlyout}
startReindex={() => {
Expand All @@ -141,11 +139,6 @@ export const IndexFlyout: React.FunctionComponent<IndexFlyoutProps> = ({
reindexState={reindexState}
/>
) : (
// we will show specific reindex details/flow for:
// B) 7.x indices that are frozen AND NOT read-only (should be the most common scenario)
// C) 7.x indices that are not frozen
// C.1) if they are read-only => this will be a WARNING deprecation
// C.2) if they are NOT read-only => this will be a CRITICAL deprecation
<ReindexDetailsFlyoutStep
closeFlyout={closeFlyout}
startReindex={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* 2.0.
*/

import React from 'react';
import React, { Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiLink } from '@elastic/eui';
import { EuiLink, EuiSpacer } from '@elastic/eui';
import { EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { ReindexStatus } from '../../../../../../../../../common/types';
import { IndexClosedParagraph } from '../index_closed_paragraph';

export const getReindexButtonLabel = (status?: ReindexStatus) => {
switch (status) {
Expand Down Expand Up @@ -47,11 +48,13 @@ export const getReindexButtonLabel = (status?: ReindexStatus) => {
};

export const getDefaultGuideanceText = ({
isClosedIndex,
readOnlyExcluded,
reindexExcluded,
indexBlockUrl,
indexManagementUrl,
}: {
isClosedIndex: boolean;
readOnlyExcluded: boolean;
reindexExcluded: boolean;
indexBlockUrl: string;
Expand All @@ -73,6 +76,12 @@ export const getDefaultGuideanceText = ({
id="xpack.upgradeAssistant.esDeprecations.indices.indexFlyout.detailsStep.reindex.option1.description"
defaultMessage="The reindex operation allows transforming an index into a new, compatible one. It will copy all of the existing documents into a new index and remove the old one. Depending on size and resources, reindexing may take extended time and your data will be in a read-only state until the job has completed."
/>
{isClosedIndex && (
<Fragment>
<EuiSpacer size="xs" />
<IndexClosedParagraph />
</Fragment>
)}
</EuiText>
),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ describe('ReindexDetailsFlyoutStep', () => {
loadingState: LoadingState.Success,
meta: {
indexName: 'some_index',
reindexName: 'some_index-reindexed-for-9',
aliases: [],
isInDataStream: false,
isFrozen: false,
isReadonly: false,
reindexName: 'some_index-reindexed-for-9',
isClosedIndex: false,
},
hasRequiredPrivileges: true,
reindexTaskPercComplete: null,
Expand Down Expand Up @@ -227,7 +229,15 @@ describe('ReindexDetailsFlyoutStep', () => {
updateIndexState={defaultUpdateIndexState()}
deprecation={{
...defaultDeprecation(),
correctiveAction: { type: 'reindex', transformIds: ['abc', 'def'] },
correctiveAction: {
type: 'reindex',
transformIds: ['abc', 'def'],
metadata: {
isFrozenIndex: false,
isInDataStream: false,
isClosedIndex: false,
},
},
}}
/>
);
Expand All @@ -239,6 +249,11 @@ describe('ReindexDetailsFlyoutStep', () => {
deprecation={
Object {
"correctiveAction": Object {
"metadata": Object {
"isClosedIndex": false,
"isFrozenIndex": false,
"isInDataStream": false,
},
"transformIds": Array [
"abc",
"def",
Expand Down
Loading