pmdadb2: fix Db2 v12 MON_* column and view compatibility#2625
Conversation
Update SQL for Db2 12 (TBSP_NAME, ACT_COMPLETED_TOTAL, SYSIBMADM.ENV_INST_INFO, transaction log byte fields), report zero for unavailable per-table deadlocks, and only drop connections on communication failures.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdates the Db2 PMDA in ChangesDb2 PMDA metric and runtime fixes
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This is a followup of #2621 @natoscott I can not make |
To make pylint happy, the number of parameters passed to db2_refresh_instanced() has been reworked.
@kurik Awesome - thanks for the investigation and fixes — the TABLESPACE_NAME -> TBSP_NAME, ACT_COMPLETED_TOTAL, SYSIBMADM.ENV_INST_INFO, and log byte-field changes all look good to me. One concern about the DEADLOCKS handling: keeping the metric returning a hardcoded zero is misleading — this way if monitoring db2.table.deadlocks we cannot distinguish "no deadlocks occurred" from "this data is not available at the table level". Better to remove it entirely. The same applies to the other lock-related columns in the MON_GET_TABLE query: LOCK_WAITS, LOCK_WAIT_TIME, and LOCK_ESCALS. If DEADLOCKS is not available per-table in Db2 v11/v12, these may have the same limitation. Could you verify whether these three columns return meaningful per-table values on your 12.1 instance, or whether they too reflect only database-wide aggregates? If they are also unavailable per-table, we should remove all four lock-related metrics (db2.table.deadlocks, db2.table.lock_waits, db2.table.lock_wait_time, db2.table.lock_escalations) from the cluster rather than stub them. The row DML counters, overflow accesses, and table scan counts would remain as the meaningful per-table metrics. |
Update SQL for Db2 12 (TBSP_NAME, ACT_COMPLETED_TOTAL, SYSIBMADM.ENV_INST_INFO, transaction log byte fields), report zero for unavailable per-table deadlocks, and only drop connections on communication failures.