diff --git a/src/bin/pg_ctl/backup.cpp b/src/bin/pg_ctl/backup.cpp index a070bea43..a5cd2e0ba 100755 --- a/src/bin/pg_ctl/backup.cpp +++ b/src/bin/pg_ctl/backup.cpp @@ -676,7 +676,6 @@ static void progress_report(int tablespacenum, const char* filename, bool force) pg_time_t now = 0; int elapsed_secs = 0; int caculate_secs = 0; - static bool print = true; /* * report and cacluate speed for every report_timeout or the sync percent changed. @@ -1563,7 +1562,7 @@ static bool BaseBackup(const char* dirname, uint32 term) /* Print the progress of the tool execution through a new thread. */ g_totalTableSpace = PQntuples(res); fprintf(stderr, "Begin Receiving files \n"); - pthread_t progressThread = NULL; + pthread_t progressThread; pthread_create(&progressThread, NULL, ProgressReportFullBuild, NULL); /* @@ -2813,7 +2812,7 @@ static void *ProgressReportFullBuild(void *arg) { /* progress report */ percent = (int)((totaldone / 1024) * 100 / totalsize); GenerateProgressBar(percent, progressBar); - fprintf(stderr, "Progress: %s %d%% (%d/%dKB). (%d/%d)tablespaces. Receive files \r", + fprintf(stderr, "Progress: %s %d%% (%lu/%luKB). (%d/%d)tablespaces. Receive files \r", progressBar, percent, (totaldone / 1024), totalsize, g_curTableSpace, g_totalTableSpace); pthread_mutex_lock(&g_mutex); timespec timeout; @@ -2831,7 +2830,7 @@ static void *ProgressReportFullBuild(void *arg) { } while (((totaldone / 1024) < totalsize) && !g_progressFlag); percent = 100; GenerateProgressBar(percent, progressBar); - fprintf(stderr, "Progress: %s %d%% (%d/%dKB). (%d/%d)tablespaces. Receive files \n", + fprintf(stderr, "Progress: %s %d%% (%lu/%luKB). (%d/%d)tablespaces. Receive files \n", progressBar, percent, totalsize, totalsize, g_curTableSpace, g_totalTableSpace); return nullptr; } diff --git a/src/bin/pg_probackup/validate.cpp b/src/bin/pg_probackup/validate.cpp index 9134cdd85..a4ac6e880 100644 --- a/src/bin/pg_probackup/validate.cpp +++ b/src/bin/pg_probackup/validate.cpp @@ -189,7 +189,7 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params) } /* setup threads */ - for (i = 0; (size_t)i < g_totalFiles; i++) + for (i = 0; i < g_totalFiles; i++) { pgFile *file = (pgFile *) parray_get(files, i); pg_atomic_clear_flag(&file->lock); diff --git a/src/bin/pg_rewind/fetch.cpp b/src/bin/pg_rewind/fetch.cpp index 9eaa61f44..8c0585a41 100755 --- a/src/bin/pg_rewind/fetch.cpp +++ b/src/bin/pg_rewind/fetch.cpp @@ -1337,7 +1337,7 @@ static void *ProgressReportIncrementalBuild(void *arg) /* progress report */ percent = (int)(fetch_done * 100 / fetch_size); GenerateProgressBar(percent, progressBar); - fprintf(stderr, "Progress: %s %d%% (%d/%dKB). fetch files \r", + fprintf(stderr, "Progress: %s %d%% (%lu/%luKB). fetch files \r", progressBar, percent, fetch_done, fetch_size); pthread_mutex_lock(&g_mutex); timespec timeout; @@ -1355,7 +1355,7 @@ static void *ProgressReportIncrementalBuild(void *arg) } while ((fetch_done < fetch_size) && !g_progressFlag); percent = 100; GenerateProgressBar(percent, progressBar); - fprintf(stderr, "Progress: %s %d%% (%d/%dKB). fetch files \n", + fprintf(stderr, "Progress: %s %d%% (%lu/%luKB). fetch files \n", progressBar, percent, fetch_done, fetch_size); return nullptr; } \ No newline at end of file diff --git a/src/bin/pg_rewind/logging.cpp b/src/bin/pg_rewind/logging.cpp index 4ab3b8321..7911bbb1a 100644 --- a/src/bin/pg_rewind/logging.cpp +++ b/src/bin/pg_rewind/logging.cpp @@ -159,7 +159,6 @@ void progress_report(bool force) GaussState g_state; int elapsed_secs = 0; int caculate_secs = 0; - static bool print = true; now = (pg_time_t)time(NULL); percent = fetch_size ? (int)((fetch_done)*100 / fetch_size) : 0;