protected ServerInfo.ReplicationSlot queryForSlot(
            String slotName,
            String database,
            String pluginName,
            ResultSetMapper<ServerInfo.ReplicationSlot> map)
            throws SQLException {
        return prepareQueryAndMap(
                "select * from pg_replication_slots where slot_name = ? and database = ? and plugin = ?",
                statement -> {
                    statement.setString(1, slotName);
                    statement.setString(2, database);
                    statement.setString(3, pluginName);
                },
                map);
    }
Fetches a replication slot, repeating the query until either the slot is created or until the
max number of attempts has been reached

<p>To fetch the slot without the retries, use the {@link
PostgresConnection#fetchReplicationSlotInfo} call

@param slotName the slot name
@param pluginName the name of the plugin
@return the {@link ServerInfo.ReplicationSlot} object or a {@link
    ServerInfo.ReplicationSlot#INVALID} if the slot is not valid
@throws SQLException is thrown by the underyling jdbc driver
@throws InterruptedException is thrown if we don't return an answer within the set number of
    retries
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/postgres-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java