@@ -337,8 +337,8 @@ ptrackCheckpoint(void)
337
337
XLogRecPtr init_lsn ;
338
338
pg_atomic_uint64 buf [PTRACK_BUF_SIZE ];
339
339
struct stat stat_buf ;
340
- int i = 0 ;
341
- int j = 0 ;
340
+ uint64 i = 0 ;
341
+ uint64 j = 0 ;
342
342
343
343
elog (DEBUG1 , "ptrack checkpoint" );
344
344
@@ -430,14 +430,16 @@ ptrackCheckpoint(void)
430
430
431
431
if (j == PTRACK_BUF_SIZE )
432
432
{
433
- int writesz = sizeof (buf );
433
+ int writesz = sizeof (buf ); /* Up to ~2 GB for buffer size seems
434
+ * to be more than enough, so never
435
+ * going to overflow. */
434
436
435
437
/*
436
438
* We should not have any allignment issues here, since sizeof()
437
439
* takes into account all paddings for us.
438
440
*/
439
441
ptrack_write_chunk (ptrack_tmp_fd , & crc , (char * ) buf , writesz );
440
- elog (DEBUG5 , "ptrack checkpoint: i %d , j %d , writesz %d PtrackContentNblocks " UINT64_FORMAT ,
442
+ elog (DEBUG5 , "ptrack checkpoint: i " UINT64_FORMAT " , j " UINT64_FORMAT " , writesz %d PtrackContentNblocks " UINT64_FORMAT ,
441
443
i , j , writesz , (uint64 ) PtrackContentNblocks );
442
444
443
445
j = 0 ;
@@ -450,7 +452,7 @@ ptrackCheckpoint(void)
450
452
int writesz = sizeof (pg_atomic_uint64 ) * j ;
451
453
452
454
ptrack_write_chunk (ptrack_tmp_fd , & crc , (char * ) buf , writesz );
453
- elog (DEBUG5 , "ptrack checkpoint: final i %d , j %d , writesz %d PtrackContentNblocks " UINT64_FORMAT ,
455
+ elog (DEBUG5 , "ptrack checkpoint: final i " UINT64_FORMAT " , j " UINT64_FORMAT " , writesz %d PtrackContentNblocks " UINT64_FORMAT ,
454
456
i , j , writesz , (uint64 ) PtrackContentNblocks );
455
457
}
456
458
0 commit comments