MediaWiki  master
recompressTracked.php
Go to the documentation of this file.
1 <?php
31 use Wikimedia\AtEase\AtEase;
32 
34 require __DIR__ . '/../CommandLineInc.php';
35 
36 if ( count( $args ) < 1 ) {
37  echo "Usage: php recompressTracked.php [options] <cluster> [... <cluster>...]
38 Moves blobs indexed by trackBlobs.php to a specified list of destination clusters,
39 and recompresses them in the process. Restartable.
40 
41 Options:
42  --procs <procs> Set the number of child processes (default 1)
43  --copy-only Copy only, do not update the text table. Restart
44  without this option to complete.
45  --debug-log <file> Log debugging data to the specified file
46  --info-log <file> Log progress messages to the specified file
47  --critical-log <file> Log error messages to the specified file
48 ";
49  exit( 1 );
50 }
51 
53 $job->execute();
54 
62  public $destClusters;
63  public $batchSize = 1000;
64  public $orphanBatchSize = 1000;
65  public $reportingInterval = 10;
66  public $numProcs = 1;
67  public $numBatches = 0;
70  public $copyOnly = false;
71  public $isChild = false;
72  public $childId = false;
73  public $noCount = false;
76  public $store;
78  private $blobStore;
79 
80  private static $optionsWithArgs = [
81  'procs',
82  'child-id',
83  'debug-log',
84  'info-log',
85  'critical-log'
86  ];
87 
88  private static $cmdLineOptionMap = [
89  'no-count' => 'noCount',
90  'procs' => 'numProcs',
91  'copy-only' => 'copyOnly',
92  'child' => 'isChild',
93  'child-id' => 'childId',
94  'debug-log' => 'debugLog',
95  'info-log' => 'infoLog',
96  'critical-log' => 'criticalLog',
97  ];
98 
99  public static function getOptionsWithArgs() {
100  return self::$optionsWithArgs;
101  }
102 
103  public static function newFromCommandLine( $args, $options ) {
104  $jobOptions = [ 'destClusters' => $args ];
105  foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
106  if ( isset( $options[$cmdOption] ) ) {
107  $jobOptions[$classOption] = $options[$cmdOption];
108  }
109  }
110 
111  return new self( $jobOptions );
112  }
113 
114  public function __construct( $options ) {
115  foreach ( $options as $name => $value ) {
116  $this->$name = $value;
117  }
118  $esFactory = MediaWikiServices::getInstance()->getExternalStoreFactory();
119  $this->store = $esFactory->getStore( 'DB' );
120  if ( !$this->isChild ) {
121  $GLOBALS['wgDebugLogPrefix'] = "RCT M: ";
122  } elseif ( $this->childId !== false ) {
123  $GLOBALS['wgDebugLogPrefix'] = "RCT {$this->childId}: ";
124  }
125  $this->pageBlobClass = function_exists( 'xdiff_string_bdiff' ) ?
126  DiffHistoryBlob::class : ConcatenatedGzipHistoryBlob::class;
127  $this->orphanBlobClass = ConcatenatedGzipHistoryBlob::class;
128 
129  $this->blobStore = MediaWikiServices::getInstance()
130  ->getBlobStoreFactory()
131  ->newSqlBlobStore();
132  }
133 
134  public function debug( $msg ) {
135  wfDebug( "$msg" );
136  if ( $this->debugLog ) {
137  $this->logToFile( $msg, $this->debugLog );
138  }
139  }
140 
141  public function info( $msg ) {
142  echo "$msg\n";
143  if ( $this->infoLog ) {
144  $this->logToFile( $msg, $this->infoLog );
145  }
146  }
147 
148  public function critical( $msg ) {
149  echo "$msg\n";
150  if ( $this->criticalLog ) {
151  $this->logToFile( $msg, $this->criticalLog );
152  }
153  }
154 
155  private function logToFile( $msg, $file ) {
156  $header = '[' . date( 'd\TH:i:s' ) . '] ' . wfHostname() . ' ' . posix_getpid();
157  if ( $this->childId !== false ) {
158  $header .= "({$this->childId})";
159  }
160  $header .= ' ' . WikiMap::getCurrentWikiDbDomain()->getId();
161  LegacyLogger::emit( sprintf( "%-50s %s\n", $header, $msg ), $file );
162  }
163 
169  private function syncDBs() {
170  $dbw = wfGetDB( DB_PRIMARY );
171  $dbr = wfGetDB( DB_REPLICA );
172  $pos = $dbw->getPrimaryPos();
173  $dbr->primaryPosWait( $pos, 100000 );
174  }
175 
179  public function execute() {
180  if ( $this->isChild ) {
181  $this->executeChild();
182  } else {
183  $this->executeParent();
184  }
185  }
186 
190  public function executeParent() {
191  if ( !$this->checkTrackingTable() ) {
192  return;
193  }
194 
195  $this->syncDBs();
196  $this->startChildProcs();
197  $this->doAllPages();
198  $this->doAllOrphans();
199  $this->killChildProcs();
200  }
201 
206  private function checkTrackingTable() {
207  $dbr = wfGetDB( DB_REPLICA );
208  if ( !$dbr->tableExists( 'blob_tracking', __METHOD__ ) ) {
209  $this->critical( "Error: blob_tracking table does not exist" );
210 
211  return false;
212  }
213  $row = $dbr->selectRow( 'blob_tracking', '*', '', __METHOD__ );
214  if ( !$row ) {
215  $this->info( "Warning: blob_tracking table contains no rows, skipping this wiki." );
216 
217  return false;
218  }
219 
220  return true;
221  }
222 
229  private function startChildProcs() {
230  $wiki = WikiMap::getCurrentWikiId();
231 
232  $cmd = 'php ' . Shell::escape( __FILE__ );
233  foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
234  if ( $cmdOption == 'child-id' ) {
235  continue;
236  }
237  if ( in_array( $cmdOption, self::$optionsWithArgs ) && isset( $this->$classOption ) ) {
238  // @phan-suppress-next-line PhanTypeMismatchArgument False positive
239  $cmd .= " --$cmdOption " . Shell::escape( $this->$classOption );
240  } elseif ( $this->$classOption ) {
241  $cmd .= " --$cmdOption";
242  }
243  }
244  $cmd .= ' --child' .
245  ' --wiki ' . Shell::escape( $wiki ) .
246  ' ' . Shell::escape( ...$this->destClusters );
247 
248  $this->childPipes = $this->childProcs = [];
249  for ( $i = 0; $i < $this->numProcs; $i++ ) {
250  $pipes = [];
251  $spec = [
252  [ 'pipe', 'r' ],
253  [ 'file', 'php://stdout', 'w' ],
254  [ 'file', 'php://stderr', 'w' ]
255  ];
256  AtEase::suppressWarnings();
257  $proc = proc_open( "$cmd --child-id $i", $spec, $pipes );
258  AtEase::restoreWarnings();
259  if ( !$proc ) {
260  $this->critical( "Error opening child process: $cmd" );
261  exit( 1 );
262  }
263  $this->childProcs[$i] = $proc;
264  $this->childPipes[$i] = $pipes[0];
265  }
266  $this->prevChildId = -1;
267  }
268 
272  private function killChildProcs() {
273  $this->info( "Waiting for child processes to finish..." );
274  for ( $i = 0; $i < $this->numProcs; $i++ ) {
275  $this->dispatchToChild( $i, 'quit' );
276  }
277  for ( $i = 0; $i < $this->numProcs; $i++ ) {
278  $status = proc_close( $this->childProcs[$i] );
279  if ( $status ) {
280  $this->critical( "Warning: child #$i exited with status $status" );
281  }
282  }
283  $this->info( "Done." );
284  }
285 
291  private function dispatch( ...$args ) {
292  $pipes = $this->childPipes;
293  $x = [];
294  $y = [];
295  $numPipes = stream_select( $x, $pipes, $y, 3600 );
296  if ( !$numPipes ) {
297  $this->critical( "Error waiting to write to child process. Aborting" );
298  exit( 1 );
299  }
300  for ( $i = 0; $i < $this->numProcs; $i++ ) {
301  $childId = ( $i + $this->prevChildId + 1 ) % $this->numProcs;
302  if ( isset( $pipes[$childId] ) ) {
303  $this->prevChildId = $childId;
304  $this->dispatchToChild( $childId, $args );
305 
306  return;
307  }
308  }
309  $this->critical( "Unreachable" );
310  exit( 1 );
311  }
312 
318  private function dispatchToChild( $childId, $args ) {
319  $args = (array)$args;
320  $cmd = implode( ' ', $args );
321  fwrite( $this->childPipes[$childId], "$cmd\n" );
322  }
323 
327  private function doAllPages() {
328  $dbr = wfGetDB( DB_REPLICA );
329  $i = 0;
330  $startId = 0;
331  if ( $this->noCount ) {
332  $numPages = '[unknown]';
333  } else {
334  $numPages = $dbr->selectField( 'blob_tracking',
335  'COUNT(DISTINCT bt_page)',
336  # A condition is required so that this query uses the index
337  [ 'bt_moved' => 0 ],
338  __METHOD__
339  );
340  }
341  if ( $this->copyOnly ) {
342  $this->info( "Copying pages..." );
343  } else {
344  $this->info( "Moving pages..." );
345  }
346  while ( true ) {
347  $res = $dbr->select( 'blob_tracking',
348  [ 'bt_page' ],
349  [
350  'bt_moved' => 0,
351  'bt_page > ' . $dbr->addQuotes( $startId )
352  ],
353  __METHOD__,
354  [
355  'DISTINCT',
356  'ORDER BY' => 'bt_page',
357  'LIMIT' => $this->batchSize,
358  ]
359  );
360  if ( !$res->numRows() ) {
361  break;
362  }
363  foreach ( $res as $row ) {
364  $startId = $row->bt_page;
365  $this->dispatch( 'doPage', $row->bt_page );
366  $i++;
367  }
368  $this->report( 'pages', $i, $numPages );
369  }
370  $this->report( 'pages', $i, $numPages );
371  if ( $this->copyOnly ) {
372  $this->info( "All page copies queued." );
373  } else {
374  $this->info( "All page moves queued." );
375  }
376  }
377 
384  private function report( $label, $current, $end ) {
385  $this->numBatches++;
386  if ( $current == $end || $this->numBatches >= $this->reportingInterval ) {
387  $this->numBatches = 0;
388  $this->info( "$label: $current / $end" );
389  MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->waitForReplication();
390  }
391  }
392 
396  private function doAllOrphans() {
397  $dbr = wfGetDB( DB_REPLICA );
398  $startId = 0;
399  $i = 0;
400  if ( $this->noCount ) {
401  $numOrphans = '[unknown]';
402  } else {
403  $numOrphans = $dbr->selectField( 'blob_tracking',
404  'COUNT(DISTINCT bt_text_id)',
405  [ 'bt_moved' => 0, 'bt_page' => 0 ],
406  __METHOD__ );
407  if ( !$numOrphans ) {
408  return;
409  }
410  }
411  if ( $this->copyOnly ) {
412  $this->info( "Copying orphans..." );
413  } else {
414  $this->info( "Moving orphans..." );
415  }
416 
417  while ( true ) {
418  $res = $dbr->select( 'blob_tracking',
419  [ 'bt_text_id' ],
420  [
421  'bt_moved' => 0,
422  'bt_page' => 0,
423  'bt_text_id > ' . $dbr->addQuotes( $startId )
424  ],
425  __METHOD__,
426  [
427  'DISTINCT',
428  'ORDER BY' => 'bt_text_id',
429  'LIMIT' => $this->batchSize
430  ]
431  );
432  if ( !$res->numRows() ) {
433  break;
434  }
435  $ids = [];
436  foreach ( $res as $row ) {
437  $startId = $row->bt_text_id;
438  $ids[] = $row->bt_text_id;
439  $i++;
440  }
441  // Need to send enough orphan IDs to the child at a time to fill a blob,
442  // so orphanBatchSize needs to be at least ~100.
443  // batchSize can be smaller or larger.
444  while ( count( $ids ) > $this->orphanBatchSize ) {
445  $args = array_slice( $ids, 0, $this->orphanBatchSize );
446  $ids = array_slice( $ids, $this->orphanBatchSize );
447  array_unshift( $args, 'doOrphanList' );
448  $this->dispatch( ...$args );
449  }
450  if ( count( $ids ) ) {
451  $args = $ids;
452  array_unshift( $args, 'doOrphanList' );
453  $this->dispatch( ...$args );
454  }
455 
456  $this->report( 'orphans', $i, $numOrphans );
457  }
458  $this->report( 'orphans', $i, $numOrphans );
459  $this->info( "All orphans queued." );
460  }
461 
465  public function executeChild() {
466  $this->debug( 'starting' );
467  $this->syncDBs();
468 
469  while ( !feof( STDIN ) ) {
470  $line = rtrim( fgets( STDIN ) );
471  if ( $line == '' ) {
472  continue;
473  }
474  $this->debug( $line );
475  $args = explode( ' ', $line );
476  $cmd = array_shift( $args );
477  switch ( $cmd ) {
478  case 'doPage':
479  $this->doPage( intval( $args[0] ) );
480  break;
481  case 'doOrphanList':
482  $this->doOrphanList( array_map( 'intval', $args ) );
483  break;
484  case 'quit':
485  return;
486  }
487  MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->waitForReplication();
488  }
489  }
490 
496  private function doPage( $pageId ) {
497  $title = Title::newFromID( $pageId );
498  if ( $title ) {
499  $titleText = $title->getPrefixedText();
500  } else {
501  $titleText = '[deleted]';
502  }
503  $dbr = wfGetDB( DB_REPLICA );
504 
505  // Finish any incomplete transactions
506  if ( !$this->copyOnly ) {
507  $this->finishIncompleteMoves( [ 'bt_page' => $pageId ] );
508  $this->syncDBs();
509  }
510 
511  $startId = 0;
512  $trx = new CgzCopyTransaction( $this, $this->pageBlobClass );
513 
514  $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
515  while ( true ) {
516  $res = $dbr->select(
517  [ 'blob_tracking', 'text' ],
518  '*',
519  [
520  'bt_page' => $pageId,
521  'bt_text_id > ' . $dbr->addQuotes( $startId ),
522  'bt_moved' => 0,
523  'bt_new_url IS NULL',
524  'bt_text_id=old_id',
525  ],
526  __METHOD__,
527  [
528  'ORDER BY' => 'bt_text_id',
529  'LIMIT' => $this->batchSize
530  ]
531  );
532  if ( !$res->numRows() ) {
533  break;
534  }
535 
536  $lastTextId = 0;
537  foreach ( $res as $row ) {
538  $startId = $row->bt_text_id;
539  if ( $lastTextId == $row->bt_text_id ) {
540  // Duplicate (null edit)
541  continue;
542  }
543  $lastTextId = $row->bt_text_id;
544  // Load the text
545  $text = $this->blobStore->expandBlob( $row->old_text, $row->old_flags );
546  if ( $text === false ) {
547  $this->critical( "Error loading {$row->bt_rev_id}/{$row->bt_text_id}" );
548  continue;
549  }
550 
551  // Queue it
552  if ( !$trx->addItem( $text, $row->bt_text_id ) ) {
553  $this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" );
554  $trx->commit();
555  $trx = new CgzCopyTransaction( $this, $this->pageBlobClass );
556  $lbFactory->waitForReplication();
557  }
558  }
559  }
560 
561  $this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" );
562  $trx->commit();
563  }
564 
578  public function moveTextRow( $textId, $url ) {
579  if ( $this->copyOnly ) {
580  $this->critical( "Internal error: can't call moveTextRow() in --copy-only mode" );
581  exit( 1 );
582  }
583  $dbw = wfGetDB( DB_PRIMARY );
584  $dbw->begin( __METHOD__ );
585  $dbw->update( 'text',
586  [ // set
587  'old_text' => $url,
588  'old_flags' => 'external,utf-8',
589  ],
590  [ // where
591  'old_id' => $textId
592  ],
593  __METHOD__
594  );
595  $dbw->update( 'blob_tracking',
596  [ 'bt_moved' => 1 ],
597  [ 'bt_text_id' => $textId ],
598  __METHOD__
599  );
600  $dbw->commit( __METHOD__ );
601  }
602 
613  private function finishIncompleteMoves( $conds ) {
614  $dbr = wfGetDB( DB_REPLICA );
615  $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
616 
617  $startId = 0;
618  $conds = array_merge( $conds, [
619  'bt_moved' => 0,
620  'bt_new_url IS NOT NULL'
621  ] );
622  while ( true ) {
623  $res = $dbr->select( 'blob_tracking',
624  '*',
625  array_merge( $conds, [ 'bt_text_id > ' . $dbr->addQuotes( $startId ) ] ),
626  __METHOD__,
627  [
628  'ORDER BY' => 'bt_text_id',
629  'LIMIT' => $this->batchSize,
630  ]
631  );
632  if ( !$res->numRows() ) {
633  break;
634  }
635  $this->debug( 'Incomplete: ' . $res->numRows() . ' rows' );
636  foreach ( $res as $row ) {
637  $startId = $row->bt_text_id;
638  $this->moveTextRow( $row->bt_text_id, $row->bt_new_url );
639  if ( $row->bt_text_id % 10 == 0 ) {
640  $lbFactory->waitForReplication();
641  }
642  }
643  }
644  }
645 
650  public function getTargetCluster() {
651  $cluster = next( $this->destClusters );
652  if ( $cluster === false ) {
653  $cluster = reset( $this->destClusters );
654  }
655 
656  return $cluster;
657  }
658 
664  private function doOrphanList( $textIds ) {
665  // Finish incomplete moves
666  if ( !$this->copyOnly ) {
667  $this->finishIncompleteMoves( [ 'bt_text_id' => $textIds ] );
668  $this->syncDBs();
669  }
670 
671  $trx = new CgzCopyTransaction( $this, $this->orphanBlobClass );
672 
673  $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
674  $res = wfGetDB( DB_REPLICA )->select(
675  [ 'text', 'blob_tracking' ],
676  [ 'old_id', 'old_text', 'old_flags' ],
677  [
678  'old_id' => $textIds,
679  'bt_text_id=old_id',
680  'bt_moved' => 0,
681  ],
682  __METHOD__,
683  [ 'DISTINCT' ]
684  );
685 
686  foreach ( $res as $row ) {
687  $text = $this->blobStore->expandBlob( $row->old_text, $row->old_flags );
688  if ( $text === false ) {
689  $this->critical( "Error: cannot load revision text for old_id={$row->old_id}" );
690  continue;
691  }
692 
693  if ( !$trx->addItem( $text, $row->old_id ) ) {
694  $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
695  $trx->commit();
696  $trx = new CgzCopyTransaction( $this, $this->orphanBlobClass );
697  $lbFactory->waitForReplication();
698  }
699  }
700  $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
701  $trx->commit();
702  }
703 }
704 
710  public $parent;
711  public $blobClass;
713  public $cgz;
714  public $referrers;
716  private $texts;
717 
723  public function __construct( $parent, $blobClass ) {
724  $this->blobClass = $blobClass;
725  $this->cgz = false;
726  $this->texts = [];
727  $this->parent = $parent;
728  }
729 
737  public function addItem( $text, $textId ) {
738  if ( !$this->cgz ) {
739  $class = $this->blobClass;
740  $this->cgz = new $class;
741  }
742  $hash = $this->cgz->addItem( $text );
743  $this->referrers[$textId] = $hash;
744  $this->texts[$textId] = $text;
745 
746  return $this->cgz->isHappy();
747  }
748 
749  public function getSize() {
750  return count( $this->texts );
751  }
752 
756  public function recompress() {
757  $class = $this->blobClass;
758  $this->cgz = new $class;
759  $this->referrers = [];
760  foreach ( $this->texts as $textId => $text ) {
761  $hash = $this->cgz->addItem( $text );
762  $this->referrers[$textId] = $hash;
763  }
764  }
765 
771  public function commit() {
772  $originalCount = count( $this->texts );
773  if ( !$originalCount ) {
774  return;
775  }
776 
777  /* Check to see if the target text_ids have been moved already.
778  *
779  * We originally read from the replica DB, so this can happen when a single
780  * text_id is shared between multiple pages. It's rare, but possible
781  * if a delete/move/undelete cycle splits up a null edit.
782  *
783  * We do a locking read to prevent closer-run race conditions.
784  */
785  $dbw = wfGetDB( DB_PRIMARY );
786  $dbw->begin( __METHOD__ );
787  $res = $dbw->select( 'blob_tracking',
788  [ 'bt_text_id', 'bt_moved' ],
789  [ 'bt_text_id' => array_keys( $this->referrers ) ],
790  __METHOD__, [ 'FOR UPDATE' ] );
791  $dirty = false;
792  foreach ( $res as $row ) {
793  if ( $row->bt_moved ) {
794  # This row has already been moved, remove it
795  $this->parent->debug( "TRX: conflict detected in old_id={$row->bt_text_id}" );
796  unset( $this->texts[$row->bt_text_id] );
797  $dirty = true;
798  }
799  }
800 
801  // Recompress the blob if necessary
802  if ( $dirty ) {
803  if ( !count( $this->texts ) ) {
804  // All have been moved already
805  if ( $originalCount > 1 ) {
806  // This is suspcious, make noise
807  $this->parent->critical(
808  "Warning: concurrent operation detected, are there two conflicting " .
809  "processes running, doing the same job?" );
810  }
811 
812  return;
813  }
814  $this->recompress();
815  }
816 
817  // Insert the data into the destination cluster
818  $targetCluster = $this->parent->getTargetCluster();
819  $store = $this->parent->store;
820  $targetDB = $store->getPrimary( $targetCluster );
821  $targetDB->clearFlag( DBO_TRX ); // we manage the transactions
822  $targetDB->begin( __METHOD__ );
823  $baseUrl = $this->parent->store->store( $targetCluster, serialize( $this->cgz ) );
824 
825  // Write the new URLs to the blob_tracking table
826  foreach ( $this->referrers as $textId => $hash ) {
827  $url = $baseUrl . '/' . $hash;
828  $dbw->update( 'blob_tracking',
829  [ 'bt_new_url' => $url ],
830  [
831  'bt_text_id' => $textId,
832  'bt_moved' => 0, # Check for concurrent conflicting update
833  ],
834  __METHOD__
835  );
836  }
837 
838  $targetDB->commit( __METHOD__ );
839  // Critical section here: interruption at this point causes blob duplication
840  // Reversing the order of the commits would cause data loss instead
841  $dbw->commit( __METHOD__ );
842 
843  // Write the new URLs to the text table and set the moved flag
844  if ( !$this->parent->copyOnly ) {
845  foreach ( $this->referrers as $textId => $hash ) {
846  $url = $baseUrl . '/' . $hash;
847  $this->parent->moveTextRow( $textId, $url );
848  }
849  }
850  }
851 }
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfHostname()
Get host name of the current machine, for use in error reporting.
Class to represent a recompression operation for a single CGZ blob.
RecompressTracked $parent
ConcatenatedGzipHistoryBlob false $cgz
addItem( $text, $textId)
Add text.
commit()
Commit the blob.
recompress()
Recompress text after some aberrant modification.
__construct( $parent, $blobClass)
Create a transaction from a RecompressTracked object.
getPrimary( $cluster)
Get a primary database connection for the specified cluster.
store( $location, $data)
Insert a data item into a given location.The location name The data item string|bool The URL of the s...
PSR-3 logger that mimics the historic implementation of MediaWiki's former wfErrorLog logging impleme...
Service locator for MediaWiki core services.
Executes shell commands.
Definition: Shell.php:46
Service for storing and loading Content objects representing revision data blobs.
Represents a title within MediaWiki.
Definition: Title.php:82
Helper tools for dealing with other locally-hosted wikis.
Definition: WikiMap.php:33
Maintenance script that moves blobs indexed by trackBlobs.php to a specified list of destination clus...
executeChild()
Main entry point for worker processes.
moveTextRow( $textId, $url)
Atomic move operation.
execute()
Execute parent or child depending on the isChild option.
static newFromCommandLine( $args, $options)
getTargetCluster()
Returns the name of the next target cluster.
executeParent()
Execute the parent process.
ExternalStoreDB $store
const DB_REPLICA
Definition: defines.php:26
const DB_PRIMARY
Definition: defines.php:28
const DBO_TRX
Definition: defines.php:12
$optionsWithArgs
if(count( $args)< 1) $job
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
$header