davidzollo commented on code in PR #10477:
URL: https://github.com/apache/seatunnel/pull/10477#discussion_r2808490366
##########
seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/fetch/MongodbFetchTaskContext.java:
##########
@@ -166,6 +166,13 @@ public boolean isDataChangeRecord(SourceRecord record) {
public boolean isRecordBetween(
SourceRecord record, @Nonnull Object[] splitStart, @Nonnull
Object[] splitEnd) {
BsonDocument documentKey = getDocumentKey(record);
+ if (documentKey == null) {
+ log.debug(
+ "Record has no documentKey field, skipping range check. "
+ + "This is expected for heartbeat records. Record:
{}",
+ record);
+ return false;
+ }
Review Comment:
It is recommended to use a more precise distinction: if
(isHeartbeatEvent(record)) return false; else log.warn + throw an exception
with context/or at least warn to avoid unexpected scenarios being swallowed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]