Skip to content

Commit 0424128

Browse files
committed
autovacuum: Improve wording in a couple places
A few strings (one WARNING and some memory context names) in the autovacuum code were written in a world where "worker" had no other possible meaning than "autovacuum worker", but that's long time gone. Be more specific about it. Also, change the WARNING from elog() to ereport(), to add translability. Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Nathan Bossart <bossartn@amazon.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/CALj2ACX2UHp76dqdoZq92a7v4APFuV5wJQ+AUrb+2HURrKN=NQ@mail.gmail.com
1 parent 6738554 commit 0424128

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/backend/postmaster/autovacuum.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,8 @@ AutoVacLauncherMain(int argc, char *argv[])
754754
dlist_push_head(&AutoVacuumShmem->av_freeWorkers,
755755
&worker->wi_links);
756756
AutoVacuumShmem->av_startingWorker = NULL;
757-
elog(WARNING, "worker took too long to start; canceled");
757+
ereport(WARNING,
758+
errmsg("autovacuum worker took too long to start; canceled"));
758759
}
759760
}
760761
else
@@ -966,10 +967,10 @@ rebuild_database_list(Oid newdb)
966967
autovac_refresh_stats();
967968

968969
newcxt = AllocSetContextCreate(AutovacMemCxt,
969-
"AV dblist",
970+
"Autovacuum database list",
970971
ALLOCSET_DEFAULT_SIZES);
971972
tmpcxt = AllocSetContextCreate(newcxt,
972-
"tmp AV dblist",
973+
"Autovacuum database list (tmp)",
973974
ALLOCSET_DEFAULT_SIZES);
974975
oldcxt = MemoryContextSwitchTo(tmpcxt);
975976

@@ -992,7 +993,7 @@ rebuild_database_list(Oid newdb)
992993
hctl.keysize = sizeof(Oid);
993994
hctl.entrysize = sizeof(avl_dbase);
994995
hctl.hcxt = tmpcxt;
995-
dbhash = hash_create("db hash", 20, &hctl, /* magic number here FIXME */
996+
dbhash = hash_create("autovacuum db hash", 20, &hctl, /* magic number here FIXME */
996997
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
997998

998999
/* start by inserting the new database */
@@ -1179,7 +1180,7 @@ do_start_worker(void)
11791180
* allocated for the database list.
11801181
*/
11811182
tmpcxt = AllocSetContextCreate(CurrentMemoryContext,
1182-
"Start worker tmp cxt",
1183+
"Autovacuum start worker (tmp)",
11831184
ALLOCSET_DEFAULT_SIZES);
11841185
oldcxt = MemoryContextSwitchTo(tmpcxt);
11851186

@@ -1981,7 +1982,7 @@ do_autovacuum(void)
19811982
* relations to vacuum/analyze across transactions.
19821983
*/
19831984
AutovacMemCxt = AllocSetContextCreate(TopMemoryContext,
1984-
"AV worker",
1985+
"Autovacuum worker",
19851986
ALLOCSET_DEFAULT_SIZES);
19861987
MemoryContextSwitchTo(AutovacMemCxt);
19871988

0 commit comments

Comments
 (0)