From 0d140656b96c7ce42c54dc7a02876acadc482297 Mon Sep 17 00:00:00 2001 From: Sami Imseih Date: Thu, 10 Sep 2026 01:33:39 +0000 Subject: [PATCH v1 1/1] Rename PqMsg_Progress to PqParallelMsg_Progress a99cc6c6b4 introduced PqMsg_Progress as the macro for protocol character P. That character is used by parallel workers to send messages to their leader, but the name is generic and does not reflect that purpose. Rename the macro to PqParallelMsg_Progress instead. The new name also introduces a PqParallelMsg_ prefix that can be reused for future parallel-worker message types. This is cosmetic, so no backpatch. --- src/backend/access/transam/parallel.c | 2 +- src/backend/utils/activity/backend_progress.c | 8 ++++---- src/include/libpq/protocol.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 17fcd246b0c..e1806a9a28a 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -1218,7 +1218,7 @@ ProcessParallelMessage(ParallelContext *pcxt, int i, StringInfo msg) break; } - case PqMsg_Progress: + case PqParallelMsg_Progress: { /* * Only incremental progress reporting is currently supported. diff --git a/src/backend/utils/activity/backend_progress.c b/src/backend/utils/activity/backend_progress.c index 6d2049105ab..dee05b1abb1 100644 --- a/src/backend/utils/activity/backend_progress.c +++ b/src/backend/utils/activity/backend_progress.c @@ -92,15 +92,15 @@ void pgstat_progress_parallel_incr_param(int index, int64 incr) { /* - * Parallel workers notify a leader through a PqMsg_Progress message to - * update progress, passing the progress index and incremented value. - * Leaders can just call pgstat_progress_incr_param directly. + * Parallel workers notify a leader through a PqParallelMsg_Progress + * message to update progress, passing the progress index and incremented + * value. Leaders can just call pgstat_progress_incr_param directly. */ if (IsParallelWorker()) { static StringInfoData progress_message; - pq_beginmessage(&progress_message, PqMsg_Progress); + pq_beginmessage(&progress_message, PqParallelMsg_Progress); pq_sendint32(&progress_message, index); pq_sendint64(&progress_message, incr); pq_endmessage(&progress_message); diff --git a/src/include/libpq/protocol.h b/src/include/libpq/protocol.h index eae8f0e7238..e333c2ae646 100644 --- a/src/include/libpq/protocol.h +++ b/src/include/libpq/protocol.h @@ -67,7 +67,7 @@ /* These are the codes sent by parallel workers to leader processes. */ -#define PqMsg_Progress 'P' +#define PqParallelMsg_Progress 'P' /* Replication codes sent by the primary (wrapped in CopyData messages). */ -- 2.50.1