Copilot commented on code in PR #61389:
URL: https://github.com/apache/doris/pull/61389#discussion_r2944943492


##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/source/reader/mysql/MySqlSourceReader.java:
##########
@@ -163,7 +163,7 @@ public List<AbstractSourceSplit> 
getSourceSplits(FetchTableSplitsRequest ftsReq)
         StartupMode startupMode = sourceConfig.getStartupOptions().startupMode;
         List<MySqlSnapshotSplit> remainingSnapshotSplits = new ArrayList<>();
         MySqlBinlogSplit remainingBinlogSplit = null;
-        if (startupMode.equals(StartupMode.INITIAL)) {
+        if (startupMode.equals(StartupMode.INITIAL) || 
startupMode.equals(StartupMode.SNAPSHOT)) {
             remainingSnapshotSplits =

Review Comment:
   In snapshot/initial startup modes, `remainingBinlogSplit` is left as null, 
but if `startSplitChunks(...)` returns an empty list the code falls through to 
the `else` branch and dereferences `remainingBinlogSplit` (NPE). Please handle 
the “no snapshot splits generated” case explicitly (e.g., throw a clear 
exception, or ensure a valid split is created for snapshot mode, and only build 
a binlog split when one is actually initialized).



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to