morningman commented on code in PR #69749:
URL: https://github.com/apache/doris/pull/69749#discussion_r4430768727
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateRoutineLoadInfo.java:
##########
@@ -599,18 +649,35 @@ public void checkJobProperties() throws UserException {
RoutineLoadJob.DEFAULT_LOAD_TO_SINGLE_TABLET,
LOAD_TO_SINGLE_TABLET + " should be a boolean");
+ String inputComputeGroupStr = jobProperties.get(COMPUTE_GROUP);
+ if (!StringUtils.isEmpty(inputComputeGroupStr)) {
+ // The name is always adopted, because the workload group check
below resolves in its
+ // namespace, but it is only validated when a user is actually
declaring it. On the
+ // metadata load path the declared group may have been dropped
long ago, and failing
+ // there would cancel the job permanently instead of pausing it -
see isReplay.
Review Comment:
The order is as described, but the early step gives a user nothing they
could not already do, so this PR keeps it. Before
`activateDeclaredComputeGroup` runs, `validateDeclaredComputeGroup` makes the
same two checks, in the same order, as `USE @<compute group>`: the user must
hold USAGE on the group, and the group must exist. `USE @<compute group>` then
starts a suspended group in the same way (`CloudEnv.changeCloudCluster`:
`checkCloudClusterPriv`, then `waitForAutoStart`), so anyone who passes these
checks can already wake the group from a session. master also validates the
declared `workload_group`, its privilege check included, in the same
`validate()` before `RoutineLoadManager` checks LOAD. What remains is that a
statement later denied LOAD may have started a group its user is allowed to
use, and may report a group error before the LOAD error. Moving the activation
behind the LOAD gate would split it from the validation into
`RoutineLoadManager` and `KafkaRoutineLoadJob` (CR
EATE before `checkCustomPartition`, ALTER before `convertOffset`) without
changing what a user is allowed to do.
--
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]