A couple of newlines missing in pg_rewind log entries
Hi all,
Some grepping is showing up that a couple of newlines are missing in
pg_rewind, leading to unreadable log entries:
libpq_fetch.c: pg_log(PG_DEBUG, "getting file chunks");
logging.c: pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied",
filemap.c: pg_fatal("could not stat file \"%s\": %s",
Attached is a patch to fix them.
Regards,
--
Michael
Attachments:
20150623_rewind_newlines.patchapplication/x-patch; name=20150623_rewind_newlines.patchDownload
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
index 3821e9c..b877d55 100644
--- a/src/bin/pg_rewind/filemap.c
+++ b/src/bin/pg_rewind/filemap.c
@@ -256,7 +256,7 @@ process_target_file(const char *path, file_type_t type, size_t oldsize,
if (lstat(localpath, &statbuf) < 0)
{
if (errno != ENOENT)
- pg_fatal("could not stat file \"%s\": %s",
+ pg_fatal("could not stat file \"%s\": %s\n",
localpath, strerror(errno));
exists = false;
diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c
index 8565bb9..393baa6 100644
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -218,7 +218,7 @@ receiveFileChunks(const char *sql)
if (PQsendQueryParams(conn, sql, 0, NULL, NULL, NULL, NULL, 1) != 1)
pg_fatal("could not send query: %s\n", PQerrorMessage(conn));
- pg_log(PG_DEBUG, "getting file chunks");
+ pg_log(PG_DEBUG, "getting file chunks\n");
if (PQsetSingleRowMode(conn) != 1)
pg_fatal("could not set libpq connection to single row mode\n");
diff --git a/src/bin/pg_rewind/logging.c b/src/bin/pg_rewind/logging.c
index 0e05f96..5763460 100644
--- a/src/bin/pg_rewind/logging.c
+++ b/src/bin/pg_rewind/logging.c
@@ -137,7 +137,7 @@ progress_report(bool force)
snprintf(fetch_size_str, sizeof(fetch_size_str), INT64_FORMAT,
fetch_size / 1024);
- pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied",
+ pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied\n",
(int) strlen(fetch_size_str), fetch_done_str, fetch_size_str,
percent);
printf("\r");
On Tue, Jun 23, 2015 at 1:39 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
Hi all,
Some grepping is showing up that a couple of newlines are missing in
pg_rewind, leading to unreadable log entries:
libpq_fetch.c: pg_log(PG_DEBUG, "getting file chunks");
logging.c: pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied",
filemap.c: pg_fatal("could not stat file \"%s\": %s",Attached is a patch to fix them.
Please ignore that. It has been fixed yesterday with e98d635.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 06/23/2015 07:39 AM, Michael Paquier wrote:
Hi all,
Some grepping is showing up that a couple of newlines are missing in
pg_rewind, leading to unreadable log entries:
libpq_fetch.c: pg_log(PG_DEBUG, "getting file chunks");
Fixed.
logging.c: pg_log(PG_PROGRESS, "%*s/%s kB (%d%%) copied",
This one was on purpose; note the printf("\r") after that line. That's
supposed to be a progress indicator that is updated on the single line.
filemap.c: pg_fatal("could not stat file \"%s\": %s",
Peter fixed this already.
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers