forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reindex feature to Upgrade Assistant (elastic#27457)
* Fixup saved objects * WIP reindex state machine * WIP UI * Separate status from current step * Add error messages * Copy types to CallWithInternalUser * Use backend worker * Add progress bar for large indices * Cleanup worker implementation * Add tests for ReindexService * Fix types * Fix CI * Add support for mapping coerced boolean fields * Add basic functional integration test * Cleanup reindexing backend, add more checks * Cleanup frontend code and add tests * Support removal of _default_ mapping + add tests * Add reindex warnings to reindex service * Add confirmation modal for reindex warnings * Cleanup flyout appearance * Generate new index name intelligently * Design tweaks * Show reindex button in both grouping modes * Add data archive integration tests * Change flyout design to two step process * Reorganize flyout files * Use custom steps component * Allow writes to indices if anything fails * Misc cleanup * Design edits * Only show warnings panel when reindex has not begun * Fix types * Handle moving existing aliases * Move integration tests to separate config * Fix ReindexButton bugs when changing pages * Fix polling service tests * Refactor ReindexService and ML handling (backend only) * Add credential caching and paused state to backend * Add paused state to frontend * Fix ts errors * Update copy * Add check for node version before ML step * Update data archive format * Update snapshots for React upgrade * Handle _default_ mappings correctly in warning checks * Use hashed state of reindex operation for credential storage * Address tyler's comments * Add watcher stop/starting * Use json-stable-stringify and sha256 for CredentialStore * Add types for json-stable-stringify
- Loading branch information
Showing
64 changed files
with
5,214 additions
and
125 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,7 @@ | |
"@scant/router": "^0.1.0", | ||
"@slack/client": "^4.8.0", | ||
"@turf/boolean-contains": "6.0.1", | ||
"@types/json-stable-stringify": "^1.0.32", | ||
"angular-resource": "1.4.9", | ||
"angular-sanitize": "1.6.5", | ||
"angular-ui-ace": "0.2.3", | ||
|
@@ -187,6 +188,7 @@ | |
"io-ts": "^1.4.2", | ||
"joi": "^13.5.2", | ||
"jquery": "^3.3.1", | ||
"json-stable-stringify": "^1.0.1", | ||
"jsonwebtoken": "^8.3.0", | ||
"lodash": "npm:@elastic/[email protected]", | ||
"lodash.keyby": "^4.6.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
SavedObject, | ||
SavedObjectAttributes, | ||
} from 'src/server/saved_objects/service/saved_objects_client'; | ||
|
||
export enum ReindexStep { | ||
// Enum values are spaced out by 10 to give us room to insert steps in between. | ||
created = 0, | ||
indexConsumersStopped = 10, | ||
readonly = 20, | ||
newIndexCreated = 30, | ||
reindexStarted = 40, | ||
reindexCompleted = 50, | ||
aliasCreated = 60, | ||
indexConsumersStarted = 70, | ||
} | ||
|
||
export enum ReindexStatus { | ||
inProgress, | ||
completed, | ||
failed, | ||
paused, | ||
} | ||
|
||
export const REINDEX_OP_TYPE = 'upgrade-assistant-reindex-operation'; | ||
export interface ReindexOperation extends SavedObjectAttributes { | ||
indexName: string; | ||
newIndexName: string; | ||
status: ReindexStatus; | ||
lastCompletedStep: ReindexStep; | ||
locked: string | null; | ||
reindexTaskId: string | null; | ||
reindexTaskPercComplete: number | null; | ||
errorMessage: string | null; | ||
mlReindexCount: number | null; | ||
} | ||
|
||
export type ReindexSavedObject = SavedObject<ReindexOperation>; | ||
|
||
export enum ReindexWarning { | ||
allField, | ||
booleanFields, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"upgrade-assistant-reindex-operation": { | ||
"dynamic": true, | ||
"properties": { | ||
"indexName": { | ||
"type": "keyword" | ||
}, | ||
"status": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
x-pack/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.