ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334985 )

Change subject: Turn off centralauth table dumps.
......................................................................

Turn off centralauth table dumps.

Bug: T153633
Change-Id: Idc2b085c33f2d76c67fec32a965d4da368226385
---
D modules/snapshot/files/cron/dumpcentralauth.sh
M modules/snapshot/manifests/cron.pp
D modules/snapshot/manifests/cron/centralauthdump.pp
3 files changed, 0 insertions(+), 129 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/85/334985/1

diff --git a/modules/snapshot/files/cron/dumpcentralauth.sh 
b/modules/snapshot/files/cron/dumpcentralauth.sh
deleted file mode 100755
index e3c6923..0000000
--- a/modules/snapshot/files/cron/dumpcentralauth.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-#############################################################
-# This file is maintained by puppet!
-# modules/snapshot/cron/dumpcentralauth.sh
-#############################################################
-
-source /usr/local/etc/set_dump_dirs.sh
-
-usage() {
-    echo "Usage: $0 --site <datacenter> [--config <pathtofile>] [--dryrun]"
-    echo
-    echo "  --site     codfw, eqiad, etc"
-    echo "  --config   path to configuration file for dump generation"
-    echo "             (default value: ${confsdir}/wikidump.conf"
-    echo "  --dryrun   don't run dump, show what would have been done"
-    exit 1
-}
-
-configfile="${confsdir}/wikidump.conf"
-dryrun="false"
-site=""
-
-while [ $# -gt 0 ]; do
-    if [ $1 == "--config" ]; then
-        configfile="$2"
-        shift; shift
-    elif [ $1 == "--dryrun" ]; then
-        dryrun="true"
-        shift
-    elif [ $1 == "--site" ]; then
-        site="$2"
-        shift; shift
-    else
-        echo "$0: Unknown option $1"
-        usage
-    fi
-done
-
-if [ -z "$site" ]; then
-    echo "site parameter is mandatory."
-    usage
-fi
-
-private=`egrep "^private=" "$configfile" | mawk -Fprivate= '{ print $2 }'`
-mysqldump=`egrep "^mysqldump=" "$configfile" | mawk -Fmysqldump= '{ print $2 
}'`
-apachedir=`egrep "^dir=" "$configfile" | mawk -Fdir= '{ print $2 }'`
-gzip=`egrep "^gzip=" "$configfile" | mawk -Fgzip= '{ print $2 }'`
-if [ -z "$private" -o -z "$mysqldump" -o -z "$gzip" -o -z "$apachedir" ]; then
-    echo "failed to find value of one of the following from config file 
$configfile:"
-    echo "private, mysqldump, gzip, dir"
-    echo "exiting..."
-    exit 1
-fi
-
-wmfconfigdir="${apachedir}/wmf-config"
-multiversionscript="${apachedir}/multiversion/MWScript.php"
-dbphpfile="${wmfconfigdir}/db-${site}.php"
-if [ ! -f "$dbphpfile" ]; then
-    echo "failed to find $dbphpfile, exiting..."
-    exit 1
-fi
-
-dbcluster=`grep centralauth "$dbphpfile" | mawk -F"'" ' { print $4 }'`
-if [ ! "$dbcluster" ]; then
-    echo "no db cluster available for this site, exiting..."
-    exit 1
-fi
-
-wiki=`grep $dbcluster "$dbphpfile" | grep wiki | head -1 | mawk -F"'" ' { 
print $2 }'`
-host=`php -q "$multiversionscript" getSlaveServer.php --wiki="$wiki" 
--group=dump`
-if [ -z "$dbcluster" -o -z "$wiki" -o -z "$host" ]; then
-    echo "can't locate db server for centralauth, exiting."
-    exit 1
-fi
-
-wikiadmin=`echo 'echo $wgDBadminuser;' | php "$multiversionscript" eval.php 
$wiki`
-wikipass=`echo 'echo $wgDBadminpassword;' | php "$multiversionscript" eval.php 
$wiki`
-if [ -z "$wikiadmin" -o -z "$wikipass" ]; then
-    echo "can't get db user name and password, exiting."
-    exit 1
-fi
-
-tables="global_group_permissions global_group_restrictions global_user_groups 
globalblocks globalnames globaluser localnames localuser migrateuser_medium 
spoofuser wikiset"
-today=`date +%Y%m%d`
-dir="$private/centralauth/$today"
-mkdir -p "$dir"
-for t in $tables; do
-    outputfile="$dir/centralauth-$today-$t.gz"
-    if [ "$dryrun" == "true" ]; then
-        echo "would run:"
-        echo -n "$mysqldump" -u "$wikiadmin" -p"$wikipass" -h "$host" --opt 
--quick --skip-add-locks --skip-lock-tables centralauth "$t"
-        echo  "| $gzip > $outputfile"
-    else
-        # echo "dumping $t into $outputfile"
-        "$mysqldump" -u "$wikiadmin" -p"$wikipass" -h "$host" --opt --quick 
--skip-add-locks --skip-lock-tables centralauth "$t" | "$gzip" > "$outputfile"
-    fi
-done
diff --git a/modules/snapshot/manifests/cron.pp 
b/modules/snapshot/manifests/cron.pp
index 1115317..734f9bc 100644
--- a/modules/snapshot/manifests/cron.pp
+++ b/modules/snapshot/manifests/cron.pp
@@ -4,7 +4,6 @@
     class { '::snapshot::cron::mediaperprojectlists': user => $user }
     class { '::snapshot::cron::pagetitles': user   => $user }
     class { '::snapshot::cron::cirrussearch': user   => $user }
-    class { '::snapshot::cron::centralauthdump': user   => $user }
     class { '::snapshot::cron::dumplists': user   => $user }
     class { '::snapshot::cron::wikidatadumps::json': user   => $user }
     class { '::snapshot::cron::wikidatadumps::ttl': user   => $user }
diff --git a/modules/snapshot/manifests/cron/centralauthdump.pp 
b/modules/snapshot/manifests/cron/centralauthdump.pp
deleted file mode 100644
index 0290dc3..0000000
--- a/modules/snapshot/manifests/cron/centralauthdump.pp
+++ /dev/null
@@ -1,31 +0,0 @@
-class snapshot::cron::centralauthdump(
-    $user   = undef,
-) {
-    include ::snapshot::dumps::dirs
-    $confsdir = $snapshot::dumps::dirs::confsdir
-
-    file { '/usr/local/bin/dumpcentralauth.sh':
-        mode   => '0755',
-        owner  => 'root',
-        group  => 'root',
-        source => 'puppet:///modules/snapshot/cron/dumpcentralauth.sh',
-    }
-
-    # used by script to find the name of the corresponding db.php file
-    if ($::site == 'eqiad') {
-        $dbsite = $::site
-    }
-    else {
-        $dbsite = 'secondary'
-    }
-
-    cron { 'centralauth-dump':
-        ensure      => 'present',
-        command     => "/usr/local/bin/dumpcentralauth.sh --site ${dbsite} 
--config ${confsdir}/wikidump.conf",
-        environment => 'MAILTO=ops-du...@wikimedia.org',
-        user        => $user,
-        minute      => '15',
-        hour        => '8',
-        weekday     => '6',
-    }
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc2b085c33f2d76c67fec32a965d4da368226385
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <ar...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to