There are follow changes in this patch:
- Using exception ConcurrentTransactions for processing
concurrent transactions during writing metadata.
- wrapper @retry_on_conflict was used for metadata_set method to
allow retrying in the event of a race. The same wrapper was added for
_push_metadata_software_deployments method.
- added new parameter for metadata_set method - merge_metadata.
When RetryRequest exception is raised, oslo_db_api.wrap_db_retry
re-call metadata_set method and in this case we need to refresh
old metadata. It's mostly need for signals without data and id.
For example:
A and B signals come in the same moment and both get number 1,
because metadata was empty. Then during write in db RetryRequest
exception was raised for signal B. Metadata of this signal stores old
number - 1. So we should re-calculate this value using new length
of metadata and set number - 2.
Change-Id: I1ddbad7cde3036cfa9310c670609fcde607ffcac
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
Partially-Bug: #1497274