|
5 | 5 | package io.airbyte.integrations.source.postgres.cdc;
|
6 | 6 |
|
7 | 7 | import static io.airbyte.cdk.db.DbAnalyticsUtils.cdcCursorInvalidMessage;
|
| 8 | +import static io.airbyte.cdk.db.DbAnalyticsUtils.cdcResyncMessage; |
8 | 9 | import static io.airbyte.cdk.db.DbAnalyticsUtils.wassOccurrenceMessage;
|
9 | 10 | import static io.airbyte.integrations.source.postgres.PostgresQueryUtils.streamsUnderVacuum;
|
10 | 11 | import static io.airbyte.integrations.source.postgres.PostgresSpecConstants.FAIL_SYNC_OPTION;
|
11 | 12 | import static io.airbyte.integrations.source.postgres.PostgresSpecConstants.INVALID_CDC_CURSOR_POSITION_PROPERTY;
|
| 13 | +import static io.airbyte.integrations.source.postgres.PostgresSpecConstants.RESYNC_DATA_OPTION; |
12 | 14 | import static io.airbyte.integrations.source.postgres.PostgresUtils.isDebugMode;
|
13 | 15 | import static io.airbyte.integrations.source.postgres.PostgresUtils.prettyPrintConfiguredAirbyteStreamList;
|
14 | 16 | import static io.airbyte.integrations.source.postgres.ctid.CtidUtils.createInitialLoader;
|
@@ -182,8 +184,10 @@ public static List<AutoCloseableIterator<AirbyteMessage>> cdcCtidIteratorsCombin
|
182 | 184 | INVALID_CDC_CURSOR_POSITION_PROPERTY).asText().equals(FAIL_SYNC_OPTION)) {
|
183 | 185 | throw new ConfigErrorException(
|
184 | 186 | "Saved offset is before replication slot's confirmed lsn. Please reset the connection, and then increase WAL retention and/or increase sync frequency to prevent this from happening in the future. See https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#under-cdc-incremental-mode-there-are-still-full-refresh-syncs for more details.");
|
| 187 | + } else if (sourceConfig.get("replication_method").get(INVALID_CDC_CURSOR_POSITION_PROPERTY).asText().equals(RESYNC_DATA_OPTION)) { |
| 188 | + AirbyteTraceMessageUtility.emitAnalyticsTrace(cdcResyncMessage()); |
| 189 | + LOGGER.warn("Saved offset is before Replication slot's confirmed_flush_lsn, Airbyte will trigger sync from scratch"); |
185 | 190 | }
|
186 |
| - LOGGER.warn("Saved offset is before Replication slot's confirmed_flush_lsn, Airbyte will trigger sync from scratch"); |
187 | 191 | } else if (!isDebugMode(sourceConfig) && PostgresUtils.shouldFlushAfterSync(sourceConfig)) {
|
188 | 192 | // We do not want to acknowledge the WAL logs in debug mode.
|
189 | 193 | postgresDebeziumStateUtil.commitLSNToPostgresDatabase(database.getDatabaseConfig(),
|
|
0 commit comments