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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management
x-pack/platform/plugins/private/telemetry_collection_xpack @elastic/kibana-core
x-pack/platform/plugins/private/transform @elastic/ml-ui
x-pack/platform/plugins/private/translations @elastic/kibana-localization
x-pack/platform/plugins/private/upgrade_assistant @elastic/kibana-core
x-pack/platform/plugins/private/upgrade_assistant @elastic/kibana-management
x-pack/platform/plugins/private/watcher @elastic/kibana-management
x-pack/platform/plugins/shared/actions @elastic/response-ops
x-pack/platform/plugins/shared/ai_infra/llm_tasks @elastic/appex-ai-infra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
trainedModels: `${MACHINE_LEARNING_DOCS}ml-trained-models.html`,
textEmbedding: `${MACHINE_LEARNING_DOCS}ml-nlp-model-ref.html#ml-nlp-model-ref-text-embedding`,
troubleshootSetup: `${ENTERPRISE_SEARCH_DOCS}troubleshoot-setup.html`,
upgrade9x: `${ENTERPRISE_SEARCH_DOCS}upgrading-to-9-x.html`,
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
},
metricbeat: {
Expand Down Expand Up @@ -301,6 +302,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
upgradeAssistant: {
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
indexBlocks: `${ELASTICSEARCH_DOCS}index-modules-blocks.html#index-block-settings`,
remoteReindex: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-from-remote`,
unfreezeApi: `${ELASTICSEARCH_DOCS}unfreeze-index-api.html`,
reindexWithPipeline: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-with-an-ingest-pipeline`,
Expand Down
2 changes: 2 additions & 0 deletions src/platform/packages/shared/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export interface DocLinks {
readonly textEmbedding: string;
readonly troubleshootSetup: string;
readonly usersAccess: string;
readonly upgrade9x: string;
};
readonly heartbeat: {
readonly base: string;
Expand Down Expand Up @@ -261,6 +262,7 @@ export interface DocLinks {
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly indexBlocks: string;
readonly remoteReindex: string;
readonly unfreezeApi: string;
readonly reindexWithPipeline: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47450,9 +47450,6 @@
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "Retrait des paramètres en cours…",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "Retirer les paramètres",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "Corrigez ce problème en retirant les paramètres de ce cluster. La correction peut s'effectuer automatiquement.",
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "Chargement du statut…",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "Marquer en lecture seule ou réindexer",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "Ce problème peut être résolu en réindexant ce flux de données ou en marquant ses index en lecture seule. La correction peut s'effectuer automatiquement.",
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "Flux de données",
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "Manuel",
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "Fermer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47415,9 +47415,6 @@
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "設定を削除中…",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "設定の削除",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "このクラスターから設定を削除して、この問題を解決します。この問題は自動的に解決できます。",
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "ステータスを読み込んでいます...",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "読み取り専用に設定または再インデックス",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "この問題を解決するには、このデータストリームを再インデックス化するか、そのインデックスを読み取り専用に設定します。この問題は自動的に解決できます。",
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "データストリーム",
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "手動",
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "閉じる",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47489,9 +47489,6 @@
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "设置移除进行中……",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "移除设置",
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "通过从此集群中移除设置来解决该问题。此问题会自动解决。",
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "正在加载状态……",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "标记为只读,或重新索引",
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "请通过重新索引该数据流或将其索引标记为只读来解决此问题。此问题会自动解决。",
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "数据流",
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "手动",
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "关闭",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ These surface runtime deprecations, e.g. a Painless script that uses a deprecate
request to a deprecated API. These are also generally surfaced as deprecation headers within the
response. Even if the cluster state is good, app maintainers need to watch the logs in case
deprecations are discovered as data is migrated. Starting in 7.x, deprecation logs can be written to a file or a data stream ([#58924](https://github.com/elastic/elasticsearch/pull/58924)). When the data stream exists, the Upgrade Assistant provides a way to analyze the logs through Observability or Discover ([#106521](https://github.com/elastic/kibana/pull/106521)).
* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/server/docs/kib_core_deprecations_service.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team.
* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/server/deprecations/README.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team.

### Fixing problems

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 @@ -21,6 +21,9 @@ const defaultReindexStatusMeta: ReindexStatusResponse['meta'] = {
indexName: 'foo',
reindexName: 'reindexed-foo',
aliases: [],
isFrozen: false,
isReadonly: false,
isInDataStream: false,
};

describe('Reindex deprecation flyout', () => {
Expand Down Expand Up @@ -75,28 +78,22 @@ describe('Reindex deprecation flyout', () => {

expect(exists('reindexDetails')).toBe(true);
expect(find('reindexDetails.flyoutTitle').text()).toContain(
`Reindex ${reindexDeprecation.index}`
`Update ${reindexDeprecation.index}`
);
});

it('renders error callout when reindex fails', async () => {
await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();

const { actions, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);

httpRequestsMockHelpers.setStartReindexingResponse(MOCK_REINDEX_DEPRECATION.index!, undefined, {
statusCode: 404,
message: 'no such index [test]',
});

await actions.reindexDeprecationFlyout.clickReindexButton();
const { actions, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
expect(exists('reindexDetails')).toBe(true);
expect(exists('reindexDetails.reindexingFailedCallout')).toBe(true);
});

Expand All @@ -106,28 +103,16 @@ describe('Reindex deprecation flyout', () => {
message: 'no such index [test]',
});

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();

const { actions, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(exists('reindexDetails.fetchFailedCallout')).toBe(true);
});

describe('reindexing progress', () => {
it('has not started yet', async () => {
const { actions, find, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing process');
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
});

it('has started but not yet reindexing documents', async () => {
httpRequestsMockHelpers.setReindexStatusResponse(MOCK_REINDEX_DEPRECATION.index!, {
reindexOp: {
Expand All @@ -140,14 +125,11 @@ describe('Reindex deprecation flyout', () => {
meta: defaultReindexStatusMeta,
});

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();
const { actions, find, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 5%');
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
Expand All @@ -165,14 +147,11 @@ describe('Reindex deprecation flyout', () => {
meta: defaultReindexStatusMeta,
});

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();
const { actions, find, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 30%');
expect(exists('cancelReindexingDocumentsButton')).toBe(true);
Expand All @@ -190,14 +169,11 @@ describe('Reindex deprecation flyout', () => {
meta: defaultReindexStatusMeta,
});

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();
const { actions, find, exists } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 90%');
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
Expand All @@ -215,14 +191,11 @@ describe('Reindex deprecation flyout', () => {
meta: defaultReindexStatusMeta,
});

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

const { actions, find, exists, component } = testBed;
component.update();

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 95%');
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
Expand Down Expand Up @@ -250,14 +223,11 @@ describe('Reindex deprecation flyout', () => {
},
]);

await act(async () => {
testBed = await setupElasticsearchPage(httpSetup);
});

testBed.component.update();
const { actions, find } = testBed;

await actions.table.clickDeprecationRowAt('reindex', 0);
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step

expect(find('lowDiskSpaceCallout').text()).toContain('Nodes with low disk space');
expect(find('impactedNodeListItem').length).toEqual(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const servicesMock = {
const idToUrlMap = {
SNAPSHOT_RESTORE_LOCATOR: 'snapshotAndRestoreUrl',
DISCOVER_APP_LOCATOR: 'discoverUrl',
OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR: 'logsExplorerUrl',
};
type IdKey = keyof typeof idToUrlMap;

Expand All @@ -75,6 +76,7 @@ shareMock.url.locators.get = (id: IdKey) => ({
});

export const getAppContextMock = (kibanaVersion: SemVer) => ({
dataSourceExclusions: {},
featureSet: {
mlSnapshots: true,
migrateSystemIndices: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

export interface DataStreamsActionMetadata {
excludedActions?: Array<'readOnly' | 'reindex'>;
totalBackingIndices: number;
indicesRequiringUpgradeCount: number;
indicesRequiringUpgrade: string[];
Expand All @@ -14,6 +15,7 @@ export interface DataStreamsActionMetadata {
reindexRequired: boolean;
}

export type DataStreamResolutionType = 'readonly' | 'reindex';
export interface DataStreamsAction {
type: 'dataStream';
metadata: DataStreamsActionMetadata;
Expand All @@ -34,21 +36,22 @@ export interface DataStreamMetadata {
}

export interface DataStreamReindexStatusResponse {
warnings?: DataStreamReindexWarning[];
reindexOp?: DataStreamReindexOperation;
warnings?: DataStreamMigrationWarning[];
migrationOp?: DataStreamMigrationOperation;
hasRequiredPrivileges?: boolean;
}

export type DataStreamReindexWarningTypes = 'incompatibleDataStream';
export type DataStreamWarningTypes = 'incompatibleDataStream' | 'affectExistingSetups';

export interface DataStreamReindexWarning {
warningType: DataStreamReindexWarningTypes;
export interface DataStreamMigrationWarning {
warningType: DataStreamWarningTypes;
resolutionType: DataStreamResolutionType;
meta?: {
[key: string]: string | string[];
};
}

export enum DataStreamReindexStatus {
export enum DataStreamMigrationStatus {
notStarted,
inProgress,
completed,
Expand All @@ -66,31 +69,35 @@ export interface DataStreamProgressDetails {
}

export interface DataStreamReindexStatusNotStarted {
status: DataStreamReindexStatus.notStarted;
status: DataStreamMigrationStatus.notStarted;
}

export interface DataStreamReindexStatusInProgress {
status: DataStreamReindexStatus.inProgress;
reindexTaskPercComplete: number;
resolutionType: 'reindex' | 'readonly';
status: DataStreamMigrationStatus.inProgress;
taskPercComplete: number;
progressDetails: DataStreamProgressDetails;
}

export interface DataStreamReindexStatusCompleted {
status: DataStreamReindexStatus.completed;
reindexTaskPercComplete: number;
resolutionType: 'reindex' | 'readonly';
status: DataStreamMigrationStatus.completed;
taskPercComplete: number;
progressDetails: DataStreamProgressDetails;
}

export interface DataStreamReindexStatusFailed {
status: DataStreamReindexStatus.failed;
resolutionType: 'reindex' | 'readonly';
status: DataStreamMigrationStatus.failed;
errorMessage: string;
}

export interface DataStreamReindexStatusCancelled {
status: DataStreamReindexStatus.cancelled;
resolutionType: 'reindex' | 'readonly';
status: DataStreamMigrationStatus.cancelled;
}

export type DataStreamReindexOperation =
export type DataStreamMigrationOperation =
| DataStreamReindexStatusNotStarted
| DataStreamReindexStatusInProgress
| DataStreamReindexStatusCompleted
Expand Down
Loading