-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Migrations v2: don't auto-create indices + FTR/esArchiver support #85778
Changes from 31 commits
c91b296
c82a595
cebb9c0
a9a9355
aba78bd
a1a1567
3d76664
2a991a0
2edc8ce
be152a5
f971b3e
46a3f35
30cf7fc
4e71702
bb8dc12
b806398
117e992
7898f0c
55b1461
0387fa3
03b4f1b
b82616d
329b9c6
9baf383
34c5d87
bb4f238
07809d5
4cbda7f
1b2dbd9
e95c441
9cdd1d6
6f8972b
0da675d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [createIndexAliasNotFoundError](./kibana-plugin-core-server.savedobjectserrorhelpers.createindexaliasnotfounderror.md) | ||
|
||
## SavedObjectsErrorHelpers.createIndexAliasNotFoundError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static createIndexAliasNotFoundError(alias: string): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| alias | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`DecoratedError` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [decorateIndexAliasNotFoundError](./kibana-plugin-core-server.savedobjectserrorhelpers.decorateindexaliasnotfounderror.md) | ||
|
||
## SavedObjectsErrorHelpers.decorateIndexAliasNotFoundError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static decorateIndexAliasNotFoundError(error: Error, alias: string): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| error | <code>Error</code> | | | ||
| alias | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`DecoratedError` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [isGeneralError](./kibana-plugin-core-server.savedobjectserrorhelpers.isgeneralerror.md) | ||
|
||
## SavedObjectsErrorHelpers.isGeneralError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static isGeneralError(error: Error | DecoratedError): boolean; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| error | <code>Error | DecoratedError</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`boolean` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,9 @@ export async function migrateKibanaIndex({ | |
*/ | ||
async function fetchKibanaIndices(client: Client) { | ||
const kibanaIndices = await client.cat.indices({ index: '.kibana*', format: 'json' }); | ||
const isKibanaIndex = (index: string) => /^\.kibana(:?_\d*)?$/.test(index); | ||
const isKibanaIndex = (index: string) => | ||
/^\.kibana(:?_\d*)?$/.test(index) || | ||
/^\.kibana(_task_manager)?_(pre)?\d+\.\d+\.\d+/.test(index); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. esArchiver previously didn't handle the task manager index |
||
return kibanaIndices.map((x: { index: string }) => x.index).filter(isKibanaIndex); | ||
} | ||
|
||
|
@@ -103,7 +105,7 @@ export async function cleanKibanaIndices({ | |
|
||
while (true) { | ||
const resp = await client.deleteByQuery({ | ||
index: `.kibana`, | ||
index: `.kibana,.kibana_task_manager`, | ||
body: { | ||
query: { | ||
bool: { | ||
|
@@ -115,7 +117,7 @@ export async function cleanKibanaIndices({ | |
}, | ||
}, | ||
}, | ||
ignore: [409], | ||
ignore: [404, 409], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some tests don't load the task manager index, so we need to ignore it if this index doesn't exist |
||
}); | ||
|
||
if (resp.total !== resp.deleted) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An existing bug. By adding it to the created stats, the
extendEsArchiver
will restore any UiSettings defaults after a test callsemptyKibanaIndex()