This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ef1bfbbb4d Improve "alter transmission rule": verify STREAM_CHANNEL 
TYPE NAME (#36864)
5ef1bfbbb4d is described below

commit 5ef1bfbbb4de5cfe53a03a6258302031f9b622c9
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Mon Oct 13 10:31:52 2025 +0800

    Improve "alter transmission rule": verify STREAM_CHANNEL TYPE NAME (#36864)
---
 .../transmission/update/AlterTransmissionRuleExecutor.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java
 
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java
index 86c7447788a..8913b9e7f0f 100644
--- 
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java
+++ 
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java
@@ -17,7 +17,9 @@
 
 package 
org.apache.shardingsphere.data.pipeline.distsql.handler.transmission.update;
 
+import 
org.apache.shardingsphere.data.pipeline.core.channel.PipelineChannelCreator;
 import org.apache.shardingsphere.data.pipeline.core.context.PipelineContextKey;
+import 
org.apache.shardingsphere.data.pipeline.core.exception.param.PipelineInvalidParameterException;
 import 
org.apache.shardingsphere.data.pipeline.core.job.progress.config.PipelineProcessConfiguration;
 import 
org.apache.shardingsphere.data.pipeline.core.job.progress.config.PipelineReadConfiguration;
 import 
org.apache.shardingsphere.data.pipeline.core.job.progress.config.PipelineWriteConfiguration;
@@ -42,8 +44,13 @@ public final class AlterTransmissionRuleExecutor implements 
DistSQLUpdateExecuto
     
     @Override
     public void executeUpdate(final AlterTransmissionRuleStatement 
sqlStatement, final ContextManager contextManager) {
+        PipelineProcessConfiguration processConfig = 
convertToProcessConfiguration(sqlStatement.getProcessConfigSegment());
+        AlgorithmConfiguration streamChannel = 
processConfig.getStreamChannel();
+        if (null != streamChannel && 
!TypedSPILoader.findService(PipelineChannelCreator.class, 
streamChannel.getType()).isPresent()) {
+            throw new PipelineInvalidParameterException("Unknown stream 
channel type `" + streamChannel.getType() + "`.");
+        }
         String jobType = TypedSPILoader.getService(PipelineJobType.class, 
sqlStatement.getJobTypeName()).getType();
-        processConfigPersistService.persist(new 
PipelineContextKey(InstanceType.PROXY), jobType, 
convertToProcessConfiguration(sqlStatement.getProcessConfigSegment()));
+        processConfigPersistService.persist(new 
PipelineContextKey(InstanceType.PROXY), jobType, processConfig);
     }
     
     private PipelineProcessConfiguration convertToProcessConfiguration(final 
TransmissionRuleSegment segment) {

Reply via email to