Bug 2283629

Summary: Must Gather collects redundant data in collection in odf mode
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Niraj Yadav <niryadav>
Component: must-gatherAssignee: Niraj Yadav <niryadav>
Status: CLOSED ERRATA QA Contact: Oded <oviner>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.16CC: ebenahar, muagarwa, odf-bz-bot, ypadia
Target Milestone: ---   
Target Release: ODF 4.16.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.16.0-113 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-17 13:23:49 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 Niraj Yadav 2024-05-28 11:33:35 UTC
Description of problem (please be detailed as possible and provide log
snippests):

Right now if someone runs must-gather in odf mode by using -o or --odf flag and also issues one of -c, -cl, -ns or -cs, these scripts will be executed twice.

This leads to an increase in the collection time and creates redundant collection data.

Must gather should be patched to ignore these overlapping args.


Steps to Reproduce:
1. Run must-gather with -o and any of -c, -cl, -ns or -cs args.
2.
3.


Actual results:

The additional flags cause the script to run twice. Once by -o arg and once by the respective arg.

Expected results:

The gather should not call any script twice if it is already being called by another sub process.

Comment 9 Oded 2024-06-02 11:16:13 UTC
https://github.com/red-hat-storage/odf-must-gather/pull/167/files#diff-bad6eb3f5953b7f47f014fd8b04a48470c1d64d94bbd29566af842f0b60c909cR143
based on code, we call to  functions   gather_ceph_pod_logs , gather_ceph_logs ,  gather_namespaced_resources,  gather_clusterscoped_resources 
Why we need [--odf] flag?
(--odf) ==  (-c)  + (-cl) + (-ns) + (-cs)

SetUp:
OCP: 4.16
ODF: 4.16
Platform: Vsphere

Test Procedeure:
1.Running must-gather command with -c -cl -cs  flags
adm must-gather --image=quay.io/rhceph-dev/ocs-must-gather:latest-4.16 --dest-dir=/tmp/tmp2rbyavop_ocs_logs/oviner6-jun/ocs_must_gather -- /usr/bin/gather -c -cl -cs 
2.Make sure there are no duplicates in mg dir

Comment:
It is difficult to test it without debugging ["set -x"], because the second time the function is called, the existing files will be overwritten by the new files.

Comment 11 Sunil Kumar Acharya 2024-06-06 07:34:46 UTC
Please update the RDT flag/text appropriately.

Comment 12 errata-xmlrpc 2024-07-17 13:23:49 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 (Important: Red Hat OpenShift Data Foundation 4.16.0 security, enhancement & 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/RHSA-2024:4591