Page MenuHomePhabricator

Migrate wikibase-dispatch-changes crons to systemd timers
Closed, ResolvedPublic

Description

cron { 'wikibase-dispatch-changes4':
    ensure  => $ensure,
    command => "echo \"\$\$: Starting dispatcher\" >> ${dispatch_log_file}; /usr/local/bin/mwscript extensions/Wikibase/repo/maintenance/dispatchChanges.php --wiki wikidatawiki >> ${dispatch_log_file} 2>&1; echo \"\$\$: Dispatcher exited with $?\" >> ${dispatch_log_file}",
    user    => $mediawiki::users::web,
    minute  => '*/3',
    require => File['/var/log/wikidata'],
}

cron { 'wikibase-dispatch-changes-test':
    ensure  => $ensure_testwiki,
    command => "echo \"\$\$: Starting dispatcher\" >> ${test_dispatch_log_file}; /usr/local/bin/mwscript extensions/Wikibase/repo/maintenance/dispatchChanges.php --wiki testwikidatawiki >> ${test_dispatch_log_file} 2>&1; echo \"\$\$: Dispatcher exited with $?\" >> ${test_dispatch_log_file}",
    user    => $mediawiki::users::web,
    minute  => '*/15',
    require => File['/var/log/wikidata'],
}

I'm filing this specifically because it's the last MediaWiki cron that runs on mwmaint*. If we could get rid of this we could simplify some code in the DC switchover process.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It's a bit hard to implement this as systemd timers are not concurrent and the crons here are designed to be three at the same time. Finding a solution for it should be easy though (famous last words)

It's a bit hard to implement this as systemd timers are not concurrent and the crons here are designed to be three at the same time. Finding a solution for it should be easy though (famous last words)

If you wanted to implement this super properly, you could use systemd templates. Or just define 3 timers...

This is going to get replaced with jobs soon (maybe in a couple of months) so I wouldn't put too much work in it. Having three systemd timers sounds much easier to implement.

Change 710515 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Reduce ten seconds from dispatch max time

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

Change 710519 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/puppet@production] mediawiki: Migrate dispatching cron of testwikidatawiki to systemd timer

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

Change 710520 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/puppet@production] mediawiki: Migrate wikidatawiki dispatch crons to three systemd timers

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

Change 710515 merged by jenkins-bot:

[operations/mediawiki-config@master] Reduce ten seconds from dispatch max time

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

Mentioned in SAL (#wikimedia-operations) [2021-08-10T14:48:19Z] <ladsgroup@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:710515|Reduce ten seconds from dispatch max time (T288175)]] (duration: 00m 58s)

Change 710519 merged by Giuseppe Lavagetto:

[operations/puppet@production] mediawiki: Migrate dispatching cron of testwikidatawiki to systemd timer

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

Change 710520 merged by RLazarus:

[operations/puppet@production] mediawiki: Migrate wikidatawiki dispatch crons to three systemd timers

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

Change 713501 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/puppet@production] mediawiki: Drop absented crons in wikidata.pp

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

Change 713501 merged by RLazarus:

[operations/puppet@production] mediawiki: Drop absented crons in wikidata.pp

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

Change 713502 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/puppet@production] mediawiki: Absent logrotate for wikidata

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

Change 713503 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/puppet@production] mediawiki: Drop logrotate config for wikidata

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

Maybe after a while we should delete the old logs, I can put a reminder to delete them in three months.

Change 713502 merged by RLazarus:

[operations/puppet@production] mediawiki: Absent logrotate for wikidata

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

Change 713503 merged by RLazarus:

[operations/puppet@production] mediawiki: Drop logrotate config for wikidata

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

Maybe after a while we should delete the old logs, I can put a reminder to delete them in three months.

Note: Three months have passed. I looked at the directories and didn't find /var/log/wikidata/ directories in mwmaint nodes (both eqiad and codfw). Nothing to be done then :)