Skip to content

Commit

Permalink
[Upgrade Assistant] Remove unnecessary mappings for ml snapshots (#15…
Browse files Browse the repository at this point in the history
…1014)

## Summary
Partially addresses #64547
Follow up to #150878

This PR removes unnecessary mappings from the saved objects type
`upgrade-assistant-ml-upgrade-operation. This saved objects are used to
store the resolution progress of ml snapshot deprecations.

Currently, the ml deprecations are disabled via a config for Upgrade
Assistant plugin `xpack.upgrade_assistant.featureSet.mlSnapshots`. And
ES will probably not let us use any old ml snapshots in the 8.x version.

### How to test
1. Add `xpack.upgrade_assistant.featureSet.mlSnapshots: true` to your
`kibana.dev.yml` file
2. Start ES and Kibana with `yarn es snapshot --license=trial` and `yarn
start`
3. Add a sample data set, for example `kibana_sample_data_flights`.
4. Navigate to Analytics -> Machine Learning -> Anomaly Detection ->
Jobs.
5. Create a job for a single metric, chose a time range with some data
in it. Memorize the value you input for job ID.
6. Start and stop the job's datafeed a couple of times, so that you have
more than 1 snapshot. Memorize the value of the snapshot ID.
7. replace `deprecations` on line 22 in the file
[`/server/lib/es_deprecations_status.ts`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/upgrade_assistant/server/lib/es_deprecations_status.ts#L22)
with
```
  const deprecations = {
    cluster_settings: [],
    node_settings: [],
    ml_settings: [
      {
        level: 'critical',
        message:
          'model snapshot [1676291073] for job [test_123] needs to be deleted or upgraded',
        url: '',
        details: 'details',
        _meta: { snapshot_id: '1676291073', job_id: 'test_123' },
        resolve_during_rolling_upgrade: false,
      },
    ],
    index_settings: {},
  };
```
where `job_id` and `snapshot_id` are values from step 5 and 6.
8. open UA and test the resolution of the ml snapshot deprecation.
  • Loading branch information
yuliacech authored Feb 21, 2023
1 parent d41bcb2 commit b132935
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"task": "ebcc113df12f14bf627dbd335ba78507187b48a3",
"telemetry": "561b329aaed3c15b91aaf2075645be3097247612",
"ui-metric": "410a8ad28e0f44b161c960ff0ce950c712b17c52",
"upgrade-assistant-ml-upgrade-operation": "e20ff1efa3c4757f5e7ff5fb897c557b08524c3a",
"upgrade-assistant-ml-upgrade-operation": "d8816e5ce32649e7a3a43e2c406c632319ff84bb",
"upgrade-assistant-reindex-operation": "09ac8ed9c9acf7e8ece8eafe47d7019ea1472144",
"upgrade-assistant-telemetry": "12bcbfc4e4ce64d2ca7c24f9acccd331a2bd2ab6",
"uptime-dynamic-settings": "9a63ce80904a04be114749e426882dc3ff011137",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ export const mlSavedObjectType: SavedObjectsType = {
hidden: false,
namespaceType: 'agnostic',
mappings: {
dynamic: false,
properties: {
nodeId: {
type: 'text',
fields: {
keyword: {
type: 'keyword',
ignore_above: 256,
},
},
},
snapshotId: {
type: 'text',
fields: {
Expand All @@ -33,24 +25,6 @@ export const mlSavedObjectType: SavedObjectsType = {
},
},
},
jobId: {
type: 'text',
fields: {
keyword: {
type: 'keyword',
ignore_above: 256,
},
},
},
status: {
type: 'text',
fields: {
keyword: {
type: 'keyword',
ignore_above: 256,
},
},
},
},
},
};

0 comments on commit b132935

Please sign in to comment.