New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBZ-2288 Events in exported snapshot no longer filtered by LSN #1697
Changes from 2 commits
1d7af47
e6379ff
a2fc4a6
c4e0a1f
12c9421
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -88,6 +88,7 @@ public class PostgresReplicationConnection extends JdbcConnection implements Rep | |||||
* @param dropSlotOnClose whether the replication slot should be dropped once the connection is closed | ||||||
* @param statusUpdateInterval the interval at which the replication connection should periodically send status | ||||||
* @param exportSnapshot whether the replication should export a snapshot when created | ||||||
* @param exportSnapshot whether the connector is doing snapshot | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param typeRegistry registry with PostgreSQL types | ||||||
* @param streamParams additional parameters to pass to the replication stream | ||||||
* @param schema the schema; must not be null | ||||||
|
@@ -102,6 +103,7 @@ private PostgresReplicationConnection(Configuration config, | |||||
PostgresConnectorConfig.LogicalDecoder plugin, | ||||||
boolean dropSlotOnClose, | ||||||
boolean exportSnapshot, | ||||||
boolean doSnapshot, | ||||||
Duration statusUpdateInterval, | ||||||
TypeRegistry typeRegistry, | ||||||
Properties streamParams, | ||||||
|
@@ -117,7 +119,7 @@ private PostgresReplicationConnection(Configuration config, | |||||
this.dropSlotOnClose = dropSlotOnClose; | ||||||
this.statusUpdateInterval = statusUpdateInterval; | ||||||
this.exportSnapshot = exportSnapshot; | ||||||
this.messageDecoder = plugin.messageDecoder(new MessageDecoderConfig(config, schema, publicationName)); | ||||||
this.messageDecoder = plugin.messageDecoder(new MessageDecoderConfig(config, schema, publicationName, exportSnapshot, doSnapshot)); | ||||||
this.typeRegistry = typeRegistry; | ||||||
this.streamParams = streamParams; | ||||||
this.slotCreationInfo = null; | ||||||
|
@@ -475,6 +477,7 @@ public boolean readPending(ReplicationMessageProcessor processor) throws SQLExce | |||||
|
||||||
private void deserializeMessages(ByteBuffer buffer, ReplicationMessageProcessor processor) throws SQLException, InterruptedException { | ||||||
lastReceivedLsn = stream.getLastReceiveLSN(); | ||||||
LOGGER.trace("Received message at LSN {}", lastReceivedLsn); | ||||||
messageDecoder.processMessage(buffer, processor, typeRegistry); | ||||||
} | ||||||
|
||||||
|
@@ -616,6 +619,7 @@ protected static class ReplicationConnectionBuilder implements Builder { | |||||
private boolean dropSlotOnClose = DEFAULT_DROP_SLOT_ON_CLOSE; | ||||||
private Duration statusUpdateIntervalVal; | ||||||
private boolean exportSnapshot = DEFAULT_EXPORT_SNAPSHOT; | ||||||
private boolean doSnapshot; | ||||||
private TypeRegistry typeRegistry; | ||||||
private PostgresSchema schema; | ||||||
private Properties slotStreamParams = new Properties(); | ||||||
|
@@ -696,11 +700,17 @@ public Builder exportSnapshotOnCreate(boolean exportSnapshot) { | |||||
return this; | ||||||
} | ||||||
|
||||||
@Override | ||||||
public Builder doSnapshot(boolean doSnapshot) { | ||||||
this.doSnapshot = doSnapshot; | ||||||
return this; | ||||||
} | ||||||
|
||||||
@Override | ||||||
public ReplicationConnection build() { | ||||||
assert plugin != null : "Decoding plugin name is not set"; | ||||||
return new PostgresReplicationConnection(config, slotName, publicationName, tableFilter, publicationAutocreateMode, plugin, dropSlotOnClose, exportSnapshot, | ||||||
statusUpdateIntervalVal, typeRegistry, slotStreamParams, schema); | ||||||
doSnapshot, statusUpdateIntervalVal, typeRegistry, slotStreamParams, schema); | ||||||
} | ||||||
|
||||||
@Override | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -206,6 +206,14 @@ interface Builder { | |||||
*/ | ||||||
Builder exportSnapshotOnCreate(final boolean exportSnapshot); | ||||||
|
||||||
/** | ||||||
* Whether or not the snapshot is executed | ||||||
* @param doSnapshot true if a snapshot should is going to be executed, false if otherwise | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @return this instance | ||||||
* @see #DEFAULT_EXPORT_SNAPSHOT | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't apply here? |
||||||
*/ | ||||||
Builder doSnapshot(final boolean doSnapshot); | ||||||
|
||||||
/** | ||||||
* Creates a new {@link ReplicationConnection} instance | ||||||
* @return a connection, never null | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But are you skipping it in this case?