Skip to content

Commit 857723b

Browse files
authored
Widen MotionLayerState stat counters from uint32 to uint64 (#1647)
MotionLayerState accumulates stats across all MotionNodeEntry instances. Per-node entries already use uint64. The global sum ≥ any individual node, so it overflows first — at 4GB. Fix by widening to uint64. Also fix the debug elog() format specifiers to match.
1 parent d971e82 commit 857723b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/backend/cdb/motion/cdbmotion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ RemoveMotionLayer(MotionLayerState *mlStates)
133133
/* Emit statistics to log */
134134
if (gp_log_interconnect >= GPVARS_VERBOSITY_VERBOSE)
135135
elog(LOG, "RemoveMotionLayer(): dumping stats\n"
136-
" Sent: %9u chunks %9u total bytes %9u tuple bytes\n"
137-
" Received: %9u chunks %9u total bytes %9u tuple bytes; "
136+
" Sent: %9" INT64_MODIFIER "u chunks %9" INT64_MODIFIER "u total bytes %9" INT64_MODIFIER "u tuple bytes\n"
137+
" Received: %9" INT64_MODIFIER "u chunks %9" INT64_MODIFIER "u total bytes %9" INT64_MODIFIER "u tuple bytes; "
138138
"%9u chunkproc calls\n",
139139
mlStates->stat_total_chunks_sent,
140140
mlStates->stat_total_bytes_sent,

src/include/cdb/cdbinterconnect.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ typedef struct MotionLayerState
154154
/*
155155
* GLOBAL MOTION-LAYER STATISTICS
156156
*/
157-
uint32 stat_total_chunks_sent; /* Tuple-chunks sent. */
158-
uint32 stat_total_bytes_sent; /* Bytes sent, including headers. */
159-
uint32 stat_tuple_bytes_sent; /* Bytes of pure tuple-data sent. */
157+
uint64 stat_total_chunks_sent; /* Tuple-chunks sent. */
158+
uint64 stat_total_bytes_sent; /* Bytes sent, including headers. */
159+
uint64 stat_tuple_bytes_sent; /* Bytes of pure tuple-data sent. */
160160

161-
uint32 stat_total_chunks_recvd;/* Tuple-chunks received. */
162-
uint32 stat_total_bytes_recvd; /* Bytes received, including headers. */
163-
uint32 stat_tuple_bytes_recvd; /* Bytes of pure tuple-data received. */
161+
uint64 stat_total_chunks_recvd;/* Tuple-chunks received. */
162+
uint64 stat_total_bytes_recvd; /* Bytes received, including headers. */
163+
uint64 stat_tuple_bytes_recvd; /* Bytes of pure tuple-data received. */
164164

165165
uint32 stat_total_chunkproc_calls; /* Calls to processIncomingChunks() */
166166

0 commit comments

Comments
 (0)