SbloodyS commented on PR #18667: URL: https://github.com/apache/dolphinscheduler/pull/18667#issuecomment-6230547282
### Handle SQL comments before associating connection snapshots with JobIDs File: `dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java`, lines 131–135 and 288–297. The regex only recognizes an INSERT immediately after a line boundary or semicolon, allowing whitespace in between. A valid statement prefixed with a block comment is missed: ```sql SET 'rest.address' = 'cluster-a'; /* first job */ INSERT INTO t SELECT * FROM s; SET 'rest.address' = 'cluster-b'; INSERT INTO u SELECT * FROM v; ``` Only the second INSERT creates a snapshot. However, `cancelFlinkJob()` and `savePoint()` associate snapshots with observed JobIDs by list index, so the first job receives cluster-b's settings and cannot be controlled at its actual endpoint. Please use comment- and string-aware statement parsing before constructing the snapshots. Add cancel/savepoint coverage for comments preceding INSERT statements and verify that each observed JobID retains the correct endpoint. ### Apply RESET statements to the effective connection configuration File: `dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java`, lines 280–317. The configuration tracker applies SET statements but ignores RESET. For example, when the default endpoint is cluster-a: ```sql SET 'rest.address' = 'cluster-b'; INSERT INTO t SELECT * FROM s; RESET 'rest.address'; INSERT INTO u SELECT * FROM v; ``` The second job uses the default endpoint, but the tracker retains cluster-b for both jobs. Cancellation and savepoints therefore target the wrong cluster for the second job. Please handle both keyed RESET and RESET-all, restoring the effective baseline configuration. Cover both forms through per-job extraction and control-command construction. -- 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]
