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

Commita1195a5

Browse files
committed
Log a better message when canceling autovacuum.
The old message was at DEBUG2, so typically it didn't show up in thelog at all. As a result, in most cases where autovacuum was canceled,the only information that was logged was the table being vacuumed,with no indication as to what problem caused the cancel. Crank upthe level to LOG and add some more details to assist with debugging.Back-patch all the way, per discussion on pgsql-hackers.
1 parentaa7cd14 commita1195a5

File tree

1 file changed

+21
-4
lines changed
  • src/backend/storage/lmgr

1 file changed

+21
-4
lines changed

‎src/backend/storage/lmgr/proc.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,29 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
10331033
!(autovac->vacuumFlags&PROC_VACUUM_FOR_WRAPAROUND))
10341034
{
10351035
intpid=autovac->pid;
1036+
StringInfoDatalocktagbuf;
1037+
StringInfoDatalogbuf;/* errdetail for server log */
1038+
1039+
initStringInfo(&locktagbuf);
1040+
initStringInfo(&logbuf);
1041+
DescribeLockTag(&locktagbuf,&lock->tag);
1042+
appendStringInfo(&logbuf,
1043+
_("Process %d waits for %s on %s"),
1044+
MyProcPid,
1045+
GetLockmodeName(lock->tag.locktag_lockmethodid,
1046+
lockmode),
1047+
locktagbuf.data);
1048+
1049+
/* release lock as quickly as possible */
1050+
LWLockRelease(ProcArrayLock);
10361051

1037-
elog(DEBUG2,"sending cancel to blocking autovacuum PID %d",
1038-
pid);
1052+
ereport(LOG,
1053+
(errmsg("sending cancel to blocking autovacuum PID %d",
1054+
pid),
1055+
errdetail_log("%s",logbuf.data)));
10391056

1040-
/* don't hold the lock across the kill() syscall */
1041-
LWLockRelease(ProcArrayLock);
1057+
pfree(logbuf.data);
1058+
pfree(locktagbuf.data);
10421059

10431060
/* send the autovacuum worker Back to Old Kent Road */
10441061
if (kill(pid,SIGINT)<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp