get_wsrep_value doesn't log connection exception

Bug #1942936 reported by Adam Dyess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Fix Committed
Medium
Gui Maluf Balzana

Bug Description

percona_utils.get_wresp_value(key)

can fail in cursor.execute(...) with an Exception but the logging is

```
unit-mysql-3: 15:53:19 ERROR unit.mysql/3.juju-log Failed to get '%s'
```

changing to

    except Exception as e:
        log("Failed to get key=%s '%s'" % (key, e), ERROR)
        return None

you can get a better log

```
unit-mysql-3: 15:58:33 ERROR unit.mysql/3.juju-log Failed to get key=wsrep_ready '(1146, "Table 'performance_schema.session_status' doesn't exist")'
```

Changed in charm-percona-cluster:
importance: Undecided → Medium
status: New → Triaged
tags: added: good-first-bug
Changed in charm-percona-cluster:
assignee: nobody → Zeeshan Ali Shah (babal1nux)
description: updated
Changed in charm-percona-cluster:
assignee: Zeeshan Ali Shah (babal1nux) → Gui Maluf Balzana (guimalufb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-percona-cluster (master)
Changed in charm-percona-cluster:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-percona-cluster (master)

Reviewed: https://review.opendev.org/c/openstack/charm-percona-cluster/+/850464
Committed: https://opendev.org/openstack/charm-percona-cluster/commit/a3f65978a7b6719a901406a31eaf338d9c2f61c3
Submitter: "Zuul (22348)"
Branch: master

commit a3f65978a7b6719a901406a31eaf338d9c2f61c3
Author: Guilherme Maluf Balzana <email address hidden>
Date: Tue Jul 19 16:55:04 2022 +0200

    Fix log message when catching `get_wsrep_value` exception

    `get_wresp_value` can fail in `cursor.execute()` and no log
    message would be written.

    This commit fix and ensure the right message is logged.

    Closes-Bug: #1942936
    Change-Id: Idbb1170bbf43fdecec233137d6581bf8f799baa9

Changed in charm-percona-cluster:
status: In Progress → Fix Committed
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.