The only duplicated function calls that I see within a single hook are the update_all_identity_relation_units and identity_changed in the upgrade-charm hook. I suspect that there is a bit of re-organizing that we can do to remove the first pairs of that function, and only run them later.
Looking at your status log above, I only see s little bit of duplication within a single hook:
# Upgrade Charm
- main init_db_ if_ready all_identity_ relation_ units all_identity_ relation_ units
- upgrade_charm
- leader_
- update_
- identity_changed
- update_nrpe_config
- update_
- identity_changed
The only duplicated function calls that I see within a single hook are the update_ all_identity_ relation_ units and identity_changed in the upgrade-charm hook. I suspect that there is a bit of re-organizing that we can do to remove the first pairs of that function, and only run them later.