Skip to content

Commit bc9d9da

Browse files
authored
fix log message parameters (#1303)
1 parent 58fc316 commit bc9d9da

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

wrapper/src/main/java/software/amazon/jdbc/plugin/failover2/FailoverConnectionPlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ protected void failoverWriter() throws SQLException {
561561
this.failoverWriterFailedCounter.inc();
562562
LOGGER.severe(
563563
Messages.get("Failover.exceptionConnectingToWriter", new Object[]{writerCandidate.getHost()}));
564-
throw new FailoverFailedSQLException(Messages.get("Failover.exceptionConnectingToWriter"), ex);
564+
throw new FailoverFailedSQLException(
565+
Messages.get("Failover.exceptionConnectingToWriter", new Object[]{writerCandidate.getHost()}), ex);
565566
}
566567

567568
HostRole role = this.pluginService.getHostRole(writerCandidateConn);
@@ -574,7 +575,8 @@ protected void failoverWriter() throws SQLException {
574575
this.failoverWriterFailedCounter.inc();
575576
LOGGER.severe(
576577
Messages.get("Failover.unexpectedReaderRole", new Object[]{writerCandidate.getHost(), role}));
577-
throw new FailoverFailedSQLException(Messages.get("Failover.unexpectedReaderRole"));
578+
throw new FailoverFailedSQLException(
579+
Messages.get("Failover.unexpectedReaderRole", new Object[]{writerCandidate.getHost(), role}));
578580
}
579581

580582
this.pluginService.setCurrentConnection(writerCandidateConn, writerCandidate);
@@ -659,7 +661,7 @@ protected boolean shouldExceptionTriggerConnectionSwitch(final Throwable t) {
659661
return false;
660662
}
661663

662-
return this.pluginService.isNetworkException(t);
664+
return this.pluginService.isNetworkException(t, this.pluginService.getTargetDriverDialect());
663665
}
664666

665667
/**

wrapper/src/main/resources/aws_advanced_jdbc_wrapper_messages.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ Failover.startReaderFailover=Starting reader failover procedure.
195195
Failover.invalidNode=Node is no longer available in the topology: {0}
196196
Failover.newWriterNotAllowed=The failover process identified the new writer but the host is not in the list of allowed hosts. New writer host: ''{0}''. Allowed hosts: {1}
197197
Failover.noOperationsAfterConnectionClosed=No operations allowed after connection closed.
198-
Failover.noWriterHost=Unable to find writer in updated host list:
198+
Failover.noWriterHost=Unable to find writer in updated host list.
199+
Failover.readerCandidateNull=Unable to find reader in updated host list:
199200
Failover.readerFailoverElapsed=Reader failover elapsed in {0} ms.
200201
Failover.writerFailoverElapsed=Writer failover elapsed in {0} ms.
201202
Failover.failedReaderConnection=[Reader Failover] Failed to connect to host: ''{0}''

0 commit comments

Comments
 (0)