github-actions[bot] commented on code in PR #70130:
URL: https://github.com/apache/doris/pull/70130#discussion_r4469353831
##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -2110,6 +2110,28 @@ public void gsonPostProcess() throws IOException {
public abstract void modifyProperties(AlterRoutineLoadCommand command)
throws UserException;
+ /**
+ * Checks the workload group an ALTER leaves the job with, in the compute
group the ALTER leaves the job in, as
+ * CREATE does and as every task resolves it ({@code
KafkaTaskInfo#rePlan}): as the owner, whom the tasks run
+ * as. One that group does not have, or the owner may not use, would
otherwise fail every task with the
+ * retryable CREATE_TASKS_ERR, which auto resume repeats for good. Only an
ALTER that sets a workload group or
+ * declares a compute group changes what the tasks look up; a workload
group it does not set is the one the
+ * job keeps. Called on the statement thread before the job lock, never
when an ALTER is replayed.
+ */
+ protected void checkAlteredWorkloadGroup(Map<String, String>
alteredJobProperties) throws UserException {
+ String declaredComputeGroup = alteredJobProperties.get(COMPUTE_GROUP);
+ String alteredWorkloadGroup = alteredJobProperties.get(WORKLOAD_GROUP);
+ if (StringUtils.isEmpty(declaredComputeGroup) &&
StringUtils.isEmpty(alteredWorkloadGroup)) {
+ return;
+ }
+ String workloadGroup = StringUtils.isEmpty(alteredWorkloadGroup) ?
getWorkloadGroup() : alteredWorkloadGroup;
Review Comment:
[P1] Validate the resulting workload-group tuple under the job lock.
`checkAlteredWorkloadGroup` reads the current `jobProperties` and
`cloudCluster` before `KafkaRoutineLoadJob`/`KinesisRoutineLoadJob` acquire
their write lock, while `RoutineLoadManager` permits concurrent ALTERs after
releasing its manager read lock. For a job at (cg_a, wg_old), concurrent ALTERs
that set `workload_group=wg_x` and `compute_group=cg_b` can each validate a
different tuple, then commit as (cg_b, wg_x) even if that workload group is
absent in cg_b. Recheck the effective tuple while holding the job lock (or
otherwise serialize validation with mutation) before writing the operation log,
while preserving Kafka's offset conversion behavior.
--
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]