Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions common/lib/host_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export class HostInfo {
return this.port != HostInfo.NO_PORT;
}

getHostAndPort(): string {
return this.isPortSpecified() ? this.host + ":" + this.port : this.host;
}

addAlias(...alias: string[]) {
if (!alias || alias.length < 1) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ export class HostMonitor {
}

const latestWriterHostInfo: HostInfo = hosts.find((x) => x.role === HostRole.WRITER);
if (latestWriterHostInfo && writerHostInfo && latestWriterHostInfo.getHostAndPort() !== writerHostInfo.getHostAndPort()) {
if (latestWriterHostInfo && writerHostInfo && latestWriterHostInfo.hostAndPort !== writerHostInfo.hostAndPort) {
this.writerChanged = true;
logger.debug(Messages.get("HostMonitor.writerHostChanged", writerHostInfo.getHostAndPort(), latestWriterHostInfo.getHostAndPort()));
logger.debug(Messages.get("HostMonitor.writerHostChanged", writerHostInfo.hostAndPort, latestWriterHostInfo.hostAndPort));
this.monitor.updateTopologyCache(hosts);
logger.debug(logTopology(hosts, `[hostMonitor ${this.hostInfo.hostId}] `));
}
Expand Down
4 changes: 2 additions & 2 deletions common/lib/plugins/bluegreen/blue_green_interim_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class BlueGreenInterimStatus {
this.startTopology == null
? ""
: this.startTopology
.map((x) => x.getHostAndPort() + x.role)
.map((x) => x.hostAndPort + x.role)
.sort()
.join(",")
);
Expand All @@ -114,7 +114,7 @@ export class BlueGreenInterimStatus {
this.currentTopology == null
? ""
: this.currentTopology
.map((x) => x.getHostAndPort() + x.role)
.map((x) => x.hostAndPort + x.role)
.sort()
.join(",")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ export class BlueGreenStatusProvider {
logger.debug(
"Corresponding hosts:\n" +
Array.from(this.correspondingHosts.entries())
.map(([key, value]) => ` ${key} -> ${value.right == null ? "<null>" : value.right.getHostAndPort()}`)
.map(([key, value]) => ` ${key} -> ${value.right == null ? "<null>" : value.right.hostAndPort}`)
.join("\n")
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { PluginService } from "../../../plugin_service";
export abstract class BaseConnectRouting extends BaseRouting implements ConnectRouting {
isMatch(hostInfo: HostInfo, hostRole: BlueGreenRole): boolean {
return (
(this.hostAndPort === null || this.hostAndPort === (hostInfo ?? hostInfo.getHostAndPort().toLowerCase())) &&
(this.hostAndPort === null || this.hostAndPort === (hostInfo ?? hostInfo.hostAndPort.toLowerCase())) &&
(this.role === null || this.role === hostRole)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ConnectionPlugin } from "../../../connection_plugin";
export abstract class BaseExecuteRouting extends BaseRouting implements ExecuteRouting {
isMatch(hostInfo: HostInfo, hostRole: BlueGreenRole): boolean {
return (
(this.hostAndPort === null || this.hostAndPort === (hostInfo ?? hostInfo.getHostAndPort().toLowerCase())) &&
(this.hostAndPort === null || this.hostAndPort === (hostInfo ?? hostInfo.hostAndPort.toLowerCase())) &&
(this.role === null || this.role === hostRole)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export class SubstituteConnectRouting extends BaseConnectRouting {
// try with another IAM host
}
}
throw new AwsWrapperError(Messages.get("Bgd.inProgressCantOpenConnection", this.substituteHost.getHostAndPort()));
throw new AwsWrapperError(Messages.get("Bgd.inProgressCantOpenConnection", this.substituteHost.hostAndPort));
}

toString(): string {
return `${this.constructor.name} [${this.hostAndPort ?? "<null>"}, ${this.role?.name ?? "<null>"}, substitute: ${this.substituteHost?.getHostAndPort() ?? "<null>"}, iamHosts: ${
this.iamHosts?.map((host) => host.getHostAndPort()).join(", ") ?? "<null>"
return `${this.constructor.name} [${this.hostAndPort ?? "<null>"}, ${this.role?.name ?? "<null>"}, substitute: ${this.substituteHost?.hostAndPort ?? "<null>"}, iamHosts: ${
this.iamHosts?.map((host) => host.hostAndPort).join(", ") ?? "<null>"
}]`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class OpenedConnectionTracker {

// Check if the connection was established using an instance endpoint
if (OpenedConnectionTracker.rdsUtils.isRdsInstance(hostInfo.host)) {
this.trackConnection(hostInfo.getHostAndPort(), client);
this.trackConnection(hostInfo.hostAndPort, client);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion common/lib/plugins/failover2/failover2_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Failover2Plugin extends AbstractConnectionPlugin implements CanRele
return await this._staleDnsHelper.getVerifiedConnection(hostInfo.host, isInitialConnection, this.hostListProviderService!, props, connectFunc);
}

const hostInfoWithAvailability: HostInfo = this.pluginService.getHosts().find((x) => x.getHostAndPort() === hostInfo.getHostAndPort());
const hostInfoWithAvailability: HostInfo = this.pluginService.getHosts().find((x) => x.hostAndPort === hostInfo.hostAndPort);

let client: ClientWrapper = null;
if (!hostInfoWithAvailability || hostInfoWithAvailability.getAvailability() != HostAvailability.NOT_AVAILABLE) {
Expand Down