1 /*-------------------------------------------------------------------------
2  *
3  * autovacuum.h
4  *	  header file for integrated autovacuum daemon
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/postmaster/autovacuum.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef AUTOVACUUM_H
15 #define AUTOVACUUM_H
16 
17 
18 /* GUC variables */
19 extern bool autovacuum_start_daemon;
20 extern int	autovacuum_max_workers;
21 extern int	autovacuum_work_mem;
22 extern int	autovacuum_naptime;
23 extern int	autovacuum_vac_thresh;
24 extern double autovacuum_vac_scale;
25 extern int	autovacuum_anl_thresh;
26 extern double autovacuum_anl_scale;
27 extern int	autovacuum_freeze_max_age;
28 extern int	autovacuum_multixact_freeze_max_age;
29 extern int	autovacuum_vac_cost_delay;
30 extern int	autovacuum_vac_cost_limit;
31 
32 /* autovacuum launcher PID, only valid when worker is shutting down */
33 extern int	AutovacuumLauncherPid;
34 
35 extern int	Log_autovacuum_min_duration;
36 
37 /* Status inquiry functions */
38 extern bool AutoVacuumingActive(void);
39 extern bool IsAutoVacuumLauncherProcess(void);
40 extern bool IsAutoVacuumWorkerProcess(void);
41 
42 #define IsAnyAutoVacuumProcess() \
43 	(IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess())
44 
45 /* Functions to start autovacuum process, called from postmaster */
46 extern void autovac_init(void);
47 extern int	StartAutoVacLauncher(void);
48 extern int	StartAutoVacWorker(void);
49 
50 /* called from postmaster when a worker could not be forked */
51 extern void AutoVacWorkerFailed(void);
52 
53 /* autovacuum cost-delay balancer */
54 extern void AutoVacuumUpdateDelay(void);
55 
56 #ifdef EXEC_BACKEND
57 extern void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_noreturn();
58 extern void AutoVacWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
59 extern void AutovacuumWorkerIAm(void);
60 extern void AutovacuumLauncherIAm(void);
61 #endif
62 
63 /* shared memory stuff */
64 extern Size AutoVacuumShmemSize(void);
65 extern void AutoVacuumShmemInit(void);
66 
67 #endif   /* AUTOVACUUM_H */
68