Skip to content

[Backport 2.x] Block delete model requests if an index uses the model #1745

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

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 1c4a131 from #1722

* Block delete model requests if an index uses the model

Signed-off-by: Ryan Bogan <[email protected]>

* Add test

Signed-off-by: Ryan Bogan <[email protected]>

* Add changelog entry

Signed-off-by: Ryan Bogan <[email protected]>

* Change tests that were deleting a model in use

Signed-off-by: Ryan Bogan <[email protected]>

* Debug

Signed-off-by: Ryan Bogan <[email protected]>

* Add extra check to fix incorrect exception

Signed-off-by: Ryan Bogan <[email protected]>

* Remove println

Signed-off-by: Ryan Bogan <[email protected]>

* Change model_id search from contains to parsing response map

Signed-off-by: Ryan Bogan <[email protected]>

* Remove * import

Signed-off-by: Ryan Bogan <[email protected]>

* Combine delete model exceptions

Signed-off-by: Ryan Bogan <[email protected]>

* Move check to UpdateModelGraveyardTransportAction

Signed-off-by: Ryan Bogan <[email protected]>

* Optimize code logic

Signed-off-by: Ryan Bogan <[email protected]>

* Modify method names and throw exception in outer method

Signed-off-by: Ryan Bogan <[email protected]>

* Add test with cases for UpdateModelGraveyardTransportAction

Signed-off-by: Ryan Bogan <[email protected]>

* Fix spotless

Signed-off-by: Ryan Bogan <[email protected]>

* Refactor code and other minor optimizations

Signed-off-by: Ryan Bogan <[email protected]>

---------

Signed-off-by: Ryan Bogan <[email protected]>
(cherry picked from commit 1c4a131)
ryanbogan
ryanbogan previously approved these changes Jun 11, 2024
@ryanbogan
Copy link
Member

skip-changelog added because the change is going directly in the release notes

VijayanB
VijayanB previously approved these changes Jun 11, 2024
Signed-off-by: Ryan Bogan <[email protected]>
@ryanbogan ryanbogan dismissed stale reviews from VijayanB and themself via 6a02d9a June 11, 2024 22:48
@ryanbogan ryanbogan requested a review from VijayanB June 11, 2024 22:51
@ryanbogan ryanbogan merged commit 0738439 into 2.x Jun 11, 2024
85 of 86 checks passed
@ryanbogan ryanbogan deleted the backport/backport-1722-to-2.x branch June 11, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants