Skip to content

Commit

Permalink
Improve error message when a raft transaction is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
freeekanayaka committed Oct 22, 2019
1 parent 4d2d306 commit 6b095fa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/replication.c
@@ -1,13 +1,12 @@
#include <stddef.h>
#include "replication.h"

#include <libco.h>
#include <sqlite3.h>

#include "lib/assert.h"
#include <stddef.h>

#include "command.h"
#include "leader.h"
#include "replication.h"
#include "lib/assert.h"

/* Set to 1 to enable tracing. */
#if 0
Expand Down Expand Up @@ -161,6 +160,14 @@ static int apply(struct replication *r,

rc = raft_apply(r->raft, &apply->req, &buf, 1, applyCb);
if (rc != 0) {
switch (rc) {
case RAFT_TOOBIG:
rc = SQLITE_TOOBIG;
break;
default:
rc = SQLITE_ERROR;
break;
}
goto err_after_command_encode;
}

Expand Down

0 comments on commit 6b095fa

Please sign in to comment.