]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replicator: Log dsync error code in debug message
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 27 Oct 2022 19:45:24 +0000 (22:45 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 31 Oct 2022 12:09:10 +0000 (14:09 +0200)
src/replication/replicator/dsync-client.c
src/replication/replicator/replicator-brain.c

index a0208e49c02ebbcf5bab5efc83c491024cc515f4..939dc000cecacbbbbe3500da8fb4441154d999ba 100644 (file)
@@ -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;
index 88fe2de5a284d0c1d6fe03dc59111cc7ffcc4415..8e40b8887bf0a5128267e6abb2a8887bb387f47c 100644 (file)
@@ -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);
        }