Instead of showing the count of snapshots, it is showing the count of snapshot instances.
This number is bigger in case any of the parent shares has replicas.
e.g. in our qa in project 7703392920fb462ca4b02f5c6d8915db curl v2/snapshots/detail?with_count=True returns back 4 snapshots, but a count of 11
better to be seen where that number is coming from in the db:
MariaDB [manila]> select count(id) from share_snapshots where project_id='7703392920fb462ca4b02f5c6d8915db' and deleted='False';
+-----------+
| count(id) |
+-----------+
| 4 |
+-----------+
1 row in set (0.000 sec)
MariaDB [manila]> select count(id) from share_snapshot_instances where snapshot_id in (select id from share_snapshots where project_id='7703392920fb462ca4b02f5c6d8915db' and deleted='False');
+-----------+
| count(id) |
+-----------+
| 11 |
+-----------+
1 row in set (0.001 sec)
I think the problem is the same for the shares count (returns 6 shares, but a count of 9) and also exists upstream.
MariaDB [manila]> select count(id) from shares where project_id='7703392920fb462ca4b02f5c6d8915db' and deleted='False';
+-----------+
| count(id) |
+-----------+
| 6 |
+-----------+
1 row in set (0.002 sec)
MariaDB [manila]> select count(id) from share_instances where share_id in (select id from shares where project_id='7703392920fb462ca4b02f5c6d8915db' and deleted='False');
+-----------+
| count(id) |
+-----------+
| 9 |
+-----------+
1 row in set (0.009 sec)
Instead of showing the count of snapshots, it is showing the count of snapshot instances. This number is bigger in case any of the parent shares has replicas.
e.g. in our qa in project
7703392920fb462ca4b02f5c6d8915db
curlv2/snapshots/detail?with_count=True
returns back 4 snapshots, but a count of 11better to be seen where that number is coming from in the db:
I think the problem is the same for the shares count (returns 6 shares, but a count of 9) and also exists upstream.