Commit graph

21 commits

Author SHA1 Message Date
Reedy
c7eb28aac9 Fix various MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: I50c7c93f1534e966224f98a835ca01f93eb9416d
2020-05-21 01:06:05 +00:00
Aaron Schulz
3c7f29a6b9 Add small HtmlCacheUpdater service class to normalize purging code (2)
This is a re-submit of 35da1bbd7c, which was accidentally merged before
CR (and reverted with aa4da3c2e8).

The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.

Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
  query does not actually happen until the job runs

Bug: T230025
Change-Id: Ic1005e70e2c22d5bd1ca36dcdb618108ebe290f3
2020-04-14 03:19:07 +00:00
Daimona Eaytoy
69cadf44a9 Unsuppress PhanParamsTooMany
This is the last repo-wide suppressed issue. Hurrah.

Bug: T231636
Change-Id: I3dc939f115bea14848c9c40bc52a7601f86ca0a7
2019-10-10 12:44:08 -07:00
Umherirrender
fa607f56b2 Type hint against IResultWrapper in maintenance classes
Change-Id: I6a58e9cfe645056a854c80b2db1e71fb59bd226b
2019-06-19 21:42:32 +02:00
James D. Forrester
f9f8dff40f Rename CDN config variables to be generic, deprecating the old names
Hook, methods, classes still to rename where appropriate.

Bug: T104148
Depends-On: Id34339dff88bc6d1863378ac94b96b2d590b891d
Depends-On: I4e2938395bcbf7956b83fff00978f09c61dcfa36
Change-Id: I7a725dae551c867a4fa7c213838d52c7fb862756
2019-05-24 21:09:22 +00:00
Thiemo Kreuz
01d6c5325c maintenance: Rewrite parts of the purgeChangedPages script
My motivation to touch this code was a few count() I found confusing.
I ended rearranging it a lot to improve readability and clarity.

Change-Id: I9a0ea0812d4cc0c6e8ed6134e462dfdf325fd5d9
2019-04-02 04:35:20 +00:00
Aaron Schulz
cb15755e92 Normalize use of "INNER JOIN" to "JOIN" in database queries
The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
2019-03-06 09:17:30 -08:00
Thiemo Kreuz
007bfbf835 maintenance: Add missing limit parameters to some explode()
This is, in theory, a loophole that can not only cause such code to
consume suprising amounts of memory and runtime. It can also create
suprising results. For example, an input like

 -param="might contain a = char"

might result in a cut-off value.

Not so much of a problem in a maintenance script. But still good
practice, I find.

Change-Id: I14fb278e6fdb61d0c486ca7e23229851ea479408
2019-03-01 17:17:40 +00:00
Umherirrender
ad776c7d5f Use ::class to resolve class names in maintenance scripts
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
2018-01-23 17:40:16 +00:00
Max Semenik
dac20d0ffa Introduce Maintenance::getBatchSize()
Just to isolate the internals. Fix most of usages in the core.

Change-Id: I8b3e9ca1f42b7c49ee57f17b88ca2fc7b404f342
2017-11-05 13:26:12 -08:00
Aaron Schulz
e01fd44388 Move ResultWrapper subclasses to Rdbms
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
2017-03-03 00:44:41 +00:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Max Semenik
59db24e90b Use addDescription() instead of accessing mDescription directly
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
2016-01-30 01:28:32 -08:00
Aaron Schulz
282c5fa9f3 Rename SquidUpdate => CdnCacheUpdate
Squid is not the only possible CDN

Change-Id: Ie2a2955847c5706e630322bbbab71c9d063b378f
2015-12-09 16:31:17 -08:00
Timo Tijhof
ff6513f28b Remove '@section LICENSE'
This was used in 2 special classes, the logger classes and spread
to a few other random classes.

Afaik this has no meaning. Is for something we don't use, and
goes against the meaning of '@section' in Doxygen, which we do
use.

In Doxygen output, all LICENSE references became links to
ProfilerXhprof (the one Doxygen encoutered first).

Bug: T72328
Change-Id: Icc7c443245c70bc0f549bee7d105eef5691c864d
2014-11-26 02:20:55 +00:00
umherirrender
6b4c44c2db Add missing @param to function docs
Change-Id: Ib26407bc55dff7969d8a3b1e2ae51751b202d8fb
2014-08-18 16:24:59 +00:00
umherirrender
abfa0d7854 Standardize @todo
Always use lowercase @todo
Changed some "@FIXME" to "@todo FIXME: "

Change-Id: I016d1f9511e6f3bbd22427f0fffeccd77ab5e0db
2014-07-23 22:27:20 +02:00
Siebrand Mazeland
5a77286a1e Update formatting in maintenance/ (3/4)
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
2014-04-23 20:09:13 +02:00
Bryan Davis
55651f02f2 Add configurable delay between purgeChangedPages batches
UDP flooding is possible when purging large numbers of files. This
change adds a command line switch to the purgeChangedPages.php
maintenance script to insert an artificial delay between purge batches.
The intent is to allow the network time to process the batch that was
just sent before flooding with a second batch.

`--sleep-per-batch` can be used in combination with `--batch-size` to
manage network and to some extent query load. A suggested starting point
would be to use `--sleep-per-batch=500` in concert with the default
batch size of 100 to target a maximum rate of 200 packets/second.

Bug: 55632
Change-Id: Ibfc54b1767f145098465404a2b23cd92852e41fd
2013-10-15 15:38:52 +00:00
Bryan Davis
7cee9fd38d Add script to purge changed pages from cache
This maintenance script could be used to recover from large HTCP
listener outages and/or network partitions. It searches the database for
pages having revisions occurring within a specified time period,
converts them to full URLs and sends squid/varnish purge messages using
SquidUpdate. A command line option allows specifying a specific
IP:port combination for HTCP purge datagrams which can be used to
isolate the purge announcement to a particular varnish server or data
center.

Co-Authored by: Aaron Schulz <aschulz@wikimedia.org>
Bug: 54647
Change-Id: Id0e95290e83333545e6bb0378cc620c35c653bf9
2013-10-07 17:50:20 -06:00