diff --git a/driver/failover_handler.cc b/driver/failover_handler.cc index bf435e512..b4a3cd5dd 100644 --- a/driver/failover_handler.cc +++ b/driver/failover_handler.cc @@ -380,6 +380,12 @@ bool FAILOVER_HANDLER::should_connect_to_new_writer(const char* host) { ds_set_wstrnattr(&dbc->ds->server, (SQLWCHAR*)writer_host_wstr.c_str(), writer_host_wstr.size()); ds_set_strnattr(&dbc->ds->server8, (SQLCHAR*)writer_host.c_str(), writer_host.size()); + std::string suffix = ".proxied"; + if (writer_host.compare(writer_host.length() - suffix.length(), suffix.length(), suffix) == 0) { + MYLOG_TRACE(init_log_file().get(), 0, "[FAILOVER_HANDLER] Updating port to 8666"); + dbc->ds->port = 8666; + } + MYLOG_TRACE(init_log_file().get(), 0, "[FAILOVER_HANDLER] returning true"); return true; }