Skip to content

Commit

Permalink
store: Fix the query for retrieving replication lag
Browse files Browse the repository at this point in the history
The old query was returning just the millisecond portion of the lag, not
the lag in milliseconds
  • Loading branch information
lutter committed Sep 23, 2022
1 parent 5ddb87b commit 058abf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store/postgres/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ pub(crate) fn replication_lag(conn: &PgConnection) -> Result<Duration, StoreErro
}

let lag = sql_query(
"select extract(milliseconds from max(greatest(write_lag, flush_lag, replay_lag)))::int as ms \
"select (extract(epoch from max(greatest(write_lag, flush_lag, replay_lag)))*1000)::int as ms \
from pg_stat_replication",
)
.get_result::<Lag>(conn)?;
Expand Down

0 comments on commit 058abf0

Please sign in to comment.