On some HA database deployments such as MySQL Galera the transaction
locks are optimistic, and if the same data gets modifyed concurrently
DB server may throw a DBDeadlock error which is intended to be handled
by the caller app.
This patch adds appropriate retrying logic into the catalog db api
methods, so the operation to upload, modify or delete the package gets
retryed if the deadlock occurs due to this optimistic locking behavior.
It uses oslo_db_api.wrap_db_retry helper decorator from oslo library.
Closes-Bug: #1502589
Change-Id: I8d7b3dfb02a31eba6d55ba0bf89ac0cf05f1313d