github-actions[bot] commented on code in PR #62269:
URL: https://github.com/apache/doris/pull/62269#discussion_r3056411319


##########
fe/fe-core/src/main/java/org/apache/doris/job/offset/jdbc/JdbcSourceOffsetProvider.java:
##########
@@ -568,6 +568,44 @@ protected boolean isSnapshotOnlyMode() {
         return DataSourceConfigKeys.OFFSET_SNAPSHOT.equalsIgnoreCase(offset);
     }
 
+    @Override
+    public String getLag() {

Review Comment:
   `Lag` is currently computed as `now - last consumed event timestamp` without 
checking whether the job is already caught up. `fetchRemoteMeta()` already 
tracks whether there is newer source data (`hasMoreData` / `endBinlogOffset`), 
but `getLag()` ignores that state. In the idle-but-caught-up case, this will 
grow forever even though backlog is zero. For example, if the latest event was 
consumed at 12:00 and the source stays idle until 13:00, `jobs()` will report 
`Lag = 3600` despite there being nothing left to catch up.



##########
regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_lag.groovy:
##########
@@ -0,0 +1,105 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.awaitility.Awaitility
+
+import static java.util.concurrent.TimeUnit.SECONDS
+
+suite("test_streaming_mysql_job_lag",
+      "p0,external,mysql,external_docker,external_docker_mysql,nondatalake") {

Review Comment:
   This adds coverage for the MySQL `ts_sec` branch only, but the 
implementation also claims PostgreSQL support via `ts_usec`. Because 
`extractEventTimeMs()` falls back to empty lag when the expected key is absent, 
the PostgreSQL path can break without this test suite noticing. Please add a PG 
regression case alongside this one.



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