mirror of
https://github.com/postgres/postgres.git
synced 2025-12-04 12:02:48 +03:00
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
This commit is contained in:
@@ -984,7 +984,8 @@ rebuild_database_list(Oid newdb)
|
||||
hctl.keysize = sizeof(Oid);
|
||||
hctl.entrysize = sizeof(avl_dbase);
|
||||
hctl.hcxt = tmpcxt;
|
||||
dbhash = hash_create("autovacuum db hash", 20, &hctl, /* magic number here FIXME */
|
||||
dbhash = hash_create("autovacuum db hash", 20, &hctl, /* magic number here
|
||||
* FIXME */
|
||||
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
|
||||
|
||||
/* start by inserting the new database */
|
||||
@@ -1683,12 +1684,12 @@ AutoVacWorkerMain(int argc, char *argv[])
|
||||
char dbname[NAMEDATALEN];
|
||||
|
||||
/*
|
||||
* Report autovac startup to the cumulative stats system. We deliberately do
|
||||
* this before InitPostgres, so that the last_autovac_time will get
|
||||
* updated even if the connection attempt fails. This is to prevent
|
||||
* autovac from getting "stuck" repeatedly selecting an unopenable
|
||||
* database, rather than making any progress on stuff it can connect
|
||||
* to.
|
||||
* Report autovac startup to the cumulative stats system. We
|
||||
* deliberately do this before InitPostgres, so that the
|
||||
* last_autovac_time will get updated even if the connection attempt
|
||||
* fails. This is to prevent autovac from getting "stuck" repeatedly
|
||||
* selecting an unopenable database, rather than making any progress
|
||||
* on stuff it can connect to.
|
||||
*/
|
||||
pgstat_report_autovac(dbid);
|
||||
|
||||
|
||||
@@ -826,9 +826,9 @@ StartBackgroundWorker(void)
|
||||
|
||||
/*
|
||||
* Create a per-backend PGPROC struct in shared memory, except in the
|
||||
* EXEC_BACKEND case where this was done in SubPostmasterMain. We must
|
||||
* do this before we can use LWLocks (and in the EXEC_BACKEND case we
|
||||
* already had to do some stuff with LWLocks).
|
||||
* EXEC_BACKEND case where this was done in SubPostmasterMain. We must do
|
||||
* this before we can use LWLocks (and in the EXEC_BACKEND case we already
|
||||
* had to do some stuff with LWLocks).
|
||||
*/
|
||||
#ifndef EXEC_BACKEND
|
||||
InitProcess();
|
||||
|
||||
@@ -81,15 +81,14 @@ typedef struct PgArchData
|
||||
int pgprocno; /* pgprocno of archiver process */
|
||||
|
||||
/*
|
||||
* Forces a directory scan in pgarch_readyXlog(). Protected by
|
||||
* arch_lck.
|
||||
* Forces a directory scan in pgarch_readyXlog(). Protected by arch_lck.
|
||||
*/
|
||||
bool force_dir_scan;
|
||||
|
||||
slock_t arch_lck;
|
||||
} PgArchData;
|
||||
|
||||
char *XLogArchiveLibrary = "";
|
||||
char *XLogArchiveLibrary = "";
|
||||
|
||||
|
||||
/* ----------
|
||||
@@ -143,7 +142,7 @@ static bool pgarch_readyXlog(char *xlog);
|
||||
static void pgarch_archiveDone(char *xlog);
|
||||
static void pgarch_die(int code, Datum arg);
|
||||
static void HandlePgArchInterrupts(void);
|
||||
static int ready_file_comparator(Datum a, Datum b, void *arg);
|
||||
static int ready_file_comparator(Datum a, Datum b, void *arg);
|
||||
static void LoadArchiveLibrary(void);
|
||||
static void call_archive_module_shutdown_callback(int code, Datum arg);
|
||||
|
||||
@@ -579,13 +578,13 @@ pgarch_readyXlog(char *xlog)
|
||||
|
||||
/*
|
||||
* If we still have stored file names from the previous directory scan,
|
||||
* try to return one of those. We check to make sure the status file
|
||||
* is still present, as the archive_command for a previous file may
|
||||
* have already marked it done.
|
||||
* try to return one of those. We check to make sure the status file is
|
||||
* still present, as the archive_command for a previous file may have
|
||||
* already marked it done.
|
||||
*/
|
||||
while (arch_files->arch_files_size > 0)
|
||||
{
|
||||
struct stat st;
|
||||
struct stat st;
|
||||
char status_file[MAXPGPATH];
|
||||
char *arch_file;
|
||||
|
||||
@@ -655,8 +654,8 @@ pgarch_readyXlog(char *xlog)
|
||||
CStringGetDatum(basename), NULL) > 0)
|
||||
{
|
||||
/*
|
||||
* Remove the lowest priority file and add the current one to
|
||||
* the heap.
|
||||
* Remove the lowest priority file and add the current one to the
|
||||
* heap.
|
||||
*/
|
||||
arch_file = DatumGetCString(binaryheap_remove_first(arch_files->arch_heap));
|
||||
strcpy(arch_file, basename);
|
||||
@@ -677,8 +676,8 @@ pgarch_readyXlog(char *xlog)
|
||||
binaryheap_build(arch_files->arch_heap);
|
||||
|
||||
/*
|
||||
* Fill arch_files array with the files to archive in ascending order
|
||||
* of priority.
|
||||
* Fill arch_files array with the files to archive in ascending order of
|
||||
* priority.
|
||||
*/
|
||||
arch_files->arch_files_size = arch_files->arch_heap->bh_size;
|
||||
for (int i = 0; i < arch_files->arch_files_size; i++)
|
||||
@@ -702,10 +701,10 @@ pgarch_readyXlog(char *xlog)
|
||||
static int
|
||||
ready_file_comparator(Datum a, Datum b, void *arg)
|
||||
{
|
||||
char *a_str = DatumGetCString(a);
|
||||
char *b_str = DatumGetCString(b);
|
||||
bool a_history = IsTLHistoryFileName(a_str);
|
||||
bool b_history = IsTLHistoryFileName(b_str);
|
||||
char *a_str = DatumGetCString(a);
|
||||
char *b_str = DatumGetCString(b);
|
||||
bool a_history = IsTLHistoryFileName(a_str);
|
||||
bool b_history = IsTLHistoryFileName(b_str);
|
||||
|
||||
/* Timeline history files always have the highest priority. */
|
||||
if (a_history != b_history)
|
||||
@@ -793,8 +792,8 @@ HandlePgArchInterrupts(void)
|
||||
if (archiveLibChanged)
|
||||
{
|
||||
/*
|
||||
* Call the currently loaded archive module's shutdown callback, if
|
||||
* one is defined.
|
||||
* Call the currently loaded archive module's shutdown callback,
|
||||
* if one is defined.
|
||||
*/
|
||||
call_archive_module_shutdown_callback(0, 0);
|
||||
|
||||
@@ -803,8 +802,8 @@ HandlePgArchInterrupts(void)
|
||||
* load the new one, but there is presently no mechanism for
|
||||
* unloading a library (see the comment above
|
||||
* internal_load_library()). To deal with this, we simply restart
|
||||
* the archiver. The new archive module will be loaded when the new
|
||||
* archiver process starts up.
|
||||
* the archiver. The new archive module will be loaded when the
|
||||
* new archiver process starts up.
|
||||
*/
|
||||
ereport(LOG,
|
||||
(errmsg("restarting archiver process because value of "
|
||||
@@ -828,9 +827,8 @@ LoadArchiveLibrary(void)
|
||||
memset(&ArchiveContext, 0, sizeof(ArchiveModuleCallbacks));
|
||||
|
||||
/*
|
||||
* If shell archiving is enabled, use our special initialization
|
||||
* function. Otherwise, load the library and call its
|
||||
* _PG_archive_module_init().
|
||||
* If shell archiving is enabled, use our special initialization function.
|
||||
* Otherwise, load the library and call its _PG_archive_module_init().
|
||||
*/
|
||||
if (XLogArchiveLibrary[0] == '\0')
|
||||
archive_init = shell_archive_init;
|
||||
|
||||
@@ -2859,8 +2859,8 @@ pmdie(SIGNAL_ARGS)
|
||||
|
||||
/*
|
||||
* If we reached normal running, we go straight to waiting for
|
||||
* client backends to exit. If already in PM_STOP_BACKENDS or
|
||||
* a later state, do not change it.
|
||||
* client backends to exit. If already in PM_STOP_BACKENDS or a
|
||||
* later state, do not change it.
|
||||
*/
|
||||
if (pmState == PM_RUN || pmState == PM_HOT_STANDBY)
|
||||
connsAllowed = false;
|
||||
|
||||
@@ -75,7 +75,7 @@ static volatile sig_atomic_t startup_progress_timer_expired = false;
|
||||
/*
|
||||
* Time between progress updates for long-running startup operations.
|
||||
*/
|
||||
int log_startup_progress_interval = 10000; /* 10 sec */
|
||||
int log_startup_progress_interval = 10000; /* 10 sec */
|
||||
|
||||
/* Signal handlers */
|
||||
static void StartupProcTriggerHandler(SIGNAL_ARGS);
|
||||
|
||||
@@ -297,9 +297,9 @@ HandleWalWriterInterrupts(void)
|
||||
/*
|
||||
* Force reporting remaining WAL statistics at process exit.
|
||||
*
|
||||
* Since pgstat_report_wal is invoked with 'force' is false in main loop
|
||||
* to avoid overloading the cumulative stats system, there may exist
|
||||
* unreported stats counters for the WAL writer.
|
||||
* Since pgstat_report_wal is invoked with 'force' is false in main
|
||||
* loop to avoid overloading the cumulative stats system, there may
|
||||
* exist unreported stats counters for the WAL writer.
|
||||
*/
|
||||
pgstat_report_wal(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user