Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a0abe87f
Commit
a0abe87f
authored
Mar 23, 2007
by
Alvaro Herrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate the code to start a new worker into its own function. The code is
exactly the same, modulo whitespace.
parent
6287eb7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
85 deletions
+100
-85
src/backend/postmaster/autovacuum.c
src/backend/postmaster/autovacuum.c
+100
-85
No files found.
src/backend/postmaster/autovacuum.c
View file @
a0abe87f
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.3
6 2007/03/23 21:23:13
alvherre Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.3
7 2007/03/23 21:45:17
alvherre Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -118,6 +118,7 @@ static pid_t avworker_forkexec(void);
NON_EXEC_STATIC
void
AutoVacWorkerMain
(
int
argc
,
char
*
argv
[]);
NON_EXEC_STATIC
void
AutoVacLauncherMain
(
int
argc
,
char
*
argv
[]);
static
void
do_start_worker
(
void
);
static
void
do_autovacuum
(
PgStat_StatDBEntry
*
dbentry
);
static
List
*
autovac_get_database_list
(
void
);
static
void
test_rel_for_autovac
(
Oid
relid
,
PgStat_StatTabEntry
*
tabentry
,
...
...
@@ -218,9 +219,6 @@ NON_EXEC_STATIC void
AutoVacLauncherMain
(
int
argc
,
char
*
argv
[])
{
sigjmp_buf
local_sigjmp_buf
;
List
*
dblist
;
bool
for_xid_wrap
;
autovac_dbase
*
db
;
MemoryContext
avlauncher_cxt
;
/* we are a postmaster subprocess now */
...
...
@@ -358,8 +356,6 @@ AutoVacLauncherMain(int argc, char *argv[])
for
(;;)
{
TransactionId
xidForceLimit
;
ListCell
*
cell
;
int
worker_pid
;
/*
...
...
@@ -407,6 +403,49 @@ AutoVacLauncherMain(int argc, char *argv[])
}
}
do_start_worker
();
sleep:
/*
* in emergency mode, exit immediately so that the postmaster can
* request another run right away if needed.
*
* XXX -- maybe it would be better to handle this inside the launcher
* itself.
*/
if
(
!
autovacuum_start_daemon
)
break
;
/* have pgstat read the file again next time */
pgstat_clear_snapshot
();
/* now sleep until the next autovac iteration */
pg_usleep
(
autovacuum_naptime
*
1000000L
);
}
/* Normal exit from the autovac launcher is here */
ereport
(
LOG
,
(
errmsg
(
"autovacuum launcher shutting down"
)));
proc_exit
(
0
);
/* done */
}
/*
* do_start_worker
*
* Bare-bones procedure for starting an autovacuum worker from the launcher.
* It determines what database to work on, sets up shared memory stuff and
* signals postmaster to start the worker.
*/
static
void
do_start_worker
(
void
)
{
List
*
dblist
;
bool
for_xid_wrap
;
autovac_dbase
*
db
;
ListCell
*
cell
;
TransactionId
xidForceLimit
;
/* Get a list of databases */
dblist
=
autovac_get_database_list
();
...
...
@@ -486,30 +525,6 @@ AutoVacLauncherMain(int argc, char *argv[])
SendPostmasterSignal
(
PMSIGNAL_START_AUTOVAC_WORKER
);
}
sleep:
/*
* in emergency mode, exit immediately so that the postmaster can
* request another run right away if needed.
*
* XXX -- maybe it would be better to handle this inside the launcher
* itself.
*/
if
(
!
autovacuum_start_daemon
)
break
;
/* have pgstat read the file again next time */
pgstat_clear_snapshot
();
/* now sleep until the next autovac iteration */
pg_usleep
(
autovacuum_naptime
*
1000000L
);
}
/* Normal exit from the autovac launcher is here */
ereport
(
LOG
,
(
errmsg
(
"autovacuum launcher shutting down"
)));
proc_exit
(
0
);
/* done */
}
/* SIGHUP: set flag to re-read config file at next convenient time */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment