-
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
[Session Index] Attach alias to index when index name changes #210176
[Session Index] Attach alias to index when index name changes #210176
Conversation
Pinging @elastic/kibana-security (Team:Security) |
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.
A couple questions!
x-pack/platform/plugins/shared/security/server/session_management/session_index.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/security/server/session_management/session_index.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/security/server/session_management/session_index.test.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/security/server/session_management/session_index.ts
Outdated
Show resolved
Hide resolved
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.
LGTM! Thanks for all the info
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
|
Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0 |
…c#210176) Closes elastic#210179 ## Summary While attempting to attach an alias to the session index, we were using `.kibana_security_session_1` as the index name. However, the session index, if upgraded using the Upgrade assistant gets renamed to `.kibana_security_session_1-reindexed-for-9` and `.kibana_security_session_1` is set as an alias pointing to this index. When we try to reattach the alias using this as the index name, ES throws an error. This doesn't affect Kibana functionality but it increases the number of errors thrown in the logs. **This PR corrects this issue by attaching the alias to the index only when alias isn't already present. We now only assign the alias if not present - and not during creation of the index as it is created with the alias in it's settings.** ### Release note Fixes the assignment of the Session index alias by only attaching it if not already present. ## How to test To see the error in the logs, you'll need at least 7.x and 8.x checked out locally. Once done, run bootstrap. #### Step 1: On 7.17 - Start ES with `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start Kibana and login with elastic user - You can check the contents of Kibana session index: ``` GET .kibana_security_session_1/_search { "query": { "match_all": {} } } ``` Should return a single document - You can now shut kibana and ES #### Step 2: on 8.x - Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp` - Start ES as above `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start kibana and login - Navigate to Upgrade assistant. You should see at least 2 System indices that require migration (Security and Kibana) - Start the migrate index process (Step 2 in the UA interface) - Once done, trigger a local restart of kibana either by restarting using the start script or just triggering a file save on any file in your IDE - You should start seeing the error described above in 100ms increments till it reaches 10000ms and then it's every 10 seconds - Navigate to Dev tools and run ``` GET .kibana_security_session/_alias ``` You should see the index as ``` .kibana_security_session_reindexed-for-9 { aliases: { // aliases of the index including kibana_security_session_1 } } ``` #### Verify the fix To verify, we have a couple of options - either clone the PR and go through the same steps as Step 2 above but for 9.0. The easier option is replace the code of function `attachAliasToIndex` in `session_index.ts` in 8.x with the changes in this PR. This should restart your kibana server and you will no longer see the error in the logs. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 45d9fa0)
…c#210176) Closes elastic#210179 ## Summary While attempting to attach an alias to the session index, we were using `.kibana_security_session_1` as the index name. However, the session index, if upgraded using the Upgrade assistant gets renamed to `.kibana_security_session_1-reindexed-for-9` and `.kibana_security_session_1` is set as an alias pointing to this index. When we try to reattach the alias using this as the index name, ES throws an error. This doesn't affect Kibana functionality but it increases the number of errors thrown in the logs. **This PR corrects this issue by attaching the alias to the index only when alias isn't already present. We now only assign the alias if not present - and not during creation of the index as it is created with the alias in it's settings.** ### Release note Fixes the assignment of the Session index alias by only attaching it if not already present. ## How to test To see the error in the logs, you'll need at least 7.x and 8.x checked out locally. Once done, run bootstrap. #### Step 1: On 7.17 - Start ES with `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start Kibana and login with elastic user - You can check the contents of Kibana session index: ``` GET .kibana_security_session_1/_search { "query": { "match_all": {} } } ``` Should return a single document - You can now shut kibana and ES #### Step 2: on 8.x - Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp` - Start ES as above `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start kibana and login - Navigate to Upgrade assistant. You should see at least 2 System indices that require migration (Security and Kibana) - Start the migrate index process (Step 2 in the UA interface) - Once done, trigger a local restart of kibana either by restarting using the start script or just triggering a file save on any file in your IDE - You should start seeing the error described above in 100ms increments till it reaches 10000ms and then it's every 10 seconds - Navigate to Dev tools and run ``` GET .kibana_security_session/_alias ``` You should see the index as ``` .kibana_security_session_reindexed-for-9 { aliases: { // aliases of the index including kibana_security_session_1 } } ``` #### Verify the fix To verify, we have a couple of options - either clone the PR and go through the same steps as Step 2 above but for 9.0. The easier option is replace the code of function `attachAliasToIndex` in `session_index.ts` in 8.x with the changes in this PR. This should restart your kibana server and you will no longer see the error in the logs. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 45d9fa0)
…c#210176) Closes elastic#210179 ## Summary While attempting to attach an alias to the session index, we were using `.kibana_security_session_1` as the index name. However, the session index, if upgraded using the Upgrade assistant gets renamed to `.kibana_security_session_1-reindexed-for-9` and `.kibana_security_session_1` is set as an alias pointing to this index. When we try to reattach the alias using this as the index name, ES throws an error. This doesn't affect Kibana functionality but it increases the number of errors thrown in the logs. **This PR corrects this issue by attaching the alias to the index only when alias isn't already present. We now only assign the alias if not present - and not during creation of the index as it is created with the alias in it's settings.** ### Release note Fixes the assignment of the Session index alias by only attaching it if not already present. ## How to test To see the error in the logs, you'll need at least 7.x and 8.x checked out locally. Once done, run bootstrap. #### Step 1: On 7.17 - Start ES with `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start Kibana and login with elastic user - You can check the contents of Kibana session index: ``` GET .kibana_security_session_1/_search { "query": { "match_all": {} } } ``` Should return a single document - You can now shut kibana and ES #### Step 2: on 8.x - Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp` - Start ES as above `yarn es snapshot --license trial -E path.data=/tmp/esdata` - Start kibana and login - Navigate to Upgrade assistant. You should see at least 2 System indices that require migration (Security and Kibana) - Start the migrate index process (Step 2 in the UA interface) - Once done, trigger a local restart of kibana either by restarting using the start script or just triggering a file save on any file in your IDE - You should start seeing the error described above in 100ms increments till it reaches 10000ms and then it's every 10 seconds - Navigate to Dev tools and run ``` GET .kibana_security_session/_alias ``` You should see the index as ``` .kibana_security_session_reindexed-for-9 { aliases: { // aliases of the index including kibana_security_session_1 } } ``` #### Verify the fix To verify, we have a couple of options - either clone the PR and go through the same steps as Step 2 above but for 9.0. The easier option is replace the code of function `attachAliasToIndex` in `session_index.ts` in 8.x with the changes in this PR. This should restart your kibana server and you will no longer see the error in the logs. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 45d9fa0)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…210176) (#210738) # Backport This will backport the following commits from `main` to `8.18`: - [[Session Index] Attach alias to index when index name changes (#210176)](#210176) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sid","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-12T07:00:21Z","message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","Team:Security","v9.0.0","backport:prev-major","v8.18.0","v9.1.0","v8.19.0"],"title":"[Session Index] Attach alias to index when index name changes","number":210176,"url":"https://github.com/elastic/kibana/pull/210176","mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210176","number":210176,"mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sid <[email protected]>
…210176) (#210739) # Backport This will backport the following commits from `main` to `8.x`: - [[Session Index] Attach alias to index when index name changes (#210176)](#210176) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sid","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-12T07:00:21Z","message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","Team:Security","v9.0.0","backport:prev-major","v8.18.0","v9.1.0","v8.19.0"],"title":"[Session Index] Attach alias to index when index name changes","number":210176,"url":"https://github.com/elastic/kibana/pull/210176","mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210176","number":210176,"mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sid <[email protected]>
…210176) (#210740) # Backport This will backport the following commits from `main` to `9.0`: - [[Session Index] Attach alias to index when index name changes (#210176)](#210176) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sid","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-12T07:00:21Z","message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","Team:Security","v9.0.0","backport:prev-major","v8.18.0","v9.1.0","v8.19.0"],"title":"[Session Index] Attach alias to index when index name changes","number":210176,"url":"https://github.com/elastic/kibana/pull/210176","mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210176","number":210176,"mergeCommit":{"message":"[Session Index] Attach alias to index when index name changes (#210176)\n\nCloses https://github.com/elastic/kibana/issues/210179\r\n\r\n## Summary\r\n\r\nWhile attempting to attach an alias to the session index, we were using\r\n`.kibana_security_session_1` as the index name. However, the session\r\nindex, if upgraded using the Upgrade assistant gets renamed to\r\n`.kibana_security_session_1-reindexed-for-9` and\r\n`.kibana_security_session_1` is set as an alias pointing to this index.\r\nWhen we try to reattach the alias using this as the index name, ES\r\nthrows an error. This doesn't affect Kibana functionality but it\r\nincreases the number of errors thrown in the logs.\r\n\r\n**This PR corrects this issue by attaching the alias to the index only\r\nwhen alias isn't already present. We now only assign the alias if not\r\npresent - and not during creation of the index as it is created with the\r\nalias in it's settings.**\r\n\r\n### Release note\r\nFixes the assignment of the Session index alias by only attaching it if\r\nnot already present.\r\n\r\n## How to test\r\n\r\nTo see the error in the logs, you'll need at least 7.x and 8.x checked\r\nout locally. Once done, run bootstrap.\r\n\r\n#### Step 1: On 7.17\r\n- Start ES with `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start Kibana and login with elastic user\r\n- You can check the contents of Kibana session index:\r\n\r\n```\r\nGET .kibana_security_session_1/_search\r\n{\r\n \"query\": {\r\n \"match_all\": {}\r\n }\r\n}\r\n```\r\nShould return a single document\r\n- You can now shut kibana and ES\r\n\r\n\r\n#### Step 2: on 8.x\r\n- Make a backup of the esdata above `cp -r /tmp/esdata /tmp/esdatabkp`\r\n- Start ES as above `yarn es snapshot --license trial -E\r\npath.data=/tmp/esdata`\r\n- Start kibana and login\r\n- Navigate to Upgrade assistant. You should see at least 2 System\r\nindices that require migration (Security and Kibana)\r\n- Start the migrate index process (Step 2 in the UA interface)\r\n- Once done, trigger a local restart of kibana either by restarting\r\nusing the start script or just triggering a file save on any file in\r\nyour IDE\r\n- You should start seeing the error described above in 100ms increments\r\ntill it reaches 10000ms and then it's every 10 seconds\r\n- Navigate to Dev tools and run\r\n```\r\nGET .kibana_security_session/_alias\r\n```\r\nYou should see the index as \r\n```\r\n.kibana_security_session_reindexed-for-9 {\r\n aliases: {\r\n // aliases of the index including kibana_security_session_1\r\n }\r\n}\r\n```\r\n\r\n#### Verify the fix\r\nTo verify, we have a couple of options - either clone the PR and go\r\nthrough the same steps as Step 2 above but for 9.0. The easier option is\r\nreplace the code of function `attachAliasToIndex` in `session_index.ts`\r\nin 8.x with the changes in this PR. This should restart your kibana\r\nserver and you will no longer see the error in the logs.\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"45d9fa01feaba65d433473519215982c5a600947"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sid <[email protected]>
Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0 |
Closes #210179
Summary
While attempting to attach an alias to the session index, we were using
.kibana_security_session_1
as the index name. However, the session index, if upgraded using the Upgrade assistant gets renamed to.kibana_security_session_1-reindexed-for-9
and.kibana_security_session_1
is set as an alias pointing to this index. When we try to reattach the alias using this as the index name, ES throws an error. This doesn't affect Kibana functionality but it increases the number of errors thrown in the logs.This PR corrects this issue by attaching the alias to the index only when alias isn't already present. We now only assign the alias if not present - and not during creation of the index as it is created with the alias in it's settings.
Release note
Fixes the assignment of the Session index alias by only attaching it if not already present.
How to test
To see the error in the logs, you'll need at least 7.x and 8.x checked out locally. Once done, run bootstrap.
Step 1: On 7.17
yarn es snapshot --license trial -E path.data=/tmp/esdata
Should return a single document
Step 2: on 8.x
cp -r /tmp/esdata /tmp/esdatabkp
yarn es snapshot --license trial -E path.data=/tmp/esdata
You should see the index as
Verify the fix
To verify, we have a couple of options - either clone the PR and go through the same steps as Step 2 above but for 9.0. The easier option is replace the code of function
attachAliasToIndex
insession_index.ts
in 8.x with the changes in this PR. This should restart your kibana server and you will no longer see the error in the logs.Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:*
label is applied per the guidelines