You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: product_docs/docs/pgd/6.2/reference/commit-scopes/degrading.mdx
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,4 +62,34 @@ ALL (left_dc) CAMO DEGRADE ON (timeout=20ms, require_write_lead=true) TO ASYNC
62
62
63
63
Again, you should set the `timeout` parameter, as the default is `0`.
64
64
65
+
## Monitoring degrade events
66
+
67
+
Degrade events are tracked in the [bdr.stat_commit_scope](/pgd/latest/reference/tables-views-functions/catalogs-visible/#bdrstat_commit_scope) view. Three key metrics provide visibility into degrade behavior:
68
+
69
+
-**`ndegrades`**: Counts per-transaction degrade events. Each time a backend hits the degrade timeout during commit and successfully degrades that transaction, this counter is incremented. This shows how many individual transactions have experienced degradation.
70
+
71
+
-**`nconfig_degrades`**: Counts configuration-level state changes to degraded mode. This is incremented when the background worker (manager process) switches the commit scope's shared state to degraded based on node availability checks. This indicates how many times the commit scope configuration itself entered degraded state, which then affects all subsequent transactions until recovered.
72
+
73
+
-**`last_state_change_time`**: Records the timestamp of the last configuration-level state change (either entering or recovering from degraded state). This helps identify when the commit scope last transitioned between normal and degraded operation, useful for correlating degrade events with other system events or outages.
74
+
75
+
### Example monitoring query
76
+
77
+
```sql
78
+
-- View commit scope statistics including degrade events and last state change
79
+
SELECT
80
+
commit_scope_name,
81
+
ndegrades,
82
+
nconfig_degrades,
83
+
last_state_change_time,
84
+
CASE
85
+
WHEN last_state_change_time IS NULL THEN 'never degraded'
86
+
WHEN age(now(), last_state_change_time) < interval '5 seconds' THEN 'recently changed'
87
+
ELSE 'stable for '|| age(now(), last_state_change_time)::text
88
+
END AS state_change_info
89
+
FROMbdr.stat_commit_scope
90
+
WHERE ndegrades >0OR nconfig_degrades >0
91
+
ORDER BY last_state_change_time DESC NULLS LAST;
92
+
```
93
+
94
+
These metrics together provide complete visibility into both immediate per-transaction fallback and longer-term state management degrade behavior, along with temporal context for troubleshooting.
Copy file name to clipboardExpand all lines: product_docs/docs/pgd/6.2/reference/monitoring/sql.mdx
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -367,10 +367,13 @@ Commit scopes are our durability and consistency configuration framework. As suc
367
367
368
368
Accordingly, these two views show relevant statistics about commit scopes:
369
369
370
-
-[bdr.stat_commit_scope](/pgd/latest/reference/tables-views-functions/catalogs-visible/#bdrstat_commit_scope) for cumulative statistics for each commit scope.
370
+
-[bdr.stat_commit_scope](/pgd/latest/reference/tables-views-functions/catalogs-visible/#bdrstat_commit_scope) for cumulative statistics for each commit scope, including degrade event counters (`ndegrades`, `nconfig_degrades`) and the timestamp of the last configuration state change (`last_state_change_time`).
371
371
372
372
-[bdr.stat_commit_scope_state](/pgd/latest/reference/tables-views-functions/catalogs-visible/#bdrstat_commit_scope_state) for information about the current use of commit scopes by backend processes.
373
373
374
+
For more information about monitoring degrade events, see [Monitoring degrade events](/pgd/latest/reference/commit-scopes/degrading/#monitoring-degrade-events).
375
+
376
+
374
377
## Monitoring global locks
375
378
376
379
The global lock, which is currently used only for DDL replication, is a heavyweight
| commit_scope_name | name | Name of the commit scope
959
+
| group_name | name | Name of group for which the commit scope is defined
960
+
| ncalls | bigint | The number of times the commit scope was used
961
+
| ncommits | bigint | The number of successful commits were made with the commit scope
962
+
| naborts | bigint | The number of times the commit scope used was eventually aborted
963
+
| ndegrades | bigint | The number of per-transaction degrade events where a backend hit the degrade timeout during commit
964
+
| nconfig_degrades | bigint | The number of configuration-level state changes to degraded mode by the background worker
965
+
| last_state_change_time | timestamp with time zone | The timestamp of the last configuration-level state change (entering or recovering from degraded state)
966
+
| total_commit_time | double precision | Total time spent committing using the commit scope, in milliseconds
967
+
| min_commit_time | double precision | Minimum time spent committing using the commit scope, in milliseconds
968
+
| max_commit_time | double precision | Maximum time spend committing using the commit scope, in milliseconds
969
+
| mean_commit_time | double precision | Mean time spent committing using the commit scope, in milliseconds
970
+
| stats_reset | timestamp with time zone | Time at which all statistics in the view were last reset
0 commit comments