1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-daemon: Remove setting of debug_extra from switch_from_server_to_client()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-11-25 14:44:10 +11:00 committed by Martin Schwenke
parent ca55652575
commit 3d6860b275
7 changed files with 7 additions and 15 deletions

View 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 */

View 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;

View 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);

View 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);
}

View 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 {

View 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);
}

View 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);
}