SbloodyS commented on PR #18667:
URL: 
https://github.com/apache/dolphinscheduler/pull/18667#issuecomment-6306648766

   ### Associate each JobID with its own YARN application
   
   [Source evidence] 
`dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkStreamTask.java:76–86,101–104`
   
   `getYarnApplicationId()` selects `appIds.get(0)`, and `savePoint()` reuses 
it for every JobID. A SQL script using `yarn-per-job` can submit jobs into 
separate YARN applications, so savepoints for jobs in other applications target 
the wrong cluster.
   
   Additionally, `LogUtils` collects application IDs in a `HashSet`, so the 
selected application is not necessarily the first submitted one.
   
   Please retain the actual JobID-to-application association and add coverage 
with two jobs in different YARN applications. Pairing the existing lists by 
index would also be unsafe.
   
   ### Include CTAS submissions in the connection snapshots
   
   [Source evidence] 
`dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java:133–134,335–346`
   
   Only `INSERT`, `UPDATE`, and `DELETE` record a job snapshot. Flink also 
submits jobs for `CREATE TABLE ... AS SELECT`, and its SQL Client prints their 
JobIDs through the normal submission path.
   
   If CTAS submits job A to cluster-a, followed by an INSERT submitting job B 
to cluster-b, only B records a snapshot. The index-based mapping consequently 
assigns cluster-b's settings to job A, breaking cancellation and savepoints.
   
   Please account for these job-producing operations and add coverage with CTAS 
followed by an INSERT on a different endpoint.
   
   Reference: 
https://github.com/apache/flink/blob/release-1.20/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java#L838-L875
   
   ### Preserve token boundaries when removing block comments
   
   [Source evidence] 
`dolphinscheduler-task-plugin/dolphinscheduler-task-flink/src/main/java/org/apache/dolphinscheduler/plugin/task/flink/FlinkArgsUtils.java:364–366`
   
   Block comments are removed without inserting whitespace. For example, this 
valid statement:
   
   ```sql
   INSERT/* comment */INTO t SELECT * FROM s;
   ```
   
   becomes `INSERTINTO t SELECT * FROM s`, which no longer matches the 
job-statement pattern.
   
   When another job follows after an endpoint change, the missing snapshot 
shifts the JobID-to-connection mapping and sends cancellation/savepoint 
commands to the wrong cluster. The same issue prevents recognition of:
   
   ```sql
   SET/* comment */ 'rest.address' = 'cluster-a';
   ```
   
   Please preserve comments as token separators and add coverage for comments 
between keywords and their following tokens.


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

Reply via email to