github-actions[bot] commented on code in PR #62747: URL: https://github.com/apache/doris/pull/62747#discussion_r3135365419
########## regression-test/suites/job_p0/streaming_job/test_streaming_insert_job_compute_group.groovy: ########## @@ -0,0 +1,158 @@ +// 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_insert_job_compute_group") { + def tableName = "test_streaming_insert_job_cg_tbl" + def jobName = "test_streaming_insert_job_cg_job" + + sql """drop table if exists `${tableName}` force""" + sql """DROP JOB IF EXISTS where jobname = '${jobName}'""" + sql """ + CREATE TABLE IF NOT EXISTS ${tableName} ( + `c1` int NULL, + `c2` string NULL, + `c3` int NULL + ) ENGINE=OLAP + DUPLICATE KEY(`c1`) + DISTRIBUTED BY HASH(`c1`) BUCKETS 3 + PROPERTIES ("replication_allocation" = "tag.location.default: 1"); + """ + + def s3Source = """ + SELECT * FROM S3( + "uri" = "s3://${s3BucketName}/regression/load/data/example_[0-1].csv", + "format" = "csv", + "provider" = "${getS3Provider()}", + "column_separator" = ",", + "s3.endpoint" = "${getS3Endpoint()}", + "s3.region" = "${getS3Region()}", + "s3.access_key" = "${getS3AK()}", + "s3.secret_key" = "${getS3SK()}" + ) + """ + + // ---------- Non-cloud mode: compute_group must be rejected ---------- + if (!isCloudMode()) { + test { + sql """ + CREATE JOB ${jobName} + PROPERTIES ("compute_group" = "any_group") + ON STREAMING DO INSERT INTO ${tableName} ${s3Source}; + """ + exception "only supported in cloud mode" + } + return + } + + // ---------- Cloud mode ---------- + def clusterRows = sql "show clusters" + assert clusterRows.size() >= 1 : "cloud mode expects at least one cluster" + def cg = clusterRows.get(0).get(0) + + try { + // 0) Empty compute_group -> CREATE rejected + test { + sql """ + CREATE JOB ${jobName} + PROPERTIES ("compute_group" = "") + ON STREAMING DO INSERT INTO ${tableName} ${s3Source}; + """ + exception "compute_group cannot be empty" + } + + // 1) Invalid compute_group -> CREATE should fail + test { + sql """ + CREATE JOB ${jobName} + PROPERTIES ( + "s3.max_batch_files" = "1", + "compute_group" = "__not_exist_cg__" + ) + ON STREAMING DO INSERT INTO ${tableName} ${s3Source}; + """ + exception "not exist" + } + + // 2) Valid compute_group -> CREATE succeeds; properties reflect it Review Comment: These new regressions only exercise the TVF/S3 path. The code changes also reroute the non-TVF `FROM MYSQL/POSTGRES ... TO DATABASE` path through `StreamingMultiTblTask` and the FE-side RPCs in `JdbcSourceOffsetProvider`, which was the path with the earlier auth bugs. Please keep or add a cloud-mode regression for that path as well; otherwise the new bound-cluster routing is still unverified end-to-end. ########## fe/fe-core/src/main/java/org/apache/doris/job/util/StreamingJobUtils.java: ########## @@ -25,6 +25,8 @@ import org.apache.doris.catalog.PrimitiveType; import org.apache.doris.catalog.ScalarType; import org.apache.doris.catalog.Table; +import org.apache.doris.cloud.system.CloudSystemInfoService; +import org.apache.doris.common.Config; import org.apache.doris.common.DdlException; import org.apache.doris.common.FeConstants; import org.apache.doris.common.util.SmallFileMgr; Review Comment: This new cluster-bound branch goes straight to `getBackendsByClusterName(cloudCluster)` and treats an empty result as fatal, but it never calls `waitForAutoStart(cloudCluster)` first. In cloud mode that is a behavioral regression for the non-TVF streaming path: a job bound to an auto-startable compute group will now pause/fail whenever the group is currently suspended with no load-available BE, even though other cloud execution paths wake the cluster before backend selection. The same issue also affects JDBC cleanup (`cleanMeta` during `DROP JOB`), because that path now routes through the same helper. -- 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]
