diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py index 11eefd8..00ce38a 100644 --- a/mamonsu/plugins/pgsql/driver/pool.py +++ b/mamonsu/plugins/pgsql/driver/pool.py @@ -86,7 +86,7 @@ class Pool(object): """ SELECT application_name, {0} - coalesce((pg_{1}_{2}_diff(pg_current_{1}_{2}(), replay_{2}))::int, 0) AS total_lag + coalesce((pg_{1}_{2}_diff(pg_current_{1}_{2}(), replay_{2}))::bigint, 0) AS total_lag FROM pg_stat_replication; """, """ @@ -99,7 +99,7 @@ class Pool(object): "wal_held_bytes_master": ( """ SELECT slot_name, - coalesce((pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn))::int, 0) AS wal_held_bytes + coalesce((pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn))::bigint, 0) AS wal_held_bytes FROM pg_replication_slots; """, """ @@ -111,7 +111,7 @@ class Pool(object): "wal_held_bytes_replica": ( """ SELECT slot_name, - coalesce((pg_wal_lsn_diff(pg_last_wal_replay_lsn(), restart_lsn))::int, 0) AS wal_held_bytes + coalesce((pg_wal_lsn_diff(pg_last_wal_replay_lsn(), restart_lsn))::bigint, 0) AS wal_held_bytes FROM pg_replication_slots; """, """ diff --git a/mamonsu/plugins/pgsql/replication.py b/mamonsu/plugins/pgsql/replication.py index 7ed701c..f49d18a 100644 --- a/mamonsu/plugins/pgsql/replication.py +++ b/mamonsu/plugins/pgsql/replication.py @@ -69,11 +69,11 @@ def run(self, zbx): if Pooler.server_version_greater("10.0") and (Pooler.is_superuser() or Pooler.is_bootstraped()): result_lags = Pooler.run_sql_type("wal_lag_lsn", args=[ - " coalesce((pg_wal_lsn_diff(pg_current_wal_lsn(), sent_lsn))::int, 0) AS send_lag, " - "coalesce((pg_wal_lsn_diff(sent_lsn, flush_lsn))::int, 0) AS receive_lag, " - "coalesce((pg_wal_lsn_diff(sent_lsn, write_lsn))::int, 0) AS write_lag, " - "coalesce((pg_wal_lsn_diff(write_lsn, flush_lsn))::int, 0) AS flush_lag, " - "coalesce((pg_wal_lsn_diff(flush_lsn, replay_lsn))::int, 0) AS replay_lag, " if not Pooler.is_bootstraped() else + " coalesce((pg_wal_lsn_diff(pg_current_wal_lsn(), sent_lsn))::bigint, 0) AS send_lag, " + "coalesce((pg_wal_lsn_diff(sent_lsn, flush_lsn))::bigint, 0) AS receive_lag, " + "coalesce((pg_wal_lsn_diff(sent_lsn, write_lsn))::bigint, 0) AS write_lag, " + "coalesce((pg_wal_lsn_diff(write_lsn, flush_lsn))::bigint, 0) AS flush_lag, " + "coalesce((pg_wal_lsn_diff(flush_lsn, replay_lsn))::bigint, 0) AS replay_lag, " if not Pooler.is_bootstraped() else " send_lag, receive_lag, write_lag, flush_lag, replay_lag, ", "wal", "lsn"]) if result_lags: