You are browsing a read-only backup copy of Wikitech. The primary site can be found at


From Wikitech-static
Revision as of 16:00, 1 August 2016 by imported>ArielGlenn (→‎Dumps not running)
Jump to navigation Jump to search

Docs for end-users of the data dumps at meta:Data dumps.

For a list of various information sources about the dumps, see Dumps/Other information sources.


User-visible files appear at

Dump activity involves a monitor node (running status sweeps) and arbitrarily many worker nodes running the dumps.


For which hosts are serving data, see Dumps/Dump servers. For which hosts are generating dumps, see Dumps/Snapshot hosts.

We want mirrors! For more information see Dumps/Mirror status.


English language Wikipedia dumps are run once a month; all other wikis are dumped twice a month. The first run includes page content for all revisions; the second dump run skips this step.

Dumps are run in "stages". This doesn't really impact the English language Wikipedia dumps, as one stage simply runs directly after the other on a dedicated server, so that all dump steps get done without interruption by other wiki runs.

For the other dumps, the stages for the first run of the month look like this: stub xml files (files with all of the metadata for pages and revisions but without any page content) are dumped first. After that's been done on all small wikis, all tables are dumped. This is then done for the 'big' wikis (see list here). Then the current page content for articles is dumped, first for small wikis and then for big ones. And so on.

The stages for the second run of the month are identical to the above, but without the full page history content dumps.

A 'dump scheduler' manages the running of these steps on each available host, given the number of available cores and the order we want the jobs to run in.

Worker nodes

There is a worker script which goes through the set of available wikis to dump a single time for each dump step, starting with the wiki that has gone the longest without a dump. The dump scheduler starts up several of these on each host, according to the number of free cores configured, starting the script anew for the same or a later stage, as determined in the stages list.

For each wiki, the worker script simply runs the python script on the given wiki. To ensure that multiple workers don't try to dump the same wiki at the same time, the python script locks the wiki before proceeding. Stale locks are eventually removed by a monitor script; if you try to run a dump of a wiki by hand when one is already in progress, you will see an error message to the effect that a wiki dump is already running, along with the name of the lock file.

Monitor node

On one host, the monitor script runs a python script for each wiki that checks for and removes stale lock files from dump processes that have died, and updates the central index.html file which shows the dumps in progress and the status of the dumps that have completed (i.e. ). That is its sole function.


Check /operations/dumps.git, branch 'master' for the python code in use. Some tools are in the 'ariel' branch but all dumps code run in production is in master or, for a few scripts not directly related to dumps production, in our puppet repo.

Getting a copy:

git clone
git checkout master

Getting a copy as a committer:

git clone ssh://<user>
git checkout master

Programs used

See also Dumps/Software dependencies.

The scripts call mysqldump, getSlaveServer.php, eval.php, dumpBackup.php, and dumpTextPass.php directly for dump generation. These in turn require and and may call ActiveAbstract/AbstractFilter.php and fetchText.php.

The generation of XML files relies on Export.php under the hood and of course the entire MW infrastructure.

The script relies on a few C programs for various bz2 operations: checkforbz2footer and recompressxml, both in /usr/local/bin/. These are in the git repo in branch 'ariel', see [1].


Adding a new worker box

Install and add to site.pp in the snapshot stanza (see snapshot1005-7). Add the relevant hiera entries, documented in site.pp, according to whether the server will run en wiki dumps (only one server should do so), or misc cron jobs (one host should do so, not the same host running en wiki dumps).

Dumps run out of /srv/deployment/dumps/dumps on each server. Deployment is done via scap3 from the deployment server.

Starting dump runs

  1. Do nothing. These jobs run out of cron.

Dealing with problems


If the hosts serving the dumps run low on disk space, you can reduce the number of backups that are kept. Change the value for 'keep' in the conf file generation in puppet to a lower number.

Failed runs

Logs will be kept of each run. You can find them in the private directory (/mnt/data/xmldatadumps/private/<wikiname>/<date>/) for the particular dump, filename dumplog.txt. You can look at them to see if there are any error messages that were generated for a given run.

The worker script sends email if a dump does not complete successfully. It currently sends email to which is an alias. If you want to follow and fix failures, add yourself to that alias.

When one or more steps of a dump fail, the index.html file for that dump includes a notation of the failure and sometimes more information about it. Note that one step of a dump failing does not prevent other steps from running unless they depend on the data from that failed step as input.

See Dumps/Rerunning a job for how to rerun all or part of a given dump. This also explains what files may need to be cleaned up before rerunning.

Dumps not running

See the section above, 'Starting dump runs' if you need to restart a run across all wikis from the beginning.

If the monitor does not appear to be running (the index.html file showing the dumps status is never updated), check which host should have it running (see the hiera host entries for the snapshots and look for the one with monitor: true). This is a service that should be restarted with systemd or upstart, depending on the os version, so you'll want to see what change broke it.

If the host crashes while the dump scheduler is running, the status files are left as-is and the display shows any dumps on any wikis as still running until the monitor node decides the lock file for those wikis is stale enough to mark is as aborted.

To restart the scheduler from where it left off:

Really, you can just wait for cron to pick it up; it checks twice a day for aborted runs, unless the job has fallen outside of the run date range. You can check thta date range by looking at the cron job entry on any snapshot host for the appropriate entry for

If you're outside the range, just do this:

  1. be on each appropriate host as root
  2. start a screen session
  3. su - datasets
  4. bash starting_date_of_range todays_date wikitype(regular or huge) dumptype(full or partial)

Example: bash 01 17 regular full

This would pick up the full dumps for everything except enwiki, on the specific host you are running at, for the run tat starts at the first of the month, assuming thatyou are trying to run it on the 17th of the month or earlier.

This date cutoff may seem a little odd; it is built in so that the script does not try to start a dump run from scratch so late in the month that it cannot complete by the next run.

If the worker script encounters more than three failed dumps in a row (currently configured as such? or did I hardcode that?) it will exit; this avoids generation of piles of broken dumps which later would need to be cleaned up. Once the underlying problem is fixed, you can go to the screen session of the host running those wikis and rerun the previous command in all the windows.

Running a specifc dump on request

See Dumps/Rerunning a job for how to run a specific dump. This is done for special cases only.

Deploying new code

See Dumps/How to deploy for this.

Bugs, known limitations, etc.

See Dumps/Known issues and wish list for this.

File layout

Sites are identified by raw database name currently. A 'friendly' name/hostname can be added for convenience of searching in future.

See also