From 3a8b5412ccb536b21cb61b9187c96ba3c2b170a5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 27 Oct 2022 22:45:24 +0300 Subject: [PATCH] replicator: Log dsync error code in debug message --- src/replication/replicator/dsync-client.c | 2 +- src/replication/replicator/replicator-brain.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/replication/replicator/dsync-client.c b/src/replication/replicator/dsync-client.c index a0208e49c0..939dc000ce 100644 --- a/src/replication/replicator/dsync-client.c +++ b/src/replication/replicator/dsync-client.c @@ -139,7 +139,7 @@ static int dsync_input_line(struct dsync_client *client, const char *line) else if (strcmp(line+1, "NOREPLICATE") == 0) dsync_callback(client, "", DSYNC_REPLY_NOREPLICATE); else - dsync_callback(client, "", DSYNC_REPLY_FAIL); + dsync_callback(client, line+1, DSYNC_REPLY_FAIL); } else { e_error(client->event, "Invalid input: %s", line); return -1; diff --git a/src/replication/replicator/replicator-brain.c b/src/replication/replicator/replicator-brain.c index 88fe2de5a2..8e40b8887b 100644 --- a/src/replication/replicator/replicator-brain.c +++ b/src/replication/replicator/replicator-brain.c @@ -142,13 +142,13 @@ static void dsync_callback(enum dsync_reply reply, const char *state, replicator_queue_remove(ctx->brain->queue, &ctx->user); } else { i_free(ctx->user->state); - ctx->user->state = i_strdup_empty(state); ctx->user->last_sync_failed = reply != DSYNC_REPLY_OK; if (reply == DSYNC_REPLY_OK) { e_debug(ctx->event, "User was successfully synced"); + ctx->user->state = i_strdup_empty(state); ctx->user->last_successful_sync = ioloop_time; } else { - e_debug(ctx->event, "User sync failed"); + e_debug(ctx->event, "User sync failed: %s", state); } replicator_queue_push(ctx->brain->queue, ctx->user); } -- 2.47.3