ctdb-daemon: Remove setting of debug_extra from switch_from_server_to_client()
authorAmitay Isaacs <amitay@gmail.com>
Fri, 25 Nov 2016 03:44:10 +0000 (14:44 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 5 Dec 2016 07:09:22 +0000 (08:09 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_call.c
ctdb/server/ctdb_daemon.c
ctdb/server/ctdb_recoverd.c
ctdb/server/ctdb_takeover.c
ctdb/server/ctdb_traverse.c
ctdb/server/ctdb_vacuum.c

index 3dc090ccaa7b8750e47192ee16e224233dabeff3..8520b8e63de24cb353fca2ecad33e9bd3a884f7c 100644 (file)
@@ -599,8 +599,7 @@ int ctdb_control_getnodesfile(struct ctdb_context *ctdb, uint32_t opcode,
 
 void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code);
 
-int switch_from_server_to_client(struct ctdb_context *ctdb,
-                                const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
+int switch_from_server_to_client(struct ctdb_context *ctdb);
 
 /* From server/ctdb_fork.c */
 
index 670491132ab2485a6340ad8ec291635aa5cfbbf8..fed52ccb6c7a14d53a0fb1daec104050771592d9 100644 (file)
@@ -1856,7 +1856,7 @@ int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_contex
                debug_extra = talloc_asprintf(NULL, "revokechild-%s:", ctdb_db->db_name);
 
                prctl_set_comment("ctdb_revokechild");
-               if (switch_from_server_to_client(ctdb, "revokechild-%s", ctdb_db->db_name) != 0) {
+               if (switch_from_server_to_client(ctdb) != 0) {
                        DEBUG(DEBUG_ERR,("Failed to switch from server to client for revokechild process\n"));
                        c = 1;
                        goto child_finished;
index 326d9c0a19799e0d08927dd699f22993b35f4217..b91099d0623d6f8b93b25af248f74f7e336efac5 100644 (file)
@@ -1851,15 +1851,9 @@ void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code)
  * process must be created using ctdb_fork() and not fork() -
  * ctdb_fork() does some necessary housekeeping.
  */
-int switch_from_server_to_client(struct ctdb_context *ctdb, const char *fmt, ...)
+int switch_from_server_to_client(struct ctdb_context *ctdb)
 {
        int ret;
-       va_list ap;
-
-       /* Add extra information so we can identify this in the logs */
-       va_start(ap, fmt);
-       debug_extra = talloc_strdup_append(talloc_vasprintf(NULL, fmt, ap), ":");
-       va_end(ap);
 
        /* get a new event context */
        ctdb->ev = tevent_context_init(ctdb);
index c310102ed863d4a67cc401ce8f2d54bdd3cf4546..2ea8a6929605a4ca91a8b5f4af9659766fdf3a20 100644 (file)
@@ -3137,7 +3137,7 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb)
        srandom(getpid() ^ time(NULL));
 
        prctl_set_comment("ctdb_recovered");
-       if (switch_from_server_to_client(ctdb, "recoverd") != 0) {
+       if (switch_from_server_to_client(ctdb) != 0) {
                DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch recovery daemon into client mode. shutting down.\n"));
                exit(1);
        }
index c2ae1df21bf6a2586da7478d17f516baa8d98cf3..4251aef0bd4cabd2610f42dbcc4e7cb648eaa7ae 100644 (file)
@@ -3114,7 +3114,7 @@ int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_re
                debug_extra = talloc_asprintf(NULL, "reloadips:");
 
                prctl_set_comment("ctdb_reloadips");
-               if (switch_from_server_to_client(ctdb, "reloadips-child") != 0) {
+               if (switch_from_server_to_client(ctdb) != 0) {
                        DEBUG(DEBUG_CRIT,("ERROR: Failed to switch reloadips child into client mode\n"));
                        res = -1;
                } else {
index 1f9504224adad517d657c25bd69c30496c5956a1..7fba1295909c1206161ff85630d7a38a6e640311 100644 (file)
@@ -220,8 +220,7 @@ static struct ctdb_traverse_local_handle *ctdb_traverse_local(struct ctdb_db_con
                close(h->fd[0]);
 
                prctl_set_comment("ctdb_traverse");
-               if (switch_from_server_to_client(ctdb, "traverse_local-%s:",
-                                                ctdb_db->db_name) != 0) {
+               if (switch_from_server_to_client(ctdb) != 0) {
                        DEBUG(DEBUG_CRIT, ("Failed to switch traverse child into client mode\n"));
                        _exit(0);
                }
index 5ffab1deb80a424b2a97a525433f31aefd66a30e..240b8dcc9a7f499e6ee254c49b1495ffbf1708b4 100644 (file)
@@ -1507,7 +1507,7 @@ static void ctdb_vacuum_event(struct tevent_context *ev,
 
                DEBUG(DEBUG_INFO,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name));
                prctl_set_comment("ctdb_vacuum");
-               if (switch_from_server_to_client(ctdb, "vacuum-%s", ctdb_db->db_name) != 0) {
+               if (switch_from_server_to_client(ctdb) != 0) {
                        DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch vacuum daemon into client mode. Shutting down.\n"));
                        _exit(1);
                }