Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50756


Change subject: Made runJobs.php wait for slave lag.
......................................................................

Made runJobs.php wait for slave lag.

* Relying on waitForBackups() alone will not work with non DB queues.

Change-Id: I2124c5cd11a70d183cfde00ad21d6642a3a0ee9e
---
M maintenance/runJobs.php
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/50756/1

diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php
index f9557ce..714bb84 100644
--- a/maintenance/runJobs.php
+++ b/maintenance/runJobs.php
@@ -82,6 +82,7 @@
                        $this->runJobsLog( "Executed $count periodic queue 
task(s)." );
                }
 
+               $lastTime = time();
                do {
                        $job = ( $type === false )
                                ? $group->pop( JobQueueGroup::TYPE_DEFAULT, 
JobQueueGroup::USE_CACHE )
@@ -118,8 +119,13 @@
                                        break;
                                }
 
-                               // Don't let any slaves/backups fall behind...
+                               // Don't let any queue slaves/backups fall 
behind
                                $group->get( $job->getType() 
)->waitForBackups();
+                               // Don't let any of the main DB slaves get 
backed up
+                               $timePassed = time() - $lastTime;
+                               if ( $timePassed >= 5 || $timePassed < 0 ) {
+                                       wfWaitForSlaves();
+                               }
                        }
                } while ( $job ); // stop when there are no jobs
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/50756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2124c5cd11a70d183cfde00ad21d6642a3a0ee9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to