Bug 2229267 - Labeled Perf Counters "counter dump" asok command emits invalid JSON
Summary: Labeled Perf Counters "counter dump" asok command emits invalid JSON
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Dashboard
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 6.1z2
Assignee: Ali Maredia
QA Contact: Sunil Angadi
Akash Raj
URL:
Whiteboard:
Depends On:
Blocks: 2235257
TreeView+ depends on / blocked
 
Reported: 2023-08-04 16:42 UTC by Ali Maredia
Modified: 2023-11-03 04:01 UTC (History)
9 users (show)

Fixed In Version: ceph-17.2.6-105.el9cp
Doc Type: Bug Fix
Doc Text:
. JSON entries emitted by `counter dump` and `counter schema` no longer repeat, can be parsed, and are valid Previously, the JSON emitted by the `counter dump` and `counter schema` commands would have repeated entries with the same name, due to which the commands became invalid. With this fix, each entry in the JSON emitted by the `counter dump` and `counter schema` has an array of labeled counters or schemas. The entries are no longer repeated, can be parsed, and are valid JSON.
Clone Of:
Environment:
Last Closed: 2023-10-12 16:34:36 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 61587 0 None None None 2023-08-04 16:42:23 UTC
Github ceph ceph pull 52469 0 None Merged reef: common: `counter dump` command revision 2023-08-07 16:24:32 UTC
Red Hat Issue Tracker RHCEPH-7163 0 None None None 2023-08-04 16:43:02 UTC
Red Hat Issue Tracker RHCSDASH-1044 0 None None None 2023-08-04 16:43:04 UTC
Red Hat Product Errata RHSA-2023:5693 0 None None None 2023-10-12 16:35:38 UTC

Description Ali Maredia 2023-08-04 16:42:23 UTC
Description of problem:

Copied from: https://tracker.ceph.com/issues/61587

{
...
    "rbd_mirror_snapshot_image": {
        "labels": {
            "image": "b1",
            "namespace": "",
            "pool": "data" 
        },
        "counters": {
            "snapshots": 1,
            "sync_time": {
                "avgcount": 1,
                "sum": 0.394751259,
                "avgtime": 0.394751259
            },
            "sync_bytes": 3203072,
            "remote_timestamp": 1685658580.065694857,
            "local_timestamp": 1685658580.065694857,
            "last_sync_time": 0.394751259,
            "last_sync_bytes": 3203072
        }
    },
    "rbd_mirror_snapshot_image": {
        "labels": {
            "image": "b2",
            "namespace": "",
            "pool": "data" 
        },
        "counters": {
            "snapshots": 1,
            "sync_time": {
                "avgcount": 1,
                "sum": 0.383831520,
                "avgtime": 0.383831520
            },
            "sync_bytes": 4182016,
            "remote_timestamp": 1685659196.821769027,
            "local_timestamp": 1685659196.821769027,
            "last_sync_time": 0.383831520,
            "last_sync_bytes": 4182016
        }
    },
...
}

needs to become

{
...
    "rbd_mirror_snapshot_image": [
        {
            "labels": {
                "image": "b1",
                "namespace": "",
                "pool": "data" 
            },
            "counters": {
                "snapshots": 1,
                "sync_time": {
                    "avgcount": 1,
                    "sum": 0.394751259,
                    "avgtime": 0.394751259
                },
                "sync_bytes": 3203072,
                "remote_timestamp": 1685658580.065694857,
                "local_timestamp": 1685658580.065694857,
                "last_sync_time": 0.394751259,
                "last_sync_bytes": 3203072
            }
        },
        {
            "labels": {
                "image": "b2",
                "namespace": "",
                "pool": "data" 
            },
            "counters": {
                "snapshots": 1,
                "sync_time": {
                    "avgcount": 1,
                    "sum": 0.383831520,
                    "avgtime": 0.383831520
                },
                "sync_bytes": 4182016,
                "remote_timestamp": 1685659196.821769027,
                "local_timestamp": 1685659196.821769027,
                "last_sync_time": 0.383831520,
                "last_sync_bytes": 4182016
            }
        },
    ],
...
}

Otherwise a compliant JSON parser is free to pick up only one of the mirrored images, at random, since they are dumped in the same dictionary under the same "rbd_mirror_snapshot_image" key.

This was missed in https://github.com/ceph/ceph/pull/48657 (mentioned but lost in backwards compatibility discussions). The exporter daemon would need be adjusted accordingly.



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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

This issue has already been resolved upstream but was not backported to Quincy. This BZ is to track the backport to RHCS 6.

Comment 12 errata-xmlrpc 2023-10-12 16:34:36 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 (Moderate: Red Hat Ceph Storage 6.1 security, enhancement, and 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-2023:5693


Note You need to log in before you can comment on or make changes to this bug.