summaryrefslogtreecommitdiff
path: root/oslo_db/options.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix default value for wsrep_sync_wait option12.3.1Ayumu Ueha2023-01-181-1/+2
| | | | | | | | | | The default value for wsrep_sync_wait option should be `None`. However, since 0 is set incorrectly, an unintended process is executed. This patch fixes default value for wsrep_sync_wait option to `None` instead of `0`. Change-Id: Ifb1dc7ddcb127a69ea01234922caa7ca5ab111ce
* Add option for wsrep_sync_waitMike Bayer2022-12-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Galera, the wsrep_sync_wait option [1] can change the behavior of a variety of Galera DQL/DML statements such that a particular operation will pause until outstanding write-sets are fully persisted to the local node. The setting supersedes the previous boolean parameter wsrep_causal_reads which only affected SELECT, with an updated approach that allows for fine-grained control of so-called "causality checks" on individual statement types. The legacy-compatible setting of '1' indicates that READ/SELECT/BEGIN operations should proceed only after any pending writesets are fully available. The use case for this setting is for an application that is running operations on multiple Galera nodes simultaenously. An application that commits data on one node, and then immediately uses a different connection (on a potentially different node) to SELECT that data, may fail to see those changes if "causality checks" for SELECT are not enabled. While a COMMIT operation in Galera will block locally until all other nodes approve of the writeset, the operation does not block for the subsequent period of time when other nodes are actually persisting that writeset. Setting up "causal reads" in this case indicates that a SELECT operation will wait until any writesets in progress are available, thus maintaining serialization between the COMMIT and subsequent SELECT. As the name implies, wsrep_sync_wait adds...waiting! to the operation, and thus directly impacts performance by adding latency to SELECT operations or to the operations that have been selected for causality checks, to the degree that concurrent writesets are expected to be present. Since it's not expected that most if any Openstack applications actually need this setting in order to be effective with Galera multi-master operation, and as the setting is available within client session scope and also impacts performance, making it available on a per-application basis means that specific applications which may see issues under load can choose to enable this setting, much in the way any other "transaction isolation" settings might be made, without having to add a cluster-wide performance penalty by setting it at the Galera server level. [1] https://mariadb.com/docs/ent/ref/mdb/system-variables/wsrep_sync_wait/ Change-Id: Iee7afcac8ba952a2d67a9ad9dd0e4eae3f42518e
* Deprecate MySQL NDB Cluster SupportStephen Finucane2022-07-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | Traditionally, the MySQL support in oslo.db has assumed use of the InnoDB storage engine. However, this isn't the only storage engine available and a few years ago an effort was made to add support for another storage engine, MySQL Cluster (NDB). The oslo.db aspects of this effort were tracked via bug 1564110 [1] and from reading this bug and looking at other patches related to this effort [2], it becomes obvious that this was never seen through to the completion and the OpenStack-wide effort never took off [3]. As a result, much of what is here is in-effect dead code now. Given no one is using this engine, there's no reason to keep it around. Deprecate it with an eye on removing it sooner rather than later. [1] https://bugs.launchpad.net/oslo.db/+bug/1564110 [2] https://review.opendev.org/q/owner:octave.orgeron%2540oracle.com [3] https://review.opendev.org/c/openstack/openstack-specs/+/429940 Change-Id: Id5ddf1d6f47b8a572001f58ad8b9b8a7dbe4e8ac Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
* trivial: Formatting changes for oslo_db.optionsStephen Finucane2022-07-141-112/+182
| | | | | Change-Id: Iad89a0564b7851d75703f769c6eb96fbfe9a1e97 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
* Remove the idle_timeout option.Daniel Bengtsson2021-06-231-12/+0
| | | | | | | | | | The option was replaced 4 years ago[1] by connection_recycle_time. The option is not anymore present in sqlalchemy. It's the good time to remove it. [1] https://opendev.org/openstack/oslo.db/commit/6634218415906192fca891362b8fa0ac50b66284 Change-Id: I0c26c3e14ad9ad9a4f30af80757e369d6042441a
* Remove the sql_max_pool_size option.Daniel Bengtsson2021-04-261-4/+0
| | | | | | | | The option was replaced 6 years ago[1] by max_pool_size. [1] https://opendev.org/openstack/oslo.db/commit/1b7c295d522e26aa8bf09242dcc1355c3fb1ab3e Change-Id: Ice1a90edc32603c85449b80fe78fd437aa7e8081
* Removing deprecated min_pool_sizeErik Olof Gunnar Andersson2019-04-061-11/+0
| | | | | | | | | | The database option min_pool_size is not actually used in oslo.db. This is a folllow up to Ib07b7b4200b5cf3a34b8eed441e6754da7d446cf Change-Id: I89754e9e4b42c45259729b0b0bb0a4bf464a981c
* 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
* Allow connection query string to be passed separately.Mike Bayer2018-01-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename idle_timeout to connection_recycle_timeMike Bayer2017-08-151-9/+19
| | | | | | | | | | | | | 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
* Enable MySQL Storage Engine selectionoorgeron2017-06-261-0/+4
| | | | | | | | Enables new functionality for selecting InnoDB or MySQL Cluster as a DB storage backend in OpenStack services. Closes-Bug: 1564110 Change-Id: I9f1fd2a87fdf75332de2339d3ff4f08ce9220dcf
* Remove deprecated config option sqlite_dbChangBo Guo(gcb)2017-03-241-19/+2
| | | | | | | | | | | | | | We deprecated config options sqlite_db in July, 2016 [1], and it shows up in many projects' config files but these projects don't use it either, so it's confusing to our users. It's time to remove it, just use config option connection or slave_connection to connect to the database. [1] https://review.openstack.org/#/c/338047/ Closes-Bug: #1329086 Change-Id: Id269d921e40edf95eb977b011f1753f633b79d18
* 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 "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
* | Set a min and max on the connection_debug optionEric Brown2016-07-091-0/+1
|/ | | | | | | There is a set allowable minimum and maximum to the connection_debug option of 0 and 100. The config option should enforce this. Change-Id: Ica610ad8fc0875a8be1042f7daba5d0a0c1aad03
* Deprecate config option sqlite_db for removalChangBo Guo(gcb)2016-07-061-0/+3
| | | | | | | | | | We should use config option connection or slave_connection to connect to the database. We can remove it when all consuming projects don't use it anymore. Related-Bug: #1329086 Change-Id: I1960e47b27b5f98f19a07f9899079269bac025cc
* Increase the default max_overflow valueRoman Podoliaka2016-02-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turned out that distribution of WSGI requests between forks is not even when eventlet is used, which can cause pool timeout issues under load, while there are idle workers with open DB connections, which should have served these HTTP requests. The default max_overflow value should be increased to allow DB oriented services (mostly APIs) handle spikes in number of concurrent requests trying to use a DB. At the same time, the default number of greenlets is decreased: I65b40b9906b75146a0085bbe168f1e6bcae82f21 which effectively causes a particular worker to stop accepting new requests it has no resources (DB connections) to handle and allow other forks accept()'ing on the same FD to proceed. Testing was performed using this script: https://gist.github.com/zzzeek/c69138fd0d0b3e553a1f With 100 greenthreads in the pool, 50 DB connections allowed overflow no pool timeout issues were seen with up to 500 concurrent requests done by ab, while current default values (1000/10) could not handle even 100 concurrent requests. See this ML thread for details: http://lists.openstack.org/pipermail/openstack-dev/2015-December/082717.html DocImpact This change potentially increases the number of connections open to the RDBMS server. If you start seeing "too many connections" errors, please check these settings and adjust them appropriately: https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_connections http://www.postgresql.org/docs/current/static/runtime-config-connection.html#GUC-MAX-CONNECTIONS Closes-Bug: #1535375 Change-Id: I2e9c2a71d8231e0dfbefc6293ad319e1e459beec
* stop making a copy of options discovered by config generatorDoug Hellmann2016-02-101-3/+1
| | | | | | | | | | In order for the config generator's new hook for updating default values to work, we have to return the same Opt objects from list_opts() that our set_defaults() function is going to modify. There's no real need to be making copies of the objects anyway, so just stop doing it. Change-Id: I62c2f733f1e7943449aa744ed15dac4addb3e1f7 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* Fix warnings in docstringsBrant Knudson2015-09-241-3/+3
| | | | | | | | | When generating the docs some warnings were generated. Also, configure doc build so that if there are warnings, the build will fail. Change-Id: I7e10499294cf1f06f766cbff392e9de32ea48e5a
* Merge "Retry query if db deadlock error is received"Jenkins2015-01-271-5/+7
|\
| * Retry query if db deadlock error is receivedrossella2015-01-141-5/+7
| | | | | | | | | | | | | | | | | | Add a decorator retry_on_deadlock(). All db.api functions marked with this decorator will be retried if a DBDeadlock exception is received. Change-Id: I3488bfec67ec1c563292f1b61a7a9697f118809c Closes-bug: 1348588
* | Update Oslo imports to remove namespace packageDoug Hellmann2015-01-211-1/+1
|/ | | | | Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d Blueprint: drop-namespace-packages
* Move files out of the namespace packageDoug Hellmann2014-12-241-0/+220
Move the public API out of oslo.db to oslo_db. Retain the ability to import from the old namespace package for backwards compatibility for this release cycle. Blueprint: drop-namespace-packages Change-Id: Ie96b482b9fbcb1d85203ad35bb65c1f43e912a44