Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…195483) # Backport This will backport the following commits from `main` to `8.15`: - [[Search] Fix issue with crawler not getting deleted (#195440)](#195440) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jedr Blaszyk","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-08T17:30:46Z","message":"[Search] Fix issue with crawler not getting deleted (#195440)\n\n## Summary\r\n\r\nThe bug is that connector doc can be of `elastic-crawler` service type,\r\nwe forgot about this in the logic that handles detaching the index from\r\nconnector upon index delation.\r\n\r\nThis change checks if a connector doc, matching the `index_name` to be\r\ndeleted, is of crawler type:\r\n- If yes, delete the connector (crawler) doc, as crawler is always tied\r\n1:1 to an index\r\n- If no, detach the index, leave the connector doc in the connector\r\nindex\r\n\r\nThis bug was likely introduced as a part of:\r\nhttps://github.com//pull/183833 (some lazy engineer forgot\r\nto test for this edge case ...)\r\n\r\n## Validation\r\n\r\n### Delete Crawler case 1: Delete Crawler deletes crawler doc + related\r\nindex\r\n\r\n\r\nhttps://github.com/user-attachments/assets/68ad14f7-4a7f-408c-8731-6ed0465f9ef1\r\n\r\n### Delete Crawler case 2: Delete crawler-related index deletes crawler\r\ndoc\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e2995697-32c4-4f8f-90ce-9c06c7e6d208","sha":"bf621693f20b012593ec5fcb84c7386da952aeb3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","v8.16.0","backport:version","v8.15.3"],"title":"[Search] Fix issue with crawler not getting deleted","number":195440,"url":"https://github.com/elastic/kibana/pull/195440","mergeCommit":{"message":"[Search] Fix issue with crawler not getting deleted (#195440)\n\n## Summary\r\n\r\nThe bug is that connector doc can be of `elastic-crawler` service type,\r\nwe forgot about this in the logic that handles detaching the index from\r\nconnector upon index delation.\r\n\r\nThis change checks if a connector doc, matching the `index_name` to be\r\ndeleted, is of crawler type:\r\n- If yes, delete the connector (crawler) doc, as crawler is always tied\r\n1:1 to an index\r\n- If no, detach the index, leave the connector doc in the connector\r\nindex\r\n\r\nThis bug was likely introduced as a part of:\r\nhttps://github.com//pull/183833 (some lazy engineer forgot\r\nto test for this edge case ...)\r\n\r\n## Validation\r\n\r\n### Delete Crawler case 1: Delete Crawler deletes crawler doc + related\r\nindex\r\n\r\n\r\nhttps://github.com/user-attachments/assets/68ad14f7-4a7f-408c-8731-6ed0465f9ef1\r\n\r\n### Delete Crawler case 2: Delete crawler-related index deletes crawler\r\ndoc\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e2995697-32c4-4f8f-90ce-9c06c7e6d208","sha":"bf621693f20b012593ec5fcb84c7386da952aeb3"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195440","number":195440,"mergeCommit":{"message":"[Search] Fix issue with crawler not getting deleted (#195440)\n\n## Summary\r\n\r\nThe bug is that connector doc can be of `elastic-crawler` service type,\r\nwe forgot about this in the logic that handles detaching the index from\r\nconnector upon index delation.\r\n\r\nThis change checks if a connector doc, matching the `index_name` to be\r\ndeleted, is of crawler type:\r\n- If yes, delete the connector (crawler) doc, as crawler is always tied\r\n1:1 to an index\r\n- If no, detach the index, leave the connector doc in the connector\r\nindex\r\n\r\nThis bug was likely introduced as a part of:\r\nhttps://github.com//pull/183833 (some lazy engineer forgot\r\nto test for this edge case ...)\r\n\r\n## Validation\r\n\r\n### Delete Crawler case 1: Delete Crawler deletes crawler doc + related\r\nindex\r\n\r\n\r\nhttps://github.com/user-attachments/assets/68ad14f7-4a7f-408c-8731-6ed0465f9ef1\r\n\r\n### Delete Crawler case 2: Delete crawler-related index deletes crawler\r\ndoc\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e2995697-32c4-4f8f-90ce-9c06c7e6d208","sha":"bf621693f20b012593ec5fcb84c7386da952aeb3"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jedr Blaszyk <[email protected]>
- Loading branch information