Skip to content

Commit ce93a5e

Browse files
fix: exclude ShareUpdateExclusiveLock from observer warnings
1 parent 79ff961 commit ce93a5e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cmd/cli/commands/clone/actions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ func observeSummary() func(*cli.Context) error {
245245
}
246246

247247
if err := obs.CheckPerformanceRequirements(); err != nil {
248+
log.Err("Performance check error:", err)
248249
// Exit with error status without printing additional error logs.
249250
os.Exit(errorExitStatus)
250251
}

pkg/observer/observer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (obs *Observer) PrintSummary() error {
184184

185185
// CheckPerformanceRequirements checks monitoring data and returns an error if any of performance requires was not satisfied.
186186
func (obs *Observer) CheckPerformanceRequirements() error {
187-
if obs.CheckDuration() || obs.CheckLocks() {
187+
if !obs.CheckDuration() || !obs.CheckLocks() {
188188
return errors.New("performance requirements not satisfied")
189189
}
190190

pkg/observer/queries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const queryLocks = `with lock_data as (
3030
clock_timestamp() - a.state_change as state_changed_ago,
3131
a.pid
3232
from pg_stat_activity a
33-
join pg_locks l ON l.pid = a.pid
34-
where l.mode ~* 'exclusive'
33+
join pg_locks l on l.pid = a.pid
34+
where l.mode = 'AccessExclusiveLock' and l.locktype = 'relation'
3535
)
3636
select row_to_json(lock_data)
3737
from lock_data

0 commit comments

Comments
 (0)