DBZ-7508 Exit from readChunk after createDataEventsForTable if snapshot is not running anymore

This commit is contained in:
mfvitale 2024-02-20 12:22:06 +01:00 committed by Chris Cranford
parent 4ca2a67b0d
commit 08e46815e4
2 changed files with 5 additions and 1 deletions

View File

@ -342,7 +342,6 @@ public void testStopSnapshotKafkaSignal() throws Exception {
return logInterceptor.containsMessage(tableRemoveMessage);
});
stopConnector();
}
@Test

View File

@ -388,8 +388,13 @@ protected void readChunk(P partition, OffsetContext offsetContext) throws Interr
context.maximumKey().orElse(new Object[0]));
}
}
if (createDataEventsForTable(partition)) {
if (!context.snapshotRunning()) { // A stop signal has been processed and window cleared.
return;
}
if (window.isEmpty()) {
LOGGER.info("No data returned by the query, incremental snapshotting of table '{}' finished",
currentTableId);