Zaqar will support query queues with 'with_count' to
return the amount of the queues. This will help users to
quickly get the exact total number of queues which they own.
Change-Id: I1d2cdc802ecd76c01671cd5660ae79dd39505d43
Implements: blueprint query-queues-with-count
Signed-off-by: wanghao <sxmatch1986@gmail.com>
This patch will support to query queues filtered by
name and metadata in mongodb backend.
Other backends will support in following patchs.
Co-Authored-By: gecong <ge.cong@zte.com.cn>
Change-Id: I5fc6a5959e5d94942aebce9cedb22666e5577cb8
Partial-implements: blueprint queue-filter-support
The use of plain SQLAlchemy create_engine in Zaqar bypasses
lots of oslo_db features that are associated with its
version of create_engine, some useful and some critical.
Among favorable behaviors that are added:
* The SQLite PRAGMA FOREIGN KEYS call is abstracted into the
sqlite_fk flag
* The engine is given a pessimistic "ping" event, which emits
a "SELECT 1" upon connection checkout which will then recycle
the connection if the backing database is no longer connected.
As we are using a connection pool, if the database has been
restarted, or in the case of MySQL a default timeout of eight
hours idle has passed, existing pooled connections will be stale.
Upcoming SQLAlchemy 1.2 includes this feature as a simple flag
but for now, oslo_db implements the event listener as directed
by SQLA docs
* The errors raised by the DBAPI, and then wrapped by SQLAlchemy,
are further sub-classified. In particular, Zaqar seems to use
a lot of IntegrityError catches to detect duplicate entry and
foreign key constraint conditions. oslo_db parses these out on
a per-database-basis into individual DBDuplicateEntry,
DBReferenceError, and other error classes, allowing Zaqar to
respond specifically to the sub-class of IntegrityError or
allow it to propagate if the condition is unhandled.
* checks for MySQL SQL_MODE and best practice driver (pymysql)
will emit warnings if these conditions are not met.
* Gets Zaqar ready for further oslo.db integration and guides
new features into oslo_db, including a potential "mysql timezone"
setting
Change-Id: I16c3ed89e006e132bbd0295be1dfd0b561b2037c
Resolves-bug: https://bugs.launchpad.net/tripleo/+bug/1691951
Bring back the sqlalchemy unittests and fix all the bugs required to
make the tests pass.
Closes-bug: #1490450
Change-Id: Ibfa1a3ff372ce3e4a98a532798113013d3c1dec1
When using sql as the management plane and get queue, user
will run into 503 error since we're using self.driver.get,
but unfortunately, there is no get() method in sqlalchemy's
ControlDriver. This patch fixes the issue by using run()
instead of get().
Closes-Bug: #1489701
Change-Id: I064e123eae3617861804092f4f7a1b194a5ec136
To separate data and control plane of storage layer;
Moving queue_controller from data to controll plane.
Trying to shift the QueueController object in Control plane.
For this new MessageQueueHandler class is also added inside storage/x/messages.py
And the newly added handler is added to the entry point.
Implements: blueprint split-data-and-control-plane
Co-Author: Flavio Percoco<flavio@redhat.com>
Change-Id: I8a167d6ed8e54c98b077b9ea56e68b4e8d5b0291
In order to be able to move some validations and general checks, that are
currently done in the transport, down to the storage layer, we need to
wrap the methods being overloaded with other methods that are defined in
the base class. This will allow us to add logic before and after the
actual method call if needed.
This is the first patch of a series of patches that will update all the
storage controllers.
Partial-blueprint: expose-storage-capabilities
Change-Id: Iff42e3b775ed63661bc69fc1925242ff0e574e46
Given we are going to implement notification, so the 'queues'
package is not suitable for current scope of zaqar. This
patch will remove the 'queues' package.
Partially implements: blueprint notifications
Change-Id: I6984f31f4bd1e646b585c45c088ed239b58587c4