DBZ-6353 Use correct SQL codes for other cases
This commit is contained in:
parent
6ced91fe53
commit
ab5d643aa8
@ -189,6 +189,7 @@ Helong Zhang
|
||||
Henrik Schnell
|
||||
Henry Cai
|
||||
Henryk Konsek
|
||||
Hidetomi Umaki
|
||||
Himanshu Mishra
|
||||
Hoa Le
|
||||
Horia Chiorean
|
||||
|
@ -59,6 +59,8 @@
|
||||
*/
|
||||
public class PostgresReplicationConnection extends JdbcConnection implements ReplicationConnection {
|
||||
|
||||
private static final String SQL_STATE_INSUFFICIENT_PRIVILEGE = "42501";
|
||||
|
||||
private static Logger LOGGER = LoggerFactory.getLogger(PostgresReplicationConnection.class);
|
||||
|
||||
private final String slotName;
|
||||
@ -431,11 +433,13 @@ protected void validateSlotIsInExpectedState(WalPositionLocator walPosition) thr
|
||||
LOGGER.info("Postgres server doesn't support the command pg_replication_slot_advance(). Not seeking to last known offset.");
|
||||
}
|
||||
else if (e.getMessage().matches("ERROR: must be superuser or replication role to use replication slots(.|\\n)*")
|
||||
|| PSQLState.OBJECT_IN_USE.getState().equals(e.getSQLState())) {
|
||||
LOGGER.warn("Unable to use pg_replication_slot_advance() function. The Postgres server is likely on an old RDS version", e);
|
||||
|| SQL_STATE_INSUFFICIENT_PRIVILEGE.equals(e.getSQLState())) {
|
||||
LOGGER.warn(
|
||||
"Unable to use pg_replication_slot_advance() function. The Postgres server is likely on an old RDS version or privileges are not correctly set",
|
||||
e);
|
||||
}
|
||||
else if (e.getMessage().matches("ERROR: cannot advance replication slot to.*")
|
||||
|| PSQLState.NOT_IMPLEMENTED.getState().equals(e.getSQLState())) {
|
||||
|| PSQLState.OBJECT_NOT_IN_STATE.getState().equals(e.getSQLState())) {
|
||||
switch (connectorConfig.getEventProcessingFailureHandlingMode()) {
|
||||
case FAIL:
|
||||
case WARN:
|
||||
|
@ -205,4 +205,5 @@ brenoavm,Breno Moreira
|
||||
ddsr-ops,ddsr-ops
|
||||
subkanthi,Kanthi Subramanian
|
||||
benw-at-birdie,Ben White
|
||||
miguelbirdie, Miguel Angel Sotomayor
|
||||
miguelbirdie,Miguel Angel Sotomayor
|
||||
umachi,Hidetomi Umaki
|
||||
|
Loading…
Reference in New Issue
Block a user