mirror of
https://github.com/postgres/postgres.git
synced 2025-12-22 17:42:17 +03:00
Manual cleanup and pgindent of pgstat and bufmgr related code
This is in preparation for commiting a larger patch series in the area. Discussion: https://postgr.es/m/CAAKRu_bHwGEbzNxxy+MQDkrsgog6aO6iUvajJ4d6PD98gFU7+w@mail.gmail.com
This commit is contained in:
@@ -426,7 +426,7 @@ pgstat_discard_stats(void)
|
||||
ereport(DEBUG2,
|
||||
(errcode_for_file_access(),
|
||||
errmsg_internal("unlinked permanent statistics file \"%s\"",
|
||||
PGSTAT_STAT_PERMANENT_FILENAME)));
|
||||
PGSTAT_STAT_PERMANENT_FILENAME)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -986,6 +986,7 @@ pgstat_build_snapshot(void)
|
||||
|
||||
entry->data = MemoryContextAlloc(pgStatLocal.snapshot.context,
|
||||
kind_info->shared_size);
|
||||
|
||||
/*
|
||||
* Acquire the LWLock directly instead of using
|
||||
* pg_stat_lock_entry_shared() which requires a reference.
|
||||
|
||||
@@ -783,6 +783,7 @@ pgstat_relation_flush_cb(PgStat_EntryRef *entry_ref, bool nowait)
|
||||
if (lstats->t_counts.t_numscans)
|
||||
{
|
||||
TimestampTz t = GetCurrentTransactionStopTimestamp();
|
||||
|
||||
if (t > tabentry->lastscan)
|
||||
tabentry->lastscan = t;
|
||||
}
|
||||
|
||||
@@ -906,7 +906,7 @@ pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS)
|
||||
clean_ipv6_addr(beentry->st_clientaddr.addr.ss_family, remote_host);
|
||||
|
||||
PG_RETURN_DATUM(DirectFunctionCall1(inet_in,
|
||||
CStringGetDatum(remote_host)));
|
||||
CStringGetDatum(remote_host)));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
||||
Reference in New Issue
Block a user