@@ -7,7 +7,7 @@ import * as cr from 'aws-cdk-lib/custom-resources';
77import { Construct } from 'constructs' ;
88import * as path from 'path' ;
99import { execSync } from 'child_process' ;
10- import { trinoAfterDeployCommands , trinoUserDataCommands } from "./trino" ;
10+ import { trinoWorkerCommands , trinoUserDataCommands } from "./trino" ;
1111
1212const ROOT = path . join ( __dirname , '../../..' )
1313
@@ -188,13 +188,10 @@ sudo journalctl -u worker.service -f -o cat
188188 'systemctl restart worker' ,
189189 ] )
190190
191- // Start coordinator first
192- sendCommandsUnconditionally ( this , 'RestartTrinoCoordinator' , [ instances [ 0 ] ] , [
193- 'systemctl start trino' ,
194- ] )
195-
196191 // Then start workers (they will discover the coordinator)
197- sendCommandsUnconditionally ( this , 'RestartTrinoWorkers' , instances . slice ( 1 ) , trinoAfterDeployCommands ( this . region ) )
192+ const [ coordinator , ...workers ] = instances
193+ sendCommandsUnconditionally ( this , 'TrinoCoordinatorCommands' , [ coordinator ] , [ 'systemctl start trino' ] )
194+ sendCommandsUnconditionally ( this , 'TrinoWorkerCommands' , workers , trinoWorkerCommands ( coordinator ) )
198195 }
199196}
200197
0 commit comments