Bug 2246547

Summary: [Backport to 4.13.z] Fix analytics data missing fields in DB
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Utkarsh Srivastava <usrivast>
Component: Multi-Cloud Object GatewayAssignee: Nimrod Becker <nbecker>
Status: CLOSED ERRATA QA Contact: Tiffany Nguyen <tunguyen>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.13CC: lmauda, nbecker, odf-bz-bot, sheggodu
Target Milestone: ---   
Target Release: ODF 4.13.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.13.7-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-29 08:22:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Utkarsh Srivastava 2023-10-27 11:24:56 UTC
Description of problem (please be detailed as possible and provide log
snippests):
NooBaa analytics tables store data like bandwidth usage etc. These tables do not have all the desired fields at the moment.

The consequence of this is that DB queries become extremely slow over time and NooBaa cleanups can not clear the stale entries leading to degraded performance.

Version of all relevant components (if applicable):


Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?


Is there any workaround available to the best of your knowledge?
Manually cleaning up the analytics table helps.

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
1

Can this issue reproducible?
Yes

Can this issue reproduce from the UI?
N/A

If this is a regression, please provide more details to justify this:


Steps to Reproduce:
1.
2.
3.


Actual results:
Tables like `usagereports` should have all the fields defined.

Expected results:
Tables like `usagereports` do not have fields like system_id, start_time, end_time, etc defined.


Additional info:

Comment 7 Tiffany Nguyen 2024-01-23 19:25:38 UTC
Verified with ODF 4.13.7

The table contains the fields defined.  Mark as verified.

nbcore=# \d datablocks
                Table "public.datablocks"
 Column |     Type      | Collation | Nullable | Default 
--------+---------------+-----------+----------+---------
 _id    | character(24) |           | not null | 
 data   | jsonb         |           |          | 
Indexes:
    "datablocks_pkey" PRIMARY KEY, btree (_id)
    "idx_btree_datablocks__id_index" UNIQUE, btree ((data ->> '_id'::text))
    "idx_btree_datablocks_aggregate_by_delete_dates" btree (to_ts(data ->> 'deleted'::text)) WHERE data ? 'deleted'::text
    "idx_btree_datablocks_chunk" btree ((data ->> 'chunk'::text)) WHERE data ? 'chunk'::text
    "idx_btree_datablocks_node__id" btree ((data ->> 'node'::text), (data ->> '_id'::text) DESC) WHERE data ? 'node'::text

nbcore=# \d datachunks
                Table "public.datachunks"
 Column |     Type      | Collation | Nullable | Default 
--------+---------------+-----------+----------+---------
 _id    | character(24) |           | not null | 
 data   | jsonb         |           |          | 
Indexes:
    "datachunks_pkey" PRIMARY KEY, btree (_id)
    "idx_btree_datachunks__id_index" UNIQUE, btree ((data ->> '_id'::text))
    "idx_btree_datachunks_aggregate_by_delete_dates" btree (to_ts(data ->> 'deleted'::text)) WHERE data ? 'deleted'::text
    "idx_btree_datachunks_dedup_key" btree ((data ->> 'dedup_key'::text)) WHERE data ? 'dedup_key'::text
    "idx_btree_datachunks_id_desc" btree ((data ->> '_id'::text) DESC) WHERE (data -> 'deleted'::text) IS NULL OR (data -> 'deleted'::text) = 'null'::jsonb
    "idx_btree_datachunks_tiering_index" btree ((data ->> 'tier'::text), (data ->> 'tier_lru'::text) DESC) WHERE ((data -> 'deleted'::text) IS NULL OR (data -> 'deleted'::text) = 'null'::jsonb) AND data ? 'tier'::text AND data ? 'tier_lru'::text

nbcore=# \d usagereports
               Table "public.usagereports"
 Column |     Type      | Collation | Nullable | Default 
--------+---------------+-----------+----------+---------
 _id    | character(24) |           | not null | 
 data   | jsonb         |           |          | 
Indexes:
    "usagereports_pkey" PRIMARY KEY, btree (_id)
    "idx_btree_usagereports__id_index" UNIQUE, btree ((data ->> '_id'::text))
    "idx_btree_usagereports_start_time_aggregated_time_aggregated_ti" btree ((data ->> 'start_time'::text), (data ->> 'aggregated_time'::text) DESC, (data ->> 'aggregated_time_range'::text))

Comment 11 errata-xmlrpc 2024-01-29 08:22:08 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 (Red Hat OpenShift Data Foundation 4.13.7 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-2024:0540