canonical / opensearch-operator

OpenSearch operator
Apache License 2.0
12 stars 7 forks source link

fix_ha_storage_test #491

Closed reneradoi closed 1 month ago

reneradoi commented 1 month ago

Issue

Currently the integration test for re-using storage fails occasionally. This is because in one of the tests we remove the application, keeping the storage disks and re-attaching them to a new application. This can lead to stale metadata, as described in our docs, which will cause the Opensearch service to fail on startup.

Solution

Adjust the integration test workflow to first scale down to one remaining unit before removing the application. This will cause the remaining unit to become the leader, if it wasn't already. Removing the application now and later re-attaching this units' storage disk to the new leader means that we can start up Opensearch correctly.