RETIRED, further work has moved to Debian project infrastructure
Go to file
Julien Danjou 0d268f5df8 Revert "indexer: catch another mysql exception"
This reverts commit 2361401694.

This fix is not the correct one. This kind of backtrace actually happens:

Traceback (most recent call last):
  File "gnocchi/tests/base.py", line 55, in skip_if_not_implemented
    return func(*args, **kwargs)
  File "gnocchi/tests/test_indexer.py", line 814, in test_list_resources_without_history
    details=True)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/oslo_db/api.py", line 151, in wrapper
    ectxt.value = e.inner_exc
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
    self.force_reraise()
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
    six.reraise(self.type_, self.value, self.tb)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/oslo_db/api.py", line 139, in wrapper
    return f(*args, **kwargs)
  File "gnocchi/indexer/sqlalchemy.py", line 1050, in list_resources
    all_resources.extend(q.all())
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2638, in all
    return list(self)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2790, in __iter__
    return self._execute_and_instances(context)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2813, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1389, in _handle_dbapi_exception
    util.raise_from_cause(newraise, exc_info)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/cursors.py", line 166, in execute
    result = self._query(query)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/connections.py", line 835, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/connections.py", line 1019, in _read_query_result
    result.read()
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/connections.py", line 1302, in read
    first_packet = self.connection._read_packet()
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/connections.py", line 981, in _read_packet
    packet.check_error()
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/jenkins/workspace/gate-gnocchi-tox-db-py27-mysql-ubuntu-xenial/.tox/py27-mysql/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
oslo_db.exception.DBError: (pymysql.err.InternalError) (1412, u'Table definition has changed, please retry transaction') [SQL: u'SELECT resource.creator AS resource_creator, resource.started_at AS resource_started_at, resource.revision_start AS resource_revision_start, resource.ended_at AS resource_ended_at, resource.user_id AS resource_user_id, resource.project_id AS resource_project_id, resource.original_resource_id AS resource_original_resource_id, rt_19d8ff7b16a44b85b5f274521cf609f2.id AS rt_19d8ff7b16a44b85b5f274521cf609f2_id, resource.id AS resource_id, resource.type AS resource_type, rt_19d8ff7b16a44b85b5f274521cf609f2.col1 AS rt_19d8ff7b16a44b85b5f274521cf609f2_col1, archive_policy_1.name AS archive_policy_1_name, archive_policy_1.back_window AS archive_policy_1_back_window, archive_policy_1.definition AS archive_policy_1_definition, archive_policy_1.aggregation_methods AS archive_policy_1_aggregation_methods, metric_1.id AS metric_1_id, metric_1.archive_policy_name AS metric_1_archive_policy_name, metric_1.creator AS metric_1_creator, metric_1.resource_id AS metric_1_resource_id, metric_1.name AS metric_1_name, metric_1.unit AS metric_1_unit, metric_1.status AS metric_1_status \nFROM resource INNER JOIN rt_19d8ff7b16a44b85b5f274521cf609f2 ON resource.id = rt_19d8ff7b16a44b85b5f274521cf609f2.id LEFT OUTER JOIN metric AS metric_1 ON resource.id = metric_1.resource_id AND metric_1.status = %(status_1)s LEFT OUTER JOIN archive_policy AS archive_policy_1 ON archive_policy_1.name = metric_1.archive_policy_name \nWHERE rt_19d8ff7b16a44b85b5f274521cf609f2.id IN (%(id_1)s)'] [parameters: {u'id_1': bytearray(b'hG\xd3J\xeadOM\xackb\x9fKb\xe4s'), u'status_1': 'active'}]

which is not a ProgrammingError and which means we need a global decorator to
catch it.

Change-Id: I65fdfba31c0c282e23190ceb3daadbaa2a0c0dbf
2017-01-26 20:52:09 +01:00
devstack Add gnocchi-config-generator 2017-01-11 19:13:41 +01:00
doc/source allow required=True when patching resource type 2017-01-25 07:34:48 +01:00
gnocchi Revert "indexer: catch another mysql exception" 2017-01-26 20:52:09 +01:00
releasenotes/notes allow required=True when patching resource type 2017-01-25 07:34:48 +01:00
tools tools: import a small tools to compute size of archive policies 2017-01-03 14:40:07 +01:00
.gitignore Enable releasenotes documentation 2016-05-26 09:34:33 +00:00
.gitreview Update .gitreview for project rename 2015-03-28 00:20:35 +00:00
.testr.conf Adjust testr group_regex to not group on 'prefix' 2017-01-02 14:15:45 +00:00
LICENSE Add missing License file 2015-05-15 14:37:04 -04:00
MANIFEST.in Revert "Remove the file named MANIFEST.in" 2016-10-11 12:26:44 +02:00
README.rst Make the content of PKG-INFO can be decoded 2016-03-07 14:38:06 +08:00
bindep.txt Add simple upgrade tests 2016-09-22 09:11:27 +02:00
requirements.txt Update Pandas requirements to 0.18 2017-01-23 16:20:42 +01:00
run-tests.sh run-tests: use case rather than if/elif/else 2017-01-03 14:07:19 +01:00
run-upgrade-tests.sh Remove workaround to upgrade from 2.2.0 2017-01-18 16:29:44 +01:00
setup.cfg Merge "Introduce "basic" authentication mechanism" 2017-01-16 14:06:08 +00:00
setup.py Import 2014-05-07 12:04:37 +02:00
tox.ini Remove non-existent -all suffix in tox targets 2017-01-20 16:57:12 +01:00

README.rst

Gnocchi - Metric as a Service

image

Gnocchi is a multi-tenant timeseries, metrics and resources database. It provides an HTTP REST interface to create and manipulate the data. It is designed to store metrics at a very large scale while providing access to metrics and resources information to operators and users.

Gnocchi is part of the OpenStack project. While Gnocchi has support for OpenStack, it is fully able to work stand-alone.

You can read the full documentation online at http://gnocchi.xyz.