Incorrect sync_message when a subcloud fails to sync

Bug #2057934 reported by Gustavo Herzmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Gustavo Herzmann

Bug Description

Brief Description
-----------------
The sync_message during a subcloud sync failure prints 'dict_keys', example:
sync_message | Failed to sync dict_keys(['subcloud1-sc1-ptg']) in the Subcloud Peer Group spg1.

The same issue also happens when the subcloud delete fails during a peer-group-association delete command.

Severity
--------
<Minor: System/Feature is usable with minor issue>

Steps to Reproduce
------------------
With a subcloud in the rehome-failed state on the secondary site, run the sync command from the primary site:
dcmanager peer-group-association sync <association_id>

Then wait for the sync to fail and check the sync_message with:
dcmanager peer-group-association show <association_id>

Expected Behavior
------------------
The sync message should be:
"Failed to sync ['subcloud1', 'subcloud2'] in the Subcloud Peer Group spg1."

Actual Behavior
----------------
The sync message is:
"Failed to sync dict_keys(['subcloud1', 'subcloud2']) in the Subcloud Peer Group spg1."

Reproducibility
---------------
State if the issue is 100% reproducible

System Configuration
--------------------
Distributed Cloud system configured for geo-redundancy

Branch/Pull Time/Commit
-----------------------
master (2024-03-11)

Last Pass
---------
Issue was introduced by this commit:
https://review.opendev.org/c/starlingx/distcloud/+/909277

Timestamp/Logs
--------------
+---------------------+----------------------------------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------------------------------+
| id | 1 |
| peer_group_id | 1 |
| system_peer_id | 1 |
| association_type | primary |
| sync_status | failed |
| peer_group_priority | 1 |
| sync_message | Failed to sync dict_keys(['subcloud1-sc1-ptg']) in the Subcloud Peer Group spg1. |
| created_at | 2024-03-13 15:52:59.982114 |
| updated_at | 2024-03-13 17:37:30.059455 |
+---------------------+----------------------------------------------------------------------------------+

Test Activity
Feature Testing

Workaround
----------
NA

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to distcloud (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/distcloud/+/913200

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/913200
Committed: https://opendev.org/starlingx/distcloud/commit/0e24a87afb2b53ca0fbe1d46687c8852743b203c
Submitter: "Zuul (22348)"
Branch: master

commit 0e24a87afb2b53ca0fbe1d46687c8852743b203c
Author: Gustavo Herzmann <email address hidden>
Date: Thu Mar 14 11:09:48 2024 -0300

    Fix peer-group-association sync_message

    The current message prints the error_msg.keys() directly, which returns
    a dict_keys object. This commit fix the SPA sync_message by casting it
    to a list.

    This commit also fixes a log message where the subcloud name and peer
    name order was inverted.

    Test Plan:
    1. PASS - Try to sync a PGA that has the rehome-failed state in the
              non-primary site, causing the sync to fail. Verify that the
              sync_message prints the subcloud list without including the
              'dict_keys' string;
    2. PASS - Introduce an error during the _delete_subcloud() function
              and then try to delete the peer group association. Verify
              that the sync_message prints the subcloud list without
              including the 'dict_keys' string;
    3. PASS - During SPG migration, verify that the modified log message
              prints the subcloud name and peer site name in the correct
              order.

    Closes-Bug: 2057934

    Change-Id: Idfdc2cc1731a51c6098a06863b2469c3085aa813
    Signed-off-by: Gustavo Herzmann <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.10.0 stx.distcloud
Changed in starlingx:
assignee: nobody → Gustavo Herzmann (gherzman)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.