summaryrefslogtreecommitdiffstats
path: root/ctdb/client/ctdb_client.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-11-13 17:45:25 +1100
committerMichael Adam <obnox@samba.org>2013-11-27 18:46:16 +0100
commit8dc416c06912cd0bca5380b29064a3e620b26afc (patch)
tree6a5eb19f092fcc30fbd1308d01d6149800296c4b /ctdb/client/ctdb_client.c
parent6179c3aef83c3c6ecd96c04a0df3ce1fca3d9cea (diff)
downloadsamba-8dc416c06912cd0bca5380b29064a3e620b26afc.tar.gz
samba-8dc416c06912cd0bca5380b29064a3e620b26afc.tar.xz
samba-8dc416c06912cd0bca5380b29064a3e620b26afc.zip
ctdb-client: Treat empty __db_sequence_number__ record as 0
This fixes the issue of transaction commit failing due to an empty __db_sequence_number__ record in persistent database left by previous cancelled transaction. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/client/ctdb_client.c')
-rw-r--r--ctdb/client/ctdb_client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index e2eccb7b72..885dbfdfb4 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -4186,6 +4186,11 @@ static int ctdb_fetch_db_seqnum(struct ctdb_db_context *ctdb_db, uint64_t *seqnu
return 0;
}
+ if (data.dsize == 0) {
+ *seqnum = 0;
+ return 0;
+ }
+
if (data.dsize != sizeof(*seqnum)) {
DEBUG(DEBUG_ERR, (__location__ " Invalid data recived len=%zi\n",
data.dsize));