s3-ctdb: Return an error when unexpected reply is received
authorAmitay Isaacs <amitay@gmail.com>
Fri, 24 Jun 2016 09:22:02 +0000 (19:22 +1000)
committerVolker Lendecke <vl@samba.org>
Fri, 24 Jun 2016 20:39:23 +0000 (22:39 +0200)
CTDB can send CTDB_REPLY_ERROR in case it encounters an error condition.
This is treated as successful migration as "ret" is not set.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 24 22:39:23 CEST 2016 on sn-devel-144

source3/lib/ctdbd_conn.c

index 8403b30896f0285a27b7434a15020b9d52c8315d..d073c72df088aa6e186aa534992ec64028f69be1 100644 (file)
@@ -763,7 +763,12 @@ int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key)
        }
 
        if (hdr->operation != CTDB_REPLY_CALL) {
-               DEBUG(0, ("received invalid reply\n"));
+               if (hdr->operation == CTDB_REPLY_ERROR) {
+                       DBG_ERR("received error from ctdb\n");
+               } else {
+                       DBG_ERR("received invalid reply\n");
+               }
+               ret = EIO;
                goto fail;
        }