diff --git a/src/leader.c b/src/leader.c index 9cadad329..30b1ba222 100644 --- a/src/leader.c +++ b/src/leader.c @@ -187,7 +187,8 @@ void leader__close(struct leader *l) tracef("leader close"); int rc; /* TODO: there shouldn't be any ongoing exec request. */ - if (l->exec != NULL) { + if (l->exec != NULL) { + fprintf(stderr, "[INFO FOR COLE] leader close %p\n", l->exec->stmt); assert(l->inflight == NULL); l->exec->status = SQLITE_ERROR; exec_done(l->exec, 0); @@ -458,6 +459,8 @@ static void exec_done(struct exec *req, int asyncness) req->leader->exec = NULL; if (req->cb != NULL && asyncness == 0) { req->cb(req, status); + } else if (asyncness != 0) { + fprintf(stderr, "[INFO FOR COLE] skip callback for %p because asyncness is %d\n", req->stmt, asyncness); } } @@ -540,9 +543,9 @@ static void exec_apply_cb(struct raft_apply *req, static int exec_status(int r) { PRE(r != 0); - return r == RAFT_LEADERSHIPLOST ? SQLITE_IOERR_LEADERSHIP_LOST : - r == RAFT_NOSPACE ? SQLITE_IOERR_WRITE : - r == RAFT_SHUTDOWN ? SQLITE_ABORT : + return r == RAFT_LEADERSHIPLOST ? SQLITE_IOERR_LEADERSHIP_LOST : + r == RAFT_NOSPACE ? SQLITE_IOERR_WRITE : + r == RAFT_SHUTDOWN ? SQLITE_ABORT : SQLITE_IOERR; }