Skip to content

Commit 886319d

Browse files
Adjust trace_sort log messages.
The project message style guide dictates: "When citing the name of an object, state what kind of object it is". The parallel CREATE INDEX patch added a worker number to most of the trace_sort messages within tuplesort.c without specifying the object type. Bring these messages into compliance with the style guide. We're still treating a leader or serial Tuplesortstate as having worker number -1. trace_sort is a developer option, and these two cases are highly comparable, so this seems appropriate. Per complaint from Tom Lane. Discussion: https://postgr.es/m/8330.1540831863@sss.pgh.pa.us Backpatch: 11-, where parallel CREATE INDEX was introduced.
1 parent c33a01c commit 886319d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/backend/utils/sort/tuplesort.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,11 +1259,11 @@ tuplesort_end(Tuplesortstate *state)
12591259
if (trace_sort)
12601260
{
12611261
if (state->tapeset)
1262-
elog(LOG, "%s of %d ended, %ld disk blocks used: %s",
1262+
elog(LOG, "%s of worker %d ended, %ld disk blocks used: %s",
12631263
SERIAL(state) ? "external sort" : "parallel external sort",
12641264
state->worker, spaceUsed, pg_rusage_show(&state->ru_start));
12651265
else
1266-
elog(LOG, "%s of %d ended, %ld KB used: %s",
1266+
elog(LOG, "%s of worker %d ended, %ld KB used: %s",
12671267
SERIAL(state) ? "internal sort" : "unperformed parallel sort",
12681268
state->worker, spaceUsed, pg_rusage_show(&state->ru_start));
12691269
}
@@ -1793,7 +1793,7 @@ tuplesort_performsort(Tuplesortstate *state)
17931793

17941794
#ifdef TRACE_SORT
17951795
if (trace_sort)
1796-
elog(LOG, "performsort of %d starting: %s",
1796+
elog(LOG, "performsort of worker %d starting: %s",
17971797
state->worker, pg_rusage_show(&state->ru_start));
17981798
#endif
17991799

@@ -1878,11 +1878,11 @@ tuplesort_performsort(Tuplesortstate *state)
18781878
if (trace_sort)
18791879
{
18801880
if (state->status == TSS_FINALMERGE)
1881-
elog(LOG, "performsort of %d done (except %d-way final merge): %s",
1881+
elog(LOG, "performsort of worker %d done (except %d-way final merge): %s",
18821882
state->worker, state->activeTapes,
18831883
pg_rusage_show(&state->ru_start));
18841884
else
1885-
elog(LOG, "performsort of %d done: %s",
1885+
elog(LOG, "performsort of worker %d done: %s",
18861886
state->worker, pg_rusage_show(&state->ru_start));
18871887
}
18881888
#endif
@@ -2410,7 +2410,7 @@ inittapes(Tuplesortstate *state, bool mergeruns)
24102410

24112411
#ifdef TRACE_SORT
24122412
if (trace_sort)
2413-
elog(LOG, "%d switching to external sort with %d tapes: %s",
2413+
elog(LOG, "worker %d switching to external sort with %d tapes: %s",
24142414
state->worker, maxTapes, pg_rusage_show(&state->ru_start));
24152415
#endif
24162416

@@ -2660,7 +2660,7 @@ mergeruns(Tuplesortstate *state)
26602660
*/
26612661
#ifdef TRACE_SORT
26622662
if (trace_sort)
2663-
elog(LOG, "%d using " INT64_FORMAT " KB of memory for read buffers among %d input tapes",
2663+
elog(LOG, "worker %d using " INT64_FORMAT " KB of memory for read buffers among %d input tapes",
26642664
state->worker, state->availMem / 1024, numInputTapes);
26652665
#endif
26662666

@@ -2836,7 +2836,7 @@ mergeonerun(Tuplesortstate *state)
28362836

28372837
#ifdef TRACE_SORT
28382838
if (trace_sort)
2839-
elog(LOG, "%d finished %d-way merge step: %s", state->worker,
2839+
elog(LOG, "worker %d finished %d-way merge step: %s", state->worker,
28402840
state->activeTapes, pg_rusage_show(&state->ru_start));
28412841
#endif
28422842
}
@@ -2971,7 +2971,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
29712971

29722972
#ifdef TRACE_SORT
29732973
if (trace_sort)
2974-
elog(LOG, "%d starting quicksort of run %d: %s",
2974+
elog(LOG, "worker %d starting quicksort of run %d: %s",
29752975
state->worker, state->currentRun,
29762976
pg_rusage_show(&state->ru_start));
29772977
#endif
@@ -2984,7 +2984,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
29842984

29852985
#ifdef TRACE_SORT
29862986
if (trace_sort)
2987-
elog(LOG, "%d finished quicksort of run %d: %s",
2987+
elog(LOG, "worker %d finished quicksort of run %d: %s",
29882988
state->worker, state->currentRun,
29892989
pg_rusage_show(&state->ru_start));
29902990
#endif
@@ -3012,7 +3012,7 @@ dumptuples(Tuplesortstate *state, bool alltuples)
30123012

30133013
#ifdef TRACE_SORT
30143014
if (trace_sort)
3015-
elog(LOG, "%d finished writing run %d to tape %d: %s",
3015+
elog(LOG, "worker %d finished writing run %d to tape %d: %s",
30163016
state->worker, state->currentRun, state->destTape,
30173017
pg_rusage_show(&state->ru_start));
30183018
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy