DBZ-7488 Skip re-selection on r
(read) events
This commit is contained in:
parent
3b470c3038
commit
09e1bf1df0
@ -105,6 +105,13 @@ public void apply(Object messageKey, Struct value) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip read events as these are generated from raw JDBC selects which should have the current
|
||||||
|
// state of the row and there is no reason to logically re-select the column state.
|
||||||
|
final String operation = value.getString(Envelope.FieldName.OPERATION);
|
||||||
|
if (Envelope.Operation.READ.code().equals(operation)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final Struct source = value.getStruct(Envelope.FieldName.SOURCE);
|
final Struct source = value.getStruct(Envelope.FieldName.SOURCE);
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
LOGGER.debug("Value has no source field, no re-selection possible.");
|
LOGGER.debug("Value has no source field, no re-selection possible.");
|
||||||
|
@ -106,9 +106,6 @@ public void testNoColumnsReselectedWhenNullAndUnavailableColumnsAreDisabled() th
|
|||||||
@FixFor("DBZ-4321")
|
@FixFor("DBZ-4321")
|
||||||
@SuppressWarnings("resource")
|
@SuppressWarnings("resource")
|
||||||
public void testNoColumnsReselectedWhenNotNullSnapshot() throws Exception {
|
public void testNoColumnsReselectedWhenNotNullSnapshot() throws Exception {
|
||||||
LogInterceptor interceptor = new LogInterceptor(ReselectColumnsPostProcessor.class);
|
|
||||||
interceptor.setLoggerLevel(ReselectColumnsPostProcessor.class, Level.DEBUG);
|
|
||||||
|
|
||||||
databaseConnection().execute(getInsertWithValue());
|
databaseConnection().execute(getInsertWithValue());
|
||||||
|
|
||||||
Configuration config = getConfigurationBuilder()
|
Configuration config = getConfigurationBuilder()
|
||||||
@ -130,8 +127,6 @@ public void testNoColumnsReselectedWhenNotNullSnapshot() throws Exception {
|
|||||||
assertThat(after.get(fieldName("id"))).isEqualTo(1);
|
assertThat(after.get(fieldName("id"))).isEqualTo(1);
|
||||||
assertThat(after.get(fieldName("data"))).isEqualTo("one");
|
assertThat(after.get(fieldName("data"))).isEqualTo("one");
|
||||||
assertThat(after.get(fieldName("data2"))).isEqualTo(1);
|
assertThat(after.get(fieldName("data2"))).isEqualTo(1);
|
||||||
|
|
||||||
assertThat(interceptor.containsMessage("No columns require re-selection.")).isTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user