Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9781ae

Browse files
Fix autovacuum cost debug logging
Commit7d71d3d introduced finer grained updates of autovacuum optionchanges by increasing the frequency of reading the configuration file.The debug logging of cost parameter was however changed such that someinitial values weren't logged. Fix by changing logging to use the oldfrequency of logging regardless of them changing.Also avoid taking a log for rendering the log message unless the setloglevel is such that the log entry will be emitted.Author: Masahiko Sawada <sawada.mshk@gmail.com>Discussion:https://postgr.es/m/CAD21AoBS7o6Ljt_vfqPQPf67AhzKu3fR0iqk8B=vVYczMugKMQ@mail.gmail.com
1 parent0d0aeb0 commita9781ae

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,9 +1785,6 @@ FreeWorkerInfo(int code, Datum arg)
17851785
void
17861786
VacuumUpdateCosts(void)
17871787
{
1788-
doubleoriginal_cost_delay=vacuum_cost_delay;
1789-
intoriginal_cost_limit=vacuum_cost_limit;
1790-
17911788
if (MyWorkerInfo)
17921789
{
17931790
if (av_storage_param_cost_delay >=0)
@@ -1821,16 +1818,15 @@ VacuumUpdateCosts(void)
18211818
VacuumCostBalance=0;
18221819
}
18231820

1824-
if (MyWorkerInfo)
1821+
/*
1822+
* Since the cost logging requires a lock, avoid rendering the log message
1823+
* in case we are using a message level where the log wouldn't be emitted.
1824+
*/
1825+
if (MyWorkerInfo&&message_level_is_interesting(DEBUG2))
18251826
{
18261827
Oiddboid,
18271828
tableoid;
18281829

1829-
/* Only log updates to cost-related variables */
1830-
if (vacuum_cost_delay==original_cost_delay&&
1831-
vacuum_cost_limit==original_cost_limit)
1832-
return;
1833-
18341830
Assert(!LWLockHeldByMe(AutovacuumLock));
18351831

18361832
LWLockAcquire(AutovacuumLock,LW_SHARED);
@@ -1844,7 +1840,6 @@ VacuumUpdateCosts(void)
18441840
vacuum_cost_limit,vacuum_cost_delay,
18451841
vacuum_cost_delay>0 ?"yes" :"no",
18461842
VacuumFailsafeActive ?"yes" :"no");
1847-
18481843
}
18491844
}
18501845

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp