summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix marker checking when value is Nonenewton-eol4.13.6stable/newtontengqm2017-04-142-14/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where users sort a table using compound-values sort_key and one of the key has nullable set to True. For example, sorting a table using ['id', 'updated_at'] where 'updated_at' can be None. When marker_value is None, we cannot do value comparison using '<' or '>' operators. This patch adds a check if the value from the marker corresponding to the nullable-key has None value. If that is the case, we skip the comparison. Back to the example above, instead of always getting the following criteria (which doesn't work): (id > MARKER_ID) or (id == MARKER_ID && updated_at > None) <-- failure we will get the following criteria when 'updated_at' is None: (id > MARKER_ID) This is not hurting in any way to existing / legal use cases where callers are expected to include a unique key in sort keys. If there are such cases, this patch is not making things worse because the sorting is already unpredictable. Closes-Bug: #1615938 Change-Id: Iea2cd0bb2556b0b15a0baaa76ef522a3097f9928 (cherry picked from commit b3869d04cff7071c1226758eb8b58fde9eba5b8d)
* Prepare for using standard python testsAndreas Jaeger2017-02-062-0/+61
| | | | | | | | | | | | | | | | | | | Add simple script to setup mysql and postgresql databases, this script can be run by users during testing and will be run by CI systems for specific setup before running unit tests. This is exactly what is currently done by OpenStack CI in project-config. This allows to change in project-config the python-db jobs to python-jobs since python-jobs will call this script initially. See also http://lists.openstack.org/pipermail/openstack-dev/2016-November/107784.html Update CONTRIBUTING.rst for this. Needed-By: Ia298e25f9b15a2dcfc4553ea058fc2c0f3705a8b Change-Id: I825b72e3f645d02f7efdb3315a12825a8c937759 (cherry picked from commit 353ab3904749987841e72846098433fb957936fc)
* Merge "exc_filters: fix deadlock detection for percona xtradb cluster" into ↵4.13.5Jenkins2016-12-152-0/+10
|\ | | | | | | stable/newton
| * exc_filters: fix deadlock detection for percona xtradb clusterRoman Podoliaka2016-12-122-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | percona xtradb cluster server produces an error like: (1213, u'WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction') which is currently not detected properly and, thus, not retried. Closes-Bug: #1648818 Change-Id: Ic43cb0e0946506a4b7ce9f94ee9eba5e025ed3d5 (cherry picked from commit 7c8f0f48bfb941dc1147768493bbaf81bb437d58)
* | Support packet sequence wrong errorMike Bayer2016-12-152-0/+9
|/ | | | | | | | | | | | | | | | | In I484237c28a83783689bb8484152476de33f20e3a, we observed MariaDB-specific error code 1927 as a new kind of disconnect situation. In some failure-mode testing we are also observing with PyMySQL that a stale connection, when it is attempted to be used for the initial ping, does not return any error code but instead trips up PyMySQL with packets sequence numbers (this is an internal value used by the MySQL client/server protocol to track messages). The connection is definitely not recoverable in this state so this also needs to be a disconnect situation so that the ping listener refreshes the connection pool. Change-Id: Iee1c4533e2457acc30e2046b63145c2502012c5f References: https://bugs.launchpad.net/tripleo/+bug/1642944 (cherry picked from commit c61d2d47bd39c31f1cd06faf497ffa85ae66cdd4)
* Support MariaDB error 19274.13.4Mike Bayer2016-11-252-0/+9
| | | | | | | | | | | | | We're observing a MariaDB-specific error code "1927 connection was killed", which seems to indicate the condition where the client/server connectivity is still up but the mariadb server has been restarted. This error needs to be supported as one of the "disconnect" situations so that the ping handler knows to force a reconnect. Change-Id: I484237c28a83783689bb8484152476de33f20e3a References: https://bugs.launchpad.net/tripleo/+bug/1642944 (cherry picked from commit 34f9a3ac7a56883f8a2cd2a9a93bc42e5194bc1e)
* Backport fix exc_filters for mysql-pythonRoman Podoliaka2016-11-252-2/+17
| | | | | | | | | | | | | | | | | | | | | | In order to backport changes to Newton, mysql-python tests need to pass, since it seems that tox.ini is still forcing MySQL tests to use MySQL-Python (not pymysql or mysqlclient at least). The change here re: libmysqlclient is impacting Newton, so backport. Something changed in mysql-python / libmysqlclient or mysql and now exceptions that used to be InternalError's have become OperationalError's. Update filters accordingly to wrap those into oslo.db exceptions properly. OperationalError's are kind of special, as we re-raise them as is due to historical reasons: we need to make sure that at least SAVEPOINT errors are wrapped, as that's what oslo.db and neutron unit tests expect. Closes-Bug: #1630899 Change-Id: I39ea8c4a0dc9d43992f00da7b1ff502595b4dc13 (cherry picked from commit 699933ca01884efe39cfed44946c3d570b5ebbfe)
* Updated from global requirementsOpenStack Proposal Bot2016-09-201-1/+1
| | | | Change-Id: Ie53266903f67fa2e66da7877d652d9f104abcf94
* Add additional caution looking for table, info4.13.3Mike Bayer2016-09-082-9/+37
| | | | | | | | | | | | | | A joined inheritance mapper is mapped to a join(); these have no .info attribute, so use that of the local table instead. The sorting order when querying against a joined subclass table can at least be derived from the base table, so use the base mapper's table. It may be a better idea to comprise the constraints amongst the base table *and* the joined table, though. Change-Id: I9466c9dbbbdc4af10ab0f15ee0f558199973c1ec (cherry picked from commit b19738a13a08f9ff5ac2357060250d121c680163)
* utils: fix get_unique_keys() when model has no table attached to it4.13.2Julien Danjou2016-09-032-12/+60
| | | | | | | | | | | | | | Using the internal SQLAlchemy __table__ to find unique keys on a model class does not work if the model is not attached to a class. In this case, it seems there is no way to find what the keys are: rather than crashing or returning garbage, the function just returns None, indicating it does not know how to get it. The warning from paginate_query() is not emitted in this case, as there's no way to guess if the developer did wrong or not. Change-Id: I1291fe1f1e78471f18f230a66edff31ed199bc7a (cherry picked from commit 49eaed489e4650e56ed2e270ba3e15ce2b421cc8)
* Merge "Update .gitreview for stable/newton" into stable/newtonJenkins2016-09-021-0/+1
|\
| * Update .gitreview for stable/newtonDoug Hellmann2016-08-291-0/+1
| | | | | | | | Change-Id: I61f5ee4eeee8d69b8f23a17f141ca5fb1b82ca59
* | Correctly detect incomplete sort_keys passed to paginate_query4.13.1Ihar Hrachyshka2016-09-012-5/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the function expects that sort_keys will contain 'id', otherwise a warning is triggered. This assumption is wrong in multiple ways. First, models may not have an 'id' attribute. Second, even if the attribute is present, it may be non-unique irrespective of the name chosen for it. The right way of determining sorting keys that would not guarantee stable sorting order for paginated results is to extract sets of unique keys from the model itself, and compare sorting keys to those extracted sets. If at least one of those unique key sets is a subset of passed sorting keys, then no warning should be issued. The patch also add _get_unique_keys function but, in contrast to its Ocata version, does *not* expose it as part of library public API, and makes it explicit it's not part of it, by using the leading underscore in its name. The rationale behind that is that we don't want to expose new features in Newton if possible. The function is a modified version of a function with a similar name (get_unique_keys) currently maintained in Neutron tree for similar needs. To avoid calculating the same result over and over on each call to the new function, we cache it in info dict of the relevant Table. Change-Id: I46d9d53ee5f6fa2863b31027fa81997571d6568a Closes-Bug: #1617996 (cherry picked from commit dea700d13e4c152bf1a484b62cc2bce329ef6fa9)
* | Fix DBReferenceError and DBNonExistentTable with new PyMySQL versionJulien Danjou2016-08-312-40/+17
|/ | | | | | | | | | PyMySQL 0.7.7 changed the string format of the error raised, making oslo.db unable to catch the error: (pymysql.err.IntegrityError) (1452, u'23000Cannot add or update a child row: a foreign key constraint fails (`vaceciqnzs`.`resource_entity`, CONSTRAINT `foo_fkey` FOREIGN KEY (`foo_id`) REFERENCES `resource_foo` (`id`))') [SQL: u'INSERT INTO resource_entity (id, foo_id) VALUES (%(id)s, %(foo_id)s)'] [parameters: {'foo_id': 2, 'id': 1}] Change-Id: Ice7d7767842225951eaf48b71cedb2aabe5a84e4 (cherry picked from commit 1f3d509cab8c5d31f2ecd11561e1117d8c58316e)
* Updated from global requirements4.13.0OpenStack Proposal Bot2016-08-241-1/+1
| | | | Change-Id: I6b366e0918baf7b0ef79ffa1d7bfcbf7b74a2b4a
* Merge "Link enginefacade to test database provisioning"4.12.0Jenkins2016-08-171-27/+109
|\
| * Link enginefacade to test database provisioningMike Bayer2016-08-111-27/+109
| | | | | | | | | | | | | | | | | | | | | | This is part of a series which allows enginefacade to be at the base of database provisioning. Test fixtures are not impacted here, however the global "enginefacade" is used to generate database connections in provision.py Change-Id: I94753ca103851e3fd79c1c6c9773f57e311a0273
* | Updated from global requirementsOpenStack Proposal Bot2016-08-121-1/+1
|/ | | | Change-Id: I785f9994e616c0402370400e8a073a7f1a87161e
* Merge "Display full reason for backend not available"Jenkins2016-08-115-14/+176
|\
| * Display full reason for backend not availableMike Bayer2016-08-085-14/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds to the provisioning system the ability to preserve and re-display the full reason for a particular DB backend not available, and propagates this all the way through the skip() emitted by the OpportunisticTestCase and DbFixture. As part of the change, the database type requested is added to the messages themselves, which also appears in the messages emitted by the consuming is_backend_avail() function, which has tests that check for these explicit messages. New tests specific to the Backend object are added which are not dependent on is_backend_avail(); as this function is deprecated, we will be able to remove its tests at the same time as the function itself with no loss in coverage. Change-Id: I7c00e0770b02aa751e184edfecdec4306de6340c
* | Merge "Fix parameters of assertEqual are misplaced"Jenkins2016-08-1112-123/+122
|\ \
| * | Fix parameters of assertEqual are misplacedyan.haifeng2016-07-2012-123/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many assertEqual sentences don't follow assertEqual(expected, actual), These misplaces have 2 impacts: 1, giving confusing messages when some tests failed. 2, mislead other developers, new test modules may follow these wrong pattern. This patch fix all of them. Change-Id: Ia5155114c60f5e27cb00b8aba6de5cf32e046dd7 Closes-Bug: #1604213
* | | Merge "Add test helpers to enginefacade"Jenkins2016-08-112-2/+235
|\ \ \
| * | | Add test helpers to enginefacadeMike Bayer2016-08-032-2/+235
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Adds new methods make_new_manager(), patch_factory(), patch_engine(), to provide support to test fixtures that wish to generate new managers from an existing one, and to cross-patch managers, factories and engines into other managers. Change-Id: I83c6296d992f08117fff1438bc079bbf71db787b
* | | Merge "Updated from global requirements"Jenkins2016-08-101-1/+1
|\ \ \
| * | | Updated from global requirementsOpenStack Proposal Bot2016-08-081-1/+1
| | | | | | | | | | | | | | | | Change-Id: Ida04673890285af9c0b876c61a88693e6851932d
* | | | Merge "release notes: mention changes in wrap_db_retry()"Jenkins2016-08-101-0/+6
|\ \ \ \
| * | | | release notes: mention changes in wrap_db_retry()Roman Podoliaka2016-07-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just in case mention the changes done in CR #318135, so that people are aware of those (although, we've double checked everyone passes the argument value explicitly now and that's the only reason the decorator actually performs any retries in downstreams). Change-Id: I263b2078535a3f06461e8905003b484a38d05f08
* | | | | Merge "Deprecate argument sqlite_db in method set_defaults"Jenkins2016-08-101-0/+4
|\ \ \ \ \
| * | | | | Deprecate argument sqlite_db in method set_defaultsChangBo Guo(gcb)2016-08-041-0/+4
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is follow up of commit 0a1bae9859079fb21a03716be947c5f1da6db0a2. Log warning when pass keyword argument sqlite_db. Related-Bug: #1329086 Change-Id: Ibed55dc9f28b7813bd96fb5e6f5138de0667591f
* | | | | Merge "Add logging_name to enginefacade config"Jenkins2016-08-102-0/+2
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Add logging_name to enginefacade configMike Bayer2016-08-032-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Propagates logging_name through enginefacade.configure() to create_engine(), as will be used in the enginefacade-based test suite. Change-Id: Iabc03adbef9792e0be4d86c98851890846638efc
* | | | Updated from global requirements4.11.0OpenStack Proposal Bot2016-08-041-1/+1
|/ / / | | | | | | | | | Change-Id: I32efc2a5a5810f915193ab9a49b5ccad74772f0d
* | | Merge "Add a hook to process newly created engines"Jenkins2016-08-032-1/+24
|\ \ \
| * | | Add a hook to process newly created enginesAnn Kamyshnikova2016-07-312-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add on_engine_create argument to transaction_context to enable users to take some actions with newly created engines. Main intended usage is providing oslo.db and osprofiler users with a way to hook them together without making them depend on each other. Closes-bug: #1600739 Change-Id: I78bef4979c2000d05658ce17d0348cd0a10c24d9
* | | | Capture DatabaseError for deadlock check4.10.0Kevin Benton2016-08-022-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pymysql can raise 'lock wait timeout exceeded' errors as InternalErrors. The previous filter was only catching OperationalError exceptions. This patch changes it to catch all DatabaseErrors, which both of the aforementioned exceptions inherit. Change-Id: If7bd1ceef6e5d64f0766b780616388c62862ce82 Closes-Bug: #1608691
* | | | Merge "Updated from global requirements"4.9.0Jenkins2016-07-291-1/+1
|\ \ \ \
| * | | | Updated from global requirementsOpenStack Proposal Bot2016-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I2ec090174889a9539229cfa3775621b39432db6c
* | | | | Merge "Consolidate pifpaf commands into variables"Jenkins2016-07-291-35/+11
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Consolidate pifpaf commands into variablesMike Bayer2016-07-191-35/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the separate per-Python-interpreter setup for the pifpaf run and consolidates necessary variables in one place to be passed into a single command line. Change-Id: I2f34642f16d6dba5b01500fcdc89e88b93642cd3
* | | | | Merge "Memoize sys.exc_info() before attempting a savepoint rollback"Jenkins2016-07-293-5/+116
|\ \ \ \ \
| * | | | | Memoize sys.exc_info() before attempting a savepoint rollbackMike Bayer2016-07-273-5/+116
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | This presents a system of reporting the ultimate "cause" in the case that a MySQL failed SAVEPOINT rollback occurs. Change-Id: Iea834429a0b8398f076b10426525a5c17dbf3c85
* | | | | Updated from global requirementsOpenStack Proposal Bot2016-07-251-1/+1
|/ / / / | | | | | | | | | | | | Change-Id: Ie2e9b0b9507a85e899f68419d0686e03411be2e7
* | | | Updated from global requirementsOpenStack Proposal Bot2016-07-191-1/+1
|/ / / | | | | | | | | | Change-Id: Id85521335990acb47f65181724d6bdbf89d11c8b
* | | Merge "tox: add py35 envs for convenience"Jenkins2016-07-192-2/+14
|\ \ \
| * | | tox: add py35 envs for convenienceRoman Podoliaka2016-07-072-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | py35 jobs are going to be run in the gate soon. Add py35 to the list of defaut envs and add corresponding pifpaf environments for running tests locally. All py35 tests currently pass - we can effectively declare py35 compatibility via a new classifier in setup.cfg. Change-Id: Iea7e286062f95d5c61b9ec1e7f6af4138fe3ce99
* | | | Merge "Set max pool size default to 5"Jenkins2016-07-181-7/+7
|\ \ \ \
| * | | | Set max pool size default to 5Eric Brown2016-07-081-7/+7
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | The max_pool_size defaults to 5 instead of None. Setting this option to 0 effective disables an upper limit to the pool. Change-Id: I9a6918e1a808e9e70105d5b21d901bbe3d298f34
* | | | Updated from global requirementsOpenStack Proposal Bot2016-07-171-1/+1
| | | | | | | | | | | | | | | | Change-Id: I465a02f70301d9927ed8e875b410b22ee3b3d144
* | | | Merge "Remove discover from setup.cfg"Jenkins2016-07-151-1/+0
|\ \ \ \