WXPNG opened a new issue, #12939:
URL: https://github.com/apache/seatunnel/issues/12939

   When starting the Zeta engine with an explicitly specified cluster role 
"master_and_worker", the server fails with:
   
       SeaTunnelEngineException: Not supported cluster role: master_and_worker
   
   Steps to reproduce:
   
       bin/seatunnel-cluster.sh -r master_and_worker
   
   Root cause:
   
   In ServerExecuteCommand.execute(), the role parsing only handles MASTER and 
WORKER:
   
   ```
       if 
(EngineConfig.ClusterRole.MASTER.toString().equalsIgnoreCase(clusterRole)) {
           
seaTunnelConfig.getEngineConfig().setClusterRole(EngineConfig.ClusterRole.MASTER);
       } else if 
(EngineConfig.ClusterRole.WORKER.toString().equalsIgnoreCase(clusterRole)) {
           
seaTunnelConfig.getEngineConfig().setClusterRole(EngineConfig.ClusterRole.WORKER);
           seaTunnelConfig.getHazelcastConfig().setLiteMember(true);
       } else {
           throw new SeaTunnelEngineException("Not supported cluster role: " + 
clusterRole);
       }
   ```
   
   There is no branch for MASTER_AND_WORKER, even though:
   
   1. ServerCommandArgs declares the -r/--role option as:
      "The cluster node role, default is master_and_worker, support master, 
worker, master_and_worker"
   
   2. EngineConfig.clusterRole already defaults to 
ClusterRole.MASTER_AND_WORKER.
   
   As a result, omitting -r works (falls into the else branch and defaults to
   MASTER_AND_WORKER), but explicitly passing the same documented value fails.
   This is inconsistent and breaks tooling that always passes the role
   explicitly (e.g. deployment scripts).
   
   Proposed fix:
   
   Add an explicit branch for MASTER_AND_WORKER:
   
   ```
       } else if (EngineConfig.ClusterRole.MASTER_AND_WORKER.toString()
               .equalsIgnoreCase(clusterRole)) {
           seaTunnelConfig.getEngineConfig()
                   .setClusterRole(EngineConfig.ClusterRole.MASTER_AND_WORKER);
       }
   ```
   


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