tripleo-heat-templates/docker
Michele Baldessari 187dba22b9 Fix gnocchi-upgrade Table <..> already exists errors
Currently we are calling /usr/bin/gnocchi-upgrade
--sacks-number=SACK_NUM from each node where gnocchi-api is part of the
role. gnocchi-upgrade seems to be racy and we sometimes end up with the
following error:

2018-03-14 12:39:39,683 [1] ERROR    oslo_db.sqlalchemy.exc_filters: DBAPIError exception wrapped from (pymysql.err.InternalError) (1050, u"Table 'archive_policy' already exists") [SQL: u'\nCREATE TABLE archive_policy (\n\tname VARCHAR(255) NOT NULL, \n\tback_window INTEGER NOT NULL, \n\tdefinition TEXT NOT NULL, \n\taggregation_methods TEXT NOT NULL, \n\tPRIMARY KEY (name)\n)ENGINE=InnoDB CHARSET=utf8\n\n']
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 166, in execute
    result = self._query(query)
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 856, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1057, in _read_query_result
    result.read()
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1340, in read
    first_packet = self.connection._read_packet()
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1014, in _read_packet
    packet.check_error()
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
InternalError: (1050, u"Table 'archive_policy' already exists")

Let's run it from a the bootstrap node by wrapping it into the
bootstrap_host_exec magic.

Change-Id: I106512eeffff3425608a543f9bc5e6a9508d15e5
Closes-Bug: #1755564
(cherry picked from commit 1d704d4733)
2018-03-15 14:31:31 +01:00
..
services Fix gnocchi-upgrade Table <..> already exists errors 2018-03-15 14:31:31 +01:00
README-containers.md Replace outdated instruction with link to upstream doc 2017-07-10 16:32:58 +02:00
docker-puppet.py Improve debugging possibilities for docker-puppet.py time handling 2018-02-12 16:56:40 +01:00
docker-toool Merge "Add detach to docker-toool" 2017-06-30 03:52:38 +00:00