Bug 1893015

Summary: Storage efficiency card showing wrong compression ratio
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: Console Storage PluginAssignee: Kanika Murarka <kmurarka>
Status: CLOSED ERRATA QA Contact: Shay Rozen <srozen>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.6CC: aos-bugs, jespy, kmurarka, nthomas, oviner, srozen
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-30 16:45:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1891999    
Bug Blocks:    

Description OpenShift BugZilla Robot 2020-10-29 22:26:38 UTC
+++ This bug was initially created as a clone of Bug #1891999 +++

Description of problem:
Current storage efficiency card, shows the ratio of `ceph_bluestore_bluestore_compressed_original` and `ceph_bluestore_bluestore_compressed` instead of `ceph_bluestore_bluestore_compressed_original` and `ceph_bluestore_bluestore_compressed_allocated`.`ceph_bluestore_bluestore_compressed` query tells us the new size of the data after compression and not the size required to store the compressed data, as it also depends on min_blob_size of bluestore.

Version-Release number of selected component (if applicable):
4.6

How reproducible:
2/2

Steps to Reproduce:
1. Navigate to Storage class creation view
2. Create a compressed pool and a storage class using it.
3. Attach PVC to this storage class and add some data to it.
4. Observe the Storage efficiency card and capacity breakdown card.

Actual results:
The Storage efficiency card will show high amount of efficiency, but the storage saved will be lesser.

Expected results:
Storage saved due to compression should match the ratio from storage efficiency card.

Additional info:

Comment 5 Shay Rozen 2020-11-18 11:25:50 UTC
POOL                                                      ID     STORED      OBJECTS     USED        %USED     MAX AVAIL     QUOTA OBJECTS     QUOTA BYTES     DIRTY     USED COMPR     UNDER COMPR 
    p-rep3comp                                                19      10 GiB       2.63k      22 GiB      3.52       199 GiB     N/A               N/A             2.63k        8.2 GiB          16 GiB 

The ratio shows which is got as we see 16GiB that where compressed into 8.2GiB
But I have a problem with the saving that shows only 5.48 GiB
The client sent 10g which with replica 3 should be 30g and now it is 22g so the saving should like 8G. Also we can see that 16g where comporessed to 8.2g so something is wrong with the saving value. How it is calculated?

Comment 8 Kanika Murarka 2020-11-24 10:12:46 UTC
The query for saving and ratio are same (one gives the ratio and other gives the difference)
ratio: sum(ceph_bluestore_bluestore_compressed_original) / clamp_min(sum(ceph_bluestore_bluestore_compressed_allocated),1)
saved: (sum(ceph_bluestore_bluestore_compressed_original) - sum(ceph_bluestore_bluestore_compressed_allocated))

I will suggest to open a different bug for saving, as this bug is for compression ratio.

Comment 9 Shay Rozen 2020-11-24 10:17:48 UTC
(In reply to Kanika Murarka from comment #8)
> The query for saving and ratio are same (one gives the ratio and other gives
> the difference)
> ratio: sum(ceph_bluestore_bluestore_compressed_original) /
> clamp_min(sum(ceph_bluestore_bluestore_compressed_allocated),1)
> saved: (sum(ceph_bluestore_bluestore_compressed_original) -
> sum(ceph_bluestore_bluestore_compressed_allocated))
> 
> I will suggest to open a different bug for saving, as this bug is for
> compression ratio.
Verifying and will open another BZ for the saving issue

Comment 11 errata-xmlrpc 2020-11-30 16:45:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6.6 bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5115