DBZ-599 Emit schema change only for DDL with no errors

This commit is contained in:
Jiri Pechanec 2019-07-10 08:38:08 +02:00
parent 0383f9178c
commit c9997a5fd6

View File

@ -310,7 +310,7 @@ public boolean applyDdl(SourceInfo source, String databaseName, String ddlStatem
} else {
throw e;
}
} finally {
}
changes = tables().drainChanges();
// No need to send schema events or store DDL if no table has changed
if (!storeOnlyMonitoredTablesDdl || ddlChanges.anyMatch(filters.databaseFilter(), filters.tableFilter())) {
@ -354,7 +354,6 @@ public boolean applyDdl(SourceInfo source, String databaseName, String ddlStatem
else {
logger.debug("Changes for DDL '{}' were filtered and not recorded in database history", ddlStatements);
}
}
// Figure out what changed ...
changes.forEach(tableId -> {
@ -369,7 +368,6 @@ public boolean applyDdl(SourceInfo source, String databaseName, String ddlStatem
return true;
}
/**
* @return true if only monitored tables should be stored in database history, false if all tables should be stored
*/