manila/manila
Goutham Pacha Ravi 7116f839e2 Fix with_entities usage in db queries
In order to retrieve shares with filters
pertaining to separate tables (shares, instances, metadata,
etc), we need to perform joined loads of those
respective database tables as necessary. After the
join, the query cannot select entities due to
Github issue #6253 - The following is an error when
the pattern is used:

sqlalchemy.exc.ArgumentError: Query has only expression-based entities - can't find property named "share_metadata".

sqlalchemy 1.4 has a performance improvement that
delays query processing [2] and disallows this
pattern of usage; we can use a query.count() instead.

In another instance, we can perform joins selectively
only if asked for.

[1] https://github.com/sqlalchemy/sqlalchemy/issues/625
[2] https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#many-core-and-orm-statement-objects-now-perform-much-of-their-construction-and-validation-in-the-compile-phase

Change-Id: I8aa196c171bbc224cec06f517ea22c4e91cbc06a
Closes-Bug: #1926399
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
(cherry picked from commit 6ace54c260)
2021-05-21 19:11:40 +00:00
..
api Fix api error message for snapshot creation failure 2021-05-13 20:28:44 +00:00
cmd Add security service update for in-use share networks 2021-03-12 18:37:45 -03:00
common Merge "fix unmange share with manage_error status will lead to quota error" 2021-03-25 03:04:59 +00:00
compute remove usage of six library 2021-01-27 13:46:31 -08:00
data remove usage of six library 2021-01-27 13:46:31 -08:00
db Fix with_entities usage in db queries 2021-05-21 19:11:40 +00:00
image Fix NFS/CIFS share creation failure issue 2020-06-30 12:46:28 -04:00
message Add exception for insufficient privileges when using security services 2021-03-25 14:45:53 +00:00
network remove usage of six library 2021-01-27 13:46:31 -08:00
policies Document policy rule using the description parameter 2021-04-08 16:50:41 +00:00
scheduler Merge "Bump RPC version for the scheduler rpc call" 2021-03-26 12:24:24 +00:00
share [Glusterfs] Fix create share from snapshot failed 2021-04-29 10:21:50 +00:00
share_group Add security service update for in-use share networks 2021-03-12 18:37:45 -03:00
testing [ussuri][goal] Drop python2.7 support 2019-12-08 19:32:52 -08:00
tests [Glusterfs] Fix create share from snapshot failed 2021-04-29 10:21:50 +00:00
volume Fix parameters passed to exception 2019-03-19 17:40:40 +08:00
wsgi Integrate OSprofiler and Manila 2021-02-25 04:59:19 +01:00
__init__.py Removed ignored checks from tox.ini and fixed pep8 issues 2016-02-14 14:56:55 +02:00
context.py Drop "system_scope" from context constructor 2021-02-25 11:02:07 -08:00
coordination.py Remove unused configuration options 2017-12-13 22:49:35 +08:00
exception.py Merge "Add exception for insufficient privileges when using security services" 2021-03-26 01:25:19 +00:00
i18n.py Remove i18n.enable_lazy() translation 2018-11-14 14:09:08 +05:30
manager.py Put ensure_share into thread pool to speed up the startup of share service 2021-03-20 11:49:23 +00:00
opts.py Fix NFS/CIFS share creation failure issue 2020-06-30 12:46:28 -04:00
policy.py Merge "Set "context_is_admin" to system scope admin roles" 2021-03-26 18:01:33 +00:00
quota.py Add config option to set per_share_size_limit. 2021-03-09 11:58:17 +01:00
rpc.py Integrate OSprofiler and Manila 2021-02-25 04:59:19 +01:00
service.py Integrate OSprofiler and Manila 2021-02-25 04:59:19 +01:00
test.py Disable some policy warnings 2021-03-19 17:53:49 -07:00
utils.py Fix wrong totalcount returned by share listing query 2021-03-25 08:47:22 -03:00
version.py Remove vim headers 2014-10-06 15:00:27 +02:00