print the opcode when an async callback detects an error
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 2 Jul 2008 02:21:53 +0000 (12:21 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 2 Jul 2008 02:21:53 +0000 (12:21 +1000)
client/ctdb_client.c
include/ctdb_private.h

index 97fae507bd7421febc106938771f315e41aeb259..2158d48debb56fbc2e864e2f6c65a1c1ea2ad75f 100644 (file)
@@ -2685,7 +2685,7 @@ static void async_callback(struct ctdb_client_control_state *state)
        */
        if (state->state != CTDB_CONTROL_DONE) {
                if ( !data->dont_log_errors) {
-                       DEBUG(DEBUG_ERR,("Async operation failed with state %d\n", state->state));
+                       DEBUG(DEBUG_ERR,("Async operation failed with state %d\n opcode:%u", state->state, data->opcode));
                }
                data->fail_count++;
                if (data->fail_callback) {
@@ -2700,7 +2700,7 @@ static void async_callback(struct ctdb_client_control_state *state)
        ret = ctdb_control_recv(ctdb, state, data, &outdata, &res, NULL);
        if ((ret != 0) || (res != 0)) {
                if ( !data->dont_log_errors) {
-                       DEBUG(DEBUG_ERR,("Async operation failed with ret=%d res=%d\n", ret, (int)res));
+                       DEBUG(DEBUG_ERR,("Async operation failed with ret=%d res=%d opcode=%u\n", ret, (int)res, data->opcode));
                }
                data->fail_count++;
                if (data->fail_callback) {
@@ -2769,6 +2769,7 @@ int ctdb_client_async_control(struct ctdb_context *ctdb,
        async_data->callback = client_callback;
        async_data->fail_callback = fail_callback;
        async_data->callback_data = callback_data;
+       async_data->opcode        = opcode;
 
        num_nodes = talloc_get_size(nodes) / sizeof(uint32_t);
 
index b19012f1ec0173dbca1f712fbc4cd125172e654c..0f170f812d183e6ec42787d85da0e0bd1db3b7cc 100644 (file)
@@ -1313,6 +1313,7 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb);
 typedef void (*client_async_callback)(struct ctdb_context *ctdb, uint32_t node_pnn, int32_t res, TDB_DATA outdata, void *callback_data);
 
 struct client_async_data {
+       enum ctdb_controls opcode;
        bool dont_log_errors;
        uint32_t count;
        uint32_t fail_count;