The current implementation of Cinder API functionality supports deleting of multiple volume metadata as multiple requests for deleting only one metadata key with a request. The more keys are necessary to remove, the more API requests and DB queries are needed. It would be more efficient to delete multiple metadata keys with a single request at a time.
Deleting multiple volume metadata keys with a single request.
To delete multiple metadata items without affecting the remaining ones, just update the metadata items with the updated complete list of ones (without items to delete) in the body of the request. On success, the server responds with a 200 status code.
A PUT request should use etags to avoid the lost update problem.
Have a request that deletes all keys rather than a specified list as an option.
The existing API for update metadata will be used in this case. The API call will fail in the case some of the items that are specified to delete does not exist. The API call will send the set of keys that are supposed to be updated and ignore missing keys.
One delete notification will be emitted per metadata item deleted as today.
A user will have new API.
The deleting of a volume metadata keys with a single request allows to improve performance by reducing DB calls. It’s very important in case with many keys. Better performance due to fewer request round trips.
Unit and functional tests are needed to ensure response is working correctly.
Documents concerning the API will need to reflect these changes.