summaryrefslogtreecommitdiff
path: root/oslo_db
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate min_pool_sizeErik Olof Gunnar Andersson2018-04-301-0/+3
| | | | | | | | | | This option has for a long time done nothing in oslo.db and sqlalchemy does not support this convention. As such I recommend that we deprecate and eventually remove the option. Closes-bug: #1764786 Change-Id: Ib07b7b4200b5cf3a34b8eed441e6754da7d446cf
* Merge "Improve exponential backoff for wrap_db_retry"Zuul2018-04-172-7/+90
|\
| * Improve exponential backoff for wrap_db_retryYikun Jiang2018-04-132-7/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The @oslo_db.api.wrap_db_retry is used for db.api methods retrying. If db_error raised, the decorator help us to call the api methods again after a few seconds(accurately, is 2**retry_times seconds). If the db_error is deadlock error, the old wrap_db_retry is not so suitable anymore. As we know, some deadlocks cause because we call some methods(transactions) concurrently. If we only retry after stable 2**retry_times seconds, we will recall the method concurrently again. In order to minimize the chance of regenerating a deadlock and reduce the average sleep time, we propose to add some random jitter to the delay period by default when the deadlock error is detected. Change-Id: I206745708570f1f292529ff58eee9b83fc09a9f2 Closes-bug: #1737869
* | Merge "Ignore 'use_tpool' option"Zuul2018-03-091-4/+4
|\ \
| * | Ignore 'use_tpool' optionStephen Finucane2018-03-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sheer act of registering the 'use_tpool' option seems to be enough to cause the following warning: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported Add it to the list of ignored opts, thus silencing this warning. Change-Id: I4a5f8958c3e0fc68fa3a4ae979f284c4fbd9b82b
* | | Ensure all test fixtures in oslo_db.tests are privateMike Bayer2018-03-0213-54/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Downstream projects have started using the fixtures inside of oslo_db.tests in response to the deprecations added in I0163e637ffef6d45d2573ebe29b5438911d01fce. This was not the intent of these deprecations, so add messsaging to this effect and ensure fixtures used by the test suite itself are noted as private. Change-Id: I3afe0a440a3ab66904aaecf556948df9d4e16b8e
* | | Merge "Imported Translations from Zanata"Zuul2018-03-011-4/+4
|\ \ \
| * | | Imported Translations from ZanataOpenStack Proposal Bot2018-03-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For more information about this automatic import see: https://docs.openstack.org/i18n/latest/reviewing-translation-import.html Change-Id: I8e745e279e295b1b9a42b661d4da2568ce981e7a
* | | | Merge "Conditionally adjust for quoting in comparing MySQL defaults"Zuul2018-03-011-3/+5
|\ \ \ \ | |/ / / |/| | |
| * | | Conditionally adjust for quoting in comparing MySQL defaultsMike Bayer2018-02-221-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB 10.2 appears to not return server defaults with quotes around integer values which breaks the assumption that we have to de-quote server default values. Make the dequoting a regexp that will pass when the quotes are not present. Change-Id: Ie5aeffcc3c550673a7fdd82769a315821cebb272 Closes-bug: #1750414
* | | | Merge "Allow connection query string to be passed separately."Zuul2018-02-204-2/+103
|\ \ \ \ | |/ / / |/| | |
| * | | Allow connection query string to be passed separately.Mike Bayer2018-01-304-2/+103
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nova project has made the decision to store the entire contents of the "sql_connection" field in the database, with alterations to the host value, such that various "cells" database URLs can be located using Nova's database itself as a central registry of database URLs. This architecture has produced several problems. The first is that it is impossible to apply parameters to the URL that are local to the client machine; the leading example of this is the MySQL "bind_host" variable, which must match the hostname of the connecting host. Because cells puts these URLs into the database and shares them with all controllers, we have to use a workaround with the read_default_file parameter to specify a controller-local file of options; this is not a standard thing for other database drivers, and these parameters only apply to the MySQL driver and not the SQLAlchemy engine. The next issue is that it is inconvenient to add parameters to the URL at all, once Nova has already been running, as one must manually use Nova's command line tools to alter all the URLs that have already been copied into the database and alter the query parameters with each of those individually, and then restart *all* services who will all receive the parameter (no way to add params to just one controller). Nova's "store the URL in the database" feature only needs to be able to locate the host / database name of the alternate database, and not change the URL tuning parameters. This patch adds a new oslo.db parameter connection_parameters which allows the params to be applied separately from the sql_connection parameter, so that Nova can continue persisting sql_connection but the parameters remain local to the nova.conf file. A URL parameter that truly had to remain persisted in Nova's database (there aren't any) could still be applied at the sql_connection level. This feature is essential not just so that we can again place simple parameters into controller-local files like "bind_host", but also to allow for configuration of SQLAlchemy features such as plugins that do connection pool monitoring. Change-Id: Id4de4b09ec4719cbf8b372629fcf58cf368a33d4
* | | Reverse role of synchronous_readerMike Bayer2018-01-292-11/+13
|/ / | | | | | | | | | | | | | | | | | | | | Repaired the "synchronous_reader" modifier of enginefacade so that it refers to the "writer" engine when set to True, thereby allowing "synchronous" behavior with the writer. When set to False, this is "asynchronous", so this should be associated with the async engines. The flag had the reverse behavior previously. Change-Id: Id7fea7562ba90eb710176d497af103303f230531 Closes-bug: #1746116
* | Fix a typo of "transaction" in commentwanghui2018-01-181-4/+4
| | | | | | | | Change-Id: I99ca600d4211ef27791465a23100e484a10c323d
* | Merge "Remove function optimize_db_test_loader in test_base.py"Zuul2018-01-053-10/+3
|\ \
| * | Remove function optimize_db_test_loader in test_base.pyzhangyangyang2017-09-073-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | optimize_db_test_loader is replaced by optimize_package_test_loader in test_fixtures.py.So this function is deprecated for removal. Change-Id: I12cdf846f1e23d74ae8a87bea33fbc8477974bfc Closes-Bug:#1715572
* | | add bandit to pep8 jobChangBo Guo(gcb)2017-12-223-8/+14
| |/ |/| | | | | | | | | | | | | Add the bandit security scanner to the pep8 job. * convert assert statement to raise AssertionError * skip B311,B105 Change-Id: I23b2732791f42adfa04bd64f02b25cbdb98aaf93
* | Merge "Remove method get_connect_string and is_backend_avail"4.32.0Zuul2017-12-092-81/+0
|\ \
| * | Remove method get_connect_string and is_backend_availzhangyangyang2017-10-132-81/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method get_connect_string is deprecated and will be removed from oslo_db in a few releases.Please use the provisioning system for dealing with URLs and database provisioning. method is_backend_avail is deprecated and will be removed from oslo_db in a few releases.Please use the provisioning system to access databases based on backend availability. Change-Id: Idc27d45e96aad7b28b4332b0d8ab8c10bca73e67
* | | Merge "Use assertRegex instead of assertRegexpMatches"Zuul2017-12-041-6/+6
|\ \ \
| * | | Use assertRegex instead of assertRegexpMatchesVu Cong Tuan2017-11-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python3, assertRegexpMatches & assertNotRegexpMatches are deprecated in favor of assertRegex and assertNotRegex Change-Id: I35fd27e9618dcc6e229267a9af215ca15a47db69
* | | | Handle deprecation of inspect.getargspecSean McGinnis2017-11-272-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getargspec has been deprecated in py3 with plans to remove it in py3.6. The recommendation is to move to inspect.signature, but the results of that call are different than the existing one. There is also getfullargspec available under py3 that was originally deprecated, but for the sake of handling 2/3 code, it has been un-deprecated. This call uses signature internally, but returns a mostly compatible result with what getargspec did. This handles getargspec deprecation by just using getfullargspec instead if it is available. Change-Id: I32dd29bde99f9d59c2b0e14dd6782162963b43ae
* | | | Merge "Remove kwarg retry_on_request in wrap_db_retry"Zuul2017-11-161-4/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Remove kwarg retry_on_request in wrap_db_retrychenghuiyu2017-10-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Retry on request is always enabled, so the kwarg retry_on_request is deprecated for removal. Change-Id: I9c918828ce9f7075a4e33a6fbadd9613c81fa2eb Closes-Bug: #1714440
* | | | Use skipTest() method instead of deprecated skip()Zane Bitter2017-10-197-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method for skipping a test in unittest is skipTest(). testtools also provides skip(), but that is deprecated. This eliminates the deprecation warnings by switching to the recommended skipTest(). Change-Id: I45da95958e6f65475beab0d7a3c6de6604fa82d7
* | | | Merge "Remove property message for DBInvalidUnicodeParameter and InvalidSortKey"Zuul2017-10-192-25/+0
|\ \ \ \
| * | | | Remove property message for DBInvalidUnicodeParameter and InvalidSortKeysunguangning2017-09-112-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Idace3cbe1ac3c454443d1c786054dc8ff0b0e8b5 Closes-Bug: #1714842
* | | | | Test illegal "boolean" values without Boolean datatypeMike Bayer2017-10-121-1/+13
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust a test that attempts to verify that a CHECK constraint has been dropped to use raw SQL, as the Boolean datatype in SQLAlchemy 1.1 is coercing the target value of "10" to a "1" in any case. Starting with SQLAlchemy 1.2, the Python-side Boolean datatype will also raise an error. Change-Id: I99ffce63f9646323d9e2e3079e52b4829d996ea6
* | | | Merge "Remove provisioned_engine in class BackendImpl"Jenkins2017-10-091-31/+0
|\ \ \ \
| * | | | Remove provisioned_engine in class BackendImplzhangyangyang2017-09-051-31/+0
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | This method is useless in class BackendImpl. So it is deprecated for removal. Change-Id: I3c73acc6b02da731a73880146661b63e75657982 Closes-Bug:#1714778
* | | | Merge "Fix pagination when marker value is None"Jenkins2017-10-082-6/+76
|\ \ \ \
| * | | | Fix pagination when marker value is NoneMehdi Abaakouk2017-09-122-6/+76
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change b3869d04cff7071c1226758eb8b58fde9eba5b8d was fixing #1615938 only for some cases, where the unicity of the row was done by one column. This change fixes it for other cases. Change-Id: I4acb382c770b168f29fa35f02707fb22d402b13b Closes-bug: #1615938
* | | | Add new foreign key utility function to utilsoorgeron2017-09-222-8/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds two new functions: - get_foreign_key_constraint_name() - common function used in subprojects which retrieves the name of a foreign key constraint given table name / column name - suspend_fk_constraints_for_col_alter() - given table name and column name, locates matching foreign key constraints, drops them, yields context, then recreates them as they were. By default only runs for NDB thus avoiding expensive constraint regeneration on other backends. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Co-authored-by: Paul Bourke <paul.bourke@oracle.com> Change-Id: I76c0d82fddf38add0ca05be270264b6e2d043f7f
* | | | Merge "Throw DBMigrationError instead of DbMigrationError."4.27.0Jenkins2017-09-152-4/+4
|\ \ \ \ | |/ / / |/| | |
| * | | Throw DBMigrationError instead of DbMigrationError.Yaguo Zhou2017-09-082-4/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Stop throwing the deprecated DbMigrationError exception, Use the new DBMigrationError exception instead, so that the consumers can catch the new exception. DbMigrationError will not be removed until no consumers still use it. Change-Id: Iab0566cf9f4552e91fa417e64472fa106e8bc86d
* | | Merge "Update the documentation link"Jenkins2017-09-081-1/+1
|\ \ \ | |_|/ |/| |
| * | Update the documentation linkloooosy2017-08-231-1/+1
| |/ | | | | | | | | | | | | This patch is proposed according to the Direction 10 of doc migration(https://etherpad.openstack.org/p/doc-migration-tracking). Change-Id: I6904da7a5f2bd12cf44d047e4b865389e44fb56b
* | Merge "Remove AutoString* in ndb.py"Jenkins2017-09-052-37/+0
|\ \
| * | Remove AutoString* in ndb.pyzhangyangyang2017-09-042-37/+0
| |/ | | | | | | | | | | | | | | Remove AutoString* in ndb.py including AutoStringTinyText,AutoStringText,AutoStringSize. Change-Id: I707d69facb8f4542550243c1b5eff051264f3204 Closes-Bug:#1714913
* | Merge "Remove method provisioned_engine in class Backend"Jenkins2017-09-051-11/+0
|\ \
| * | Remove method provisioned_engine in class Backendzhangyangyang2017-09-031-11/+0
| |/ | | | | | | | | | | | | | | This method is useless in class Backend. So this method is deprecated for removal. Change-Id: I4f2aa180e5506172776ffc6f5e2a0111dacc5594 Closes-Bug:#1714776
* | Merge "Remove class TransactionResource"Jenkins2017-09-051-21/+0
|\ \
| * | Remove class TransactionResourcezhangyangyang2017-09-031-21/+0
| |/ | | | | | | | | | | | | | | | | This class in new edition is useless. So class TransactionResource is deprecated for removal. Change-Id: Ie4155736732a04238f8458aec9ae0d9a0f709ad2 Closes-Bug:#1714765
* | Remove class InsertFromSelectzhangyangyang2017-09-042-158/+0
|/ | | | | | | | | This class in new edtion is useless. So class InsertFromSelect is deprecated for removal. Change-Id: I200486a5a88e78b5223b9364fbea5901048d5cb9 Closes-Bug:#1714768
* Merge "Replace six.iteritems() with .items()"4.26.0Jenkins2017-08-212-5/+4
|\
| * Replace six.iteritems() with .items()liuyamin2017-07-192-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | 1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: If76115f706e9e100a1780471af0f9c5d92d3bc9f
* | Merge "Rename idle_timeout to connection_recycle_time"Jenkins2017-08-216-20/+44
|\ \
| * | Rename idle_timeout to connection_recycle_timeMike Bayer2017-08-156-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "idle_timeout" name and documentation are misleading to users. Rename the option to connection_recycle_time to more closely match that of the underlying SQLAlchemy argument name "pool_recycle", which refers to a time period for which a connection present in the pool for longer than that number of seconds will be closed and replaced with a new one *upon checkout*, to prevent usage of stale connections that may have been closed by server-side reapers. Change-Id: I5e39d5ac81eaa8d85b1dfb18862fe27695ab8b96
* | | Workaround non-compatible type.adapt() for SQLAlchemy < 1.1Mike Bayer2017-08-102-2/+27
|/ / | | | | | | | | | | | | | | | | The ndb change that makes use of String.adapt() to produce a new object breaks on SQLAlchemy < 1.1 because adapt() there does not allow for kwargs to override those already present in the type. Change-Id: I8cc79dc9bebcb3cb3accf76559bc969c2dae7ed9
* | Merge "Replace ndb "auto" types with unified String"Jenkins2017-08-103-62/+119
|\ \