diff --git a/include/maxscale/server.h b/include/maxscale/server.h index 46dfcc3c9..2be3bf4c5 100644 --- a/include/maxscale/server.h +++ b/include/maxscale/server.h @@ -375,23 +375,6 @@ inline bool server_is_disk_space_exhausted(const SERVER* server) */ extern SERVER* server_alloc(const char *name, MXS_CONFIG_PARAMETER* params); -/** - * @brief Find a server that can be reused - * - * A server that has been destroyed will not be deleted but only deactivated. - * - * @param name Name of the server - * @param protocol Protocol used by the server - * @param authenticator The authenticator module of the server - * @param address The network address of the new server - * @param port The port of the new server - * - * @return Repurposed SERVER or NULL if no servers matching the criteria were - * found - * @see runtime_create_server - */ -SERVER* server_repurpose_destroyed(const char *name, const char *protocol, const char *authenticator, - const char *address, const char *port); /** * @brief Serialize a server to a file * diff --git a/server/core/config_runtime.cc b/server/core/config_runtime.cc index bcefd6525..930dc3c22 100644 --- a/server/core/config_runtime.cc +++ b/server/core/config_runtime.cc @@ -235,18 +235,7 @@ bool runtime_create_server(const char *name, const char *address, const char *po config_replace_param(&ctx, "authenticator", authenticator); } - /** First check if this service has been created before */ - SERVER *server = server_repurpose_destroyed(name, protocol, authenticator, - address, port); - - if (server) - { - MXS_INFO("Reusing server '%s'", name); - } - else - { - server = server_alloc(name, ctx.parameters); - } + SERVER *server = server_alloc(name, ctx.parameters); if (server && server_serialize(server)) { diff --git a/server/core/server.cc b/server/core/server.cc index c27e014ef..58b5a5233 100644 --- a/server/core/server.cc +++ b/server/core/server.cc @@ -1252,27 +1252,6 @@ bool server_serialize(const SERVER *server) return rval; } -SERVER* server_repurpose_destroyed(const char *name, const char *protocol, const char *authenticator, - const char *address, const char *port) -{ - Guard guard(server_lock); - - for (Server* server : all_servers) - { - if (!server->is_active && - strcmp(server->name, name) == 0 && - strcmp(server->protocol, protocol) == 0 && - strcmp(server->authenticator, authenticator) == 0) - { - snprintf(server->address, sizeof(server->address), "%s", address); - server->port = atoi(port); - server->is_active = true; - return server; - } - } - - return nullptr; -} /** * Set a status bit in the server under a lock. This ensures synchronization * with the server monitor thread. Calling this inside the monitor will likely