Merge "MariaDB: avoid synchronization in state configmap updates"

This commit is contained in:
Zuul 2020-03-13 21:14:11 +00:00 committed by Gerrit Code Review
commit 6228f5e958

View File

@ -327,6 +327,10 @@ def safe_update_configmap(configmap_dict, configmap_patch):
# This status code indicates a collision trying to write to the # This status code indicates a collision trying to write to the
# config map while another instance is also trying the same. # config map while another instance is also trying the same.
logger.warning("Collision writing configmap: {0}".format(error)) logger.warning("Collision writing configmap: {0}".format(error))
# This often happens when the replicas were started at the same
# time, and tends to be persistent. Sleep briefly to break the
# synchronization.
time.sleep(1)
return True return True
else: else:
logger.error("Failed to set configmap: {0}".format(error)) logger.error("Failed to set configmap: {0}".format(error))