When set the server-id dynamically, the server_id member of current thread is not updated. Update the server_id member of current thread after updated the global variable value.