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

Commita43f193

Browse files
committed
Remove or reduce verbosity of some debug messages.
The debug messages that merely print StartTransactionCommand,CommitTransactionCommand, ProcessUtilty, or ProcessQuery with noadditional details seem to be useless. Get rid of them.The transaction status messages produced by ShowTransactionState areoccasionally useful, but they are extremely verbose, producingmultiple lines of log output every time they fire, which can happensmultiple times per transaction. So, reduce the level to DEBUG5; avoidemitting an extra line just to explain which debug point is at issue;and tighten up the rest of the message so it doesn't use quite so muchhorizontal space.With these changes, it's possible to run a somewhat busy system with alog level even as high as DEBUG4, whereas previously anything aboveDEBUG2 would flood the log with output that probably wasn't really allthat useful.
1 parentd8c05af commita43f193

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static void AtSubStart_Memory(void);
327327
staticvoidAtSubStart_ResourceOwner(void);
328328

329329
staticvoidShowTransactionState(constchar*str);
330-
staticvoidShowTransactionStateRec(TransactionStatestate);
330+
staticvoidShowTransactionStateRec(constchar*str,TransactionStatestate);
331331
staticconstchar*BlockStateAsString(TBlockStateblockState);
332332
staticconstchar*TransStateAsString(TransStatestate);
333333

@@ -4944,19 +4944,16 @@ static void
49444944
ShowTransactionState(constchar*str)
49454945
{
49464946
/* skip work if message will definitely not be printed */
4947-
if (log_min_messages <=DEBUG3||client_min_messages <=DEBUG3)
4948-
{
4949-
elog(DEBUG3,"%s",str);
4950-
ShowTransactionStateRec(CurrentTransactionState);
4951-
}
4947+
if (log_min_messages <=DEBUG5||client_min_messages <=DEBUG5)
4948+
ShowTransactionStateRec(str,CurrentTransactionState);
49524949
}
49534950

49544951
/*
49554952
* ShowTransactionStateRec
49564953
*Recursive subroutine for ShowTransactionState
49574954
*/
49584955
staticvoid
4959-
ShowTransactionStateRec(TransactionStates)
4956+
ShowTransactionStateRec(constchar*str,TransactionStates)
49604957
{
49614958
StringInfoDatabuf;
49624959

@@ -4966,25 +4963,26 @@ ShowTransactionStateRec(TransactionState s)
49664963
{
49674964
inti;
49684965

4969-
appendStringInfo(&buf,"%u",s->childXids[0]);
4966+
appendStringInfo(&buf,", children:%u",s->childXids[0]);
49704967
for (i=1;i<s->nChildXids;i++)
49714968
appendStringInfo(&buf," %u",s->childXids[i]);
49724969
}
49734970

49744971
if (s->parent)
4975-
ShowTransactionStateRec(s->parent);
4972+
ShowTransactionStateRec(str,s->parent);
49764973

49774974
/* use ereport to suppress computation if msg will not be printed */
4978-
ereport(DEBUG3,
4979-
(errmsg_internal("name: %s; blockState: %13s; state: %7s, xid/subid/cid: %u/%u/%u%s, nestlvl: %d, children: %s",
4975+
ereport(DEBUG5,
4976+
(errmsg_internal("%s(%d) name: %s; blockState: %s; state: %s, xid/subid/cid: %u/%u/%u%s%s",
4977+
str,s->nestingLevel,
49804978
PointerIsValid(s->name) ?s->name :"unnamed",
49814979
BlockStateAsString(s->blockState),
49824980
TransStateAsString(s->state),
49834981
(unsignedint)s->transactionId,
49844982
(unsignedint)s->subTransactionId,
49854983
(unsignedint)currentCommandId,
49864984
currentCommandIdUsed ?" (used)" :"",
4987-
s->nestingLevel,buf.data)));
4985+
buf.data)));
49884986

49894987
pfree(buf.data);
49904988
}

‎src/backend/tcop/postgres.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,8 +2427,6 @@ start_xact_command(void)
24272427
{
24282428
if (!xact_started)
24292429
{
2430-
ereport(DEBUG3,
2431-
(errmsg_internal("StartTransactionCommand")));
24322430
StartTransactionCommand();
24332431

24342432
/* Set statement timeout running, if any */
@@ -2450,10 +2448,6 @@ finish_xact_command(void)
24502448
/* Cancel any active statement timeout before committing */
24512449
disable_timeout(STATEMENT_TIMEOUT, false);
24522450

2453-
/* Now commit the command */
2454-
ereport(DEBUG3,
2455-
(errmsg_internal("CommitTransactionCommand")));
2456-
24572451
CommitTransactionCommand();
24582452

24592453
#ifdefMEMORY_CONTEXT_CHECKING

‎src/backend/tcop/pquery.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ ProcessQuery(PlannedStmt *plan,
167167
{
168168
QueryDesc*queryDesc;
169169

170-
elog(DEBUG3,"ProcessQuery");
171-
172170
/*
173171
* Create the QueryDesc object
174172
*/
@@ -1151,8 +1149,6 @@ PortalRunUtility(Portal portal, Node *utilityStmt,
11511149
{
11521150
Snapshotsnapshot;
11531151

1154-
elog(DEBUG3,"ProcessUtility");
1155-
11561152
/*
11571153
* Set snapshot if utility stmt needs one. Most reliable way to do this
11581154
* seems to be to enumerate those that do not need one; this is a short

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp