@@ -45,12 +45,28 @@ func CheckPostgreSQL(ctx context.Context, checks *check.CheckSuite) (*check.Chec
45
45
return connectionCount (ctx , localConn )
46
46
})
47
47
48
- if member .Role == flypg .PrimaryRoleName && member .Active {
49
- // Check that provides additional insight into disk capacity and
50
- // how close we are to hitting the readonly threshold.
51
- checks .AddCheck ("disk-capacity" , func () (string , error ) {
52
- return diskCapacityCheck (ctx , node )
48
+ if member .Role == flypg .PrimaryRoleName {
49
+ // Check to see if any locks are present.
50
+ checks .AddCheck ("cluster-locks" , func () (string , error ) {
51
+ if flypg .ZombieLockExists () {
52
+ return "" , fmt .Errorf ("`zombie.lock` detected" )
53
+ }
54
+
55
+ if flypg .ReadOnlyLockExists () {
56
+ return "" , fmt .Errorf ("`readonly.lock` detected" )
57
+ }
58
+
59
+ return "No active locks detected" , nil
53
60
})
61
+
62
+ if member .Active {
63
+ // Check that provides additional insight into disk capacity and
64
+ // how close we are to hitting the readonly threshold.
65
+ checks .AddCheck ("disk-capacity" , func () (string , error ) {
66
+ return diskCapacityCheck (ctx , node )
67
+ })
68
+ }
69
+
54
70
}
55
71
56
72
return checks , nil
0 commit comments