File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 5151$ mclq ->addSqlDowngrade ('DROP DATABASE IF EXISTS shara ' );
5252
5353
54- if (!$ cl ->sendMigration ($ mclq ))
54+ if (!$ cl ->sendMigration ($ mclq, true ))
5555{
5656 throw new Exception ('sendMigration is bad , error= ' .$ cl ->getError ());
5757}
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ public function getError()
348348 return $ this ->error ;
349349 }
350350
351- public function sendMigration (Cluster \Migration $ migration )
351+ public function sendMigration (Cluster \Migration $ migration, $ showDebug = false )
352352 {
353353 $ node_hosts =$ this ->getClusterNodes ($ migration ->getClusterName ());
354354
@@ -359,21 +359,32 @@ public function sendMigration(Cluster\Migration $migration)
359359 foreach ($ node_hosts as $ node ) {
360360 try {
361361 $ this ->client ($ node )->ping ();
362+
363+ if ($ showDebug )
364+ {
365+ echo "client( $ node)->ping() OK! \n" ;
366+ }
367+
362368 } catch (QueryException $ E ) {
363369 $ this ->error = "Can`t connect or ping ip/node : " . $ node ;
364370 return false ;
365371 }
366372 }
367373
368374
369-
370375 // Выполняем запрос на каждый client(IP) , если хоть одни не отработал то делаем на каждый Down
371376 $ need_undo =false ;
372377 $ undo_ip =[];
373378 foreach ($ node_hosts as $ node )
374379 {
375380 foreach ($ sql_up as $ s_u ) {
376381 try {
382+
383+ if ($ showDebug )
384+ {
385+ echo "client( $ node)->write( " .substr ($ s_u ,0 ,45 ).").... \n" ;
386+ }
387+
377388 if ($ this ->client ($ node )->write ($ s_u )->isError ()) {
378389 $ need_undo = true ;
379390 $ this ->error = "Host $ node result error " ;
You can’t perform that action at this time.
0 commit comments