| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Sometimes people just do not need the ORM part and a Session at all.
Mention the fact, that it's possible to ask for a Connection in
enginefacade.
Change-Id: I7a135be7149cd3fa140e0268fea5a17f23f402b2
|
| |
| |
| |
| | |
Change-Id: I627b1fd01d01d79ed4a4fe131f5edec733703635
|
| |
| |
| |
| | |
Change-Id: I30a9d74d90479d8d335dd2e1f097b1fcefd53cf8
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove oslo.db.
Change-Id: I31febfe00698e36f4c2e0e41c3f7bf64acf47adf
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Openstack common has a wrapper for generating uuids. We should
use that function when generating uuids for consistency.
Change-Id: I927609f06e5921e189487160ef46be830e422add
Closes-Bug: #1082248
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This code was initially taken from Nova migrate_repo, the prefix of
'migrate_' in argument 'migrate_engine' makes no sense in this place,
but a little misleading. So we should strip the prefix and use 'engine'
instead.
Change-Id: I6460eca03eb135c98d22d066b57b17907df7237c
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 2ad571c8d7a7e1d8d18f7c5e97c564509fd34816 we have changed the backend
used to cleanup the ModelsMigrationsSync by the one from
oslo_db.sqlalchemy.provision.
But in ModelsMigrationsSync, nothing uses the provisioning system. The
engine can be created outside oslo.db. And oslo.db must must not assume
it have been created by the oslo_db.sqlalchemy.provision module.
For example, 2ad571c8d7a7e1d8d18f7c5e97c564509fd34816 have broken the
Gnocchi models migration test that creates the engine itself.
This change builds a new backend to cleanup all database objects.
Change-Id: Ie8c454528ce3aa816c04fbb4beb69f4b5ec57e9c
Closes-bug: #1647280
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have many cases to check if an index exists on a given columns. Like:
"https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/
migrate_repo/versions/347_add_updated_at_index.py#L30-L37"
In addition, It's very frequent to get all indexes from a table, so we
need a reusable function to avoid duplicate effort.
Change-Id: Iadd9b6ac7586e9b50357ca799eb605f4772e0ece
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds the team's and repository's badges to the README file.
The motivation behind this is to communicate the project status and
features at first glance.
For more information about this effort, please read this email thread:
http://lists.openstack.org/pipermail/openstack-dev/2016-October/105562.html
To see an example of how this would look like check:
b'https://gist.github.com/f4852cbe9049c5a5d7241af3102c88ea\n'
Change-Id: I17dc5cacb22da5f37cbf92095c4144525cd5724b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In I3e238b6a97769cf0a352f11e718d5d73eebcfa8a, we restored
zzzeek's overlooking the fact that legacy test suites assume
new DBs are provisioned by default in the legacy test base.
However, zzzeek also made this same assumption in Neutron
Ie27cf174fa24c2f479af47335d9ae139fb7d159a which vendors its
own version of test_base in anticipation of some of these newer
features, so it will break once the provision_new_database flag
becomes false. Favor setting this flag True/False explicitly
and default it to True for compatibility w/ Neutron.
Change-Id: I726cc20481a9bc778b75564526d9245132b43563
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The test added in I3e238b6a97769cf0a352f11e718d5d73eebcfa8a
will fail if the corresponding backend is not actually
available, because the resources dictionary will be empty.
Add a skip mechanism based on whether or not the DatabaseResource
has backend available or not.
Change-Id: I0ecb4a7ba6531b50c9c3abc6c9c8564b0df54f61
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a fixup for I13c6233cfeb611b1b106eedfc9b57d2af313c46b to
address the remaining comments:
- allow for None values to be passed (as column deleted is nullable)
- document why column deleted is not of type boolean
Change-Id: I04f690f7a1bb8cb14f1e3322643a8cf8bc9c549a
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PostgreSQL is very strict about types and won't perform an automatic
type cast when trying to pass e.g. a boolean `false` value to be
INSERT'ed or UPDATE'ed.
Coerce the value of deleted bound parameter to always be an integer
in the DB layer by adding a custom SQLAlchemy integer type decorator
to make PostgreSQL happy, should someone pass a boolean value for
deleted column (it was meant to be of boolean type, but is integer
instead to allow for Nova use case of shadow tables and compound
unique constraints on something + deleted).
Closes-Bug: #1644513
Change-Id: I13c6233cfeb611b1b106eedfc9b57d2af313c46b
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This unittest-compatible load_tests function was not
well organized for package-level tests and was broken
for module-level usage; as in the case of module-level usage,
the "pattern" parameter was being passed, which was unexpected
since the Python 2.7 documentation for unittest claims it will
be None. However, we are using subunit to run tests, which
uses the unittest2 library that achieves compatibility with
Python 3 - in Python 3, the documentation was changed here
to note that "pattern" may be present (and in fact it is).
Instead, break it into optimize_package_test_loader and
optimize_module_test_loader. The former assumes placement
inside of __init__.py only and the latter assumes placement
inside of a specific module only.
The issue with this function was observed when trying to get
OptimisingTestSuite to work correctly with neutron; tests
would be duplicated due to the double-search. In local testing
it was shown that the function could cause recursion overflows.
It has been observed that using this function at the module level
is of great use when running subsets of tests, since the package-level
load_tests function is not consulted unless the test run is package-wide.
Change-Id: I267fd2fbc16504c11addef870fc8d4fc500da7d9
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SQLAlchemy 1.1 has repaired some of the failure modes
for Session.rollback(), including the MySQL case where the savepoint
identifier gets lost, such that the Session is in a more usable
state than before. A side effect of this is that the test
here in oslo.db only hits a single error handler, not two.
SQLAlchemy upstream is described at:
https://docs.sqlalchemy.org/en/latest/changelog/migration_11.html#improved-session-state-when-a-savepoint-is-cancelled-by-the-database
Change-Id: I324f288701e9ffd241de638e0e0419dc8d9c1264
|
| |/
|/|
| |
| | |
Change-Id: I65eb5fad2269e81c74e2a73e8bbd50b2ed8fb539
|
|/
|
|
|
|
|
|
|
|
| |
Apparentely I0163e637ffef6d45d2573ebe29b5438911d01fce breaks Nova
tests, as we no longer provision a new DB in DatabaseResource by
default. While the recommended way is to use the new fixtures, we
should make sure the original behavior is preserved for the legacy
test cases.
Change-Id: I3e238b6a97769cf0a352f11e718d5d73eebcfa8a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is provided out-of-box by SQLAlchemy versions >= 1.0.0. We've
had this class deprecated in docs for some time now, now do it
properly by the means of debtcollector and a release note.
Closes-Bug: #1439092
Change-Id: I562c35c265014c6b19a81961f236a7a0ca438765
|
| |
| |
| |
| | |
Change-Id: I86d5d8f41a6b51faac74d155472379e8bd34cab1
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The original idea of enginefacade was that applications
would call upon the global _TransactionContextManager
given in oslo_db.sqlalchemy.enginefacade. However, as it
turns out, virtually no Openstack projects seem to be
using that technique, and instead, everyone is creating
their own ad-hoc _TransactionContextManager objects
and usually establishing it as a module-level global.
Nova has two of them.
Additionally, projects add configuration to these
enginefacades (which IS part of the original idea), and
this configuration in some cases is necessary to be present
for tests that run as well, a key example being the
sqlite_fks flag. The original DbFixture integration
provided no way of reusing this configuration.
Finally, projects very much tend to use custom fixtures
in order to define their database communication.
Test classes themselves don't really make use of
oslo_db's DbTestCase anymore.
This patch introduces a modernized fixture system
which, in conjunction with the recent provisioning
patch, addresses these use cases. Applications will typically
create their own subclasses of these fixtures up front
to suit the various testing cases they have, including
SQLite fixed, SQLite ad-hoc, and opportunistic.
In order to accommodate the fixture-based flow
along with the use of testresources for opportunistic
database provisioning, a mixin class OpportunisticDbTestMixin
is still needed when a test needs to use "opportunistic"
testing in order to provide the .resources attribute.
The calculation of .resources is moved into the fixture
system, but because this attribute is consulted before
setUp(), the "opportunistic" fixture must be created
early and stored.
Closes-Bug: #1548960
Change-Id: I0163e637ffef6d45d2573ebe29b5438911d01fce
|
|/ /
| |
| |
| | |
Change-Id: If4eac84ef561183e083a24e67fb14eb793b34db2
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: Idf8159061ff6ff2eaab88f117b1063661a93aeed
|
|/
|
|
|
|
|
|
| |
Replace 'assertTrue(a in b)' with 'assertIn(a, b)'.
Replace 'assertTrue(a not in b)' with 'assertNotIn(a, b)'.
Replace 'assertFalse(a in b)' with 'assertNotIn(a, b)'.
Change-Id: Ifcb490481ed58b0223029cc257b22a53ad0e5a42
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ib8d4e83db6d348e0630e1c60d93424784c20f0a9
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
According to the word choice convention in
http://docs.openstack.org/contributor-guide/writing-style/word-choice.html
We should use OpenStack instead of Openstack.
Change-Id: Iff28b4c60c10f1f320172d20f9d9c41021d48eca
|
|\ \ |
|
| |/
| |
| |
| |
| |
| | |
Use assertIsInstance() instead of assertTrue(isinstance())
Change-Id: I47c75200a8c628779a96563c3982472743cbf4f9
|
|/
|
|
|
|
| |
Set the correct link for home-page.
Change-Id: I45063b8cb3381b1e13b265e0e846d47691fc127c
|
|
|
|
|
|
|
|
|
|
| |
In order to support automatically updating the release notes when we
create stable branches, we want the pages to be in a standard order.
This patch updates the order to be reverse chronological, so the most
recent notes appear at the top.
Change-Id: Ib364dcc8eb31275a31c83b68d7914263b183e393
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Releasenote translation publishing is being prepared. 'locale_dirs'
needs to be defined in conf.py to generate translated version of the
release notes.
Note that this repository might not get translated release notes - or
no translations at all - but we add the entry here nevertheless to
prepare for it.
Change-Id: I723a3e5f79db0e2fe0ff22795a5200391c967bff
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This classifies the error that occurs when
data is inserted that is too long for the
VARCHAR's maximum length.
Related-Bug: #1608849
Change-Id: I6e129d64b7eb68a0057e6b14baa39c72674a1fff
|