[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mediawiki-l
Subject:    [MediaWiki-l] [BREAKING CHANGE] Require MySQL 5.6 for pt-heartbeat lag detection in MW 1.36
From:       Timo Tijhof <ttijhof () wikimedia ! org>
Date:       2021-03-13 3:36:03
Message-ID: CAMjSS5PrS+2CW0TaCyNHROsf5zJRZbm=9ryMihXsfuZg6u7qBA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


TLDR:
* We'd like to drop MySQL 5.5 support for the
"lagDetectionMethod=pt-heartbeart"
option in $wgLBFactoryConf.
* If you have not configured the lagDetectionMethod option, or use MySQL
5.6+, then this does not affect you.

Hi,

If you host MediaWiki using MySQL (or MariaDB) and have a cluster of two or
more database hosts (using replication), then MediaWiki uses lag detection,
via the wikimedia/rdbms library. For example, if lag is too high, MediaWiki
tries to connect to a different replica database, or it may automatically
set the wiki in read-only mode for a few seconds until replication catches
up.

By default, MediaWiki uses the MySQL built-in "Seconds_Behind_Master"
feature to power this lag detection.

We also support use of Percona's pt-heartbeat service, which can be more
accurate, [1] and is what WMF currently uses. However, we are currently
unable to use its accuracy very well, because TIMESTAMPDIFF is not
supported in MySQL 5.5 (it was introduced in MySQL 5.6.4). [2]

In order to make pt-heartbeat more useful as a lag detection method, whilst
avoiding expensive roundtrips or runtime detection (which are not
acceptable in this hot code path), we'd either have to support three lag
detection methods, or to change the current one to require MySQL 5.6.

MySQL 5.5 reached end-of-life in Dec 2018, and there is an open proposal at
T273375 to drop support for it completely in a future version of MediaWiki.
[3] However, I'd like to propose we drop support for it now with the
pt-heartbeat feature specifically, as being opt-in and rarely used, so as
to not require additional complexity and maintenance for us in the form a
third lag detection method. Especially, as it might not be used by anyone.

If you're affected by this, then the upcoming MediaWiki 1.36 release would
require that you either set MW to use the default lag detection instead, or
upgrade to MySQL 5.6+.

Task: https://phabricator.wikimedia.org/T248481
Patch: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/657471

--
Timo Tijhof
Performance Team
Wikimedia Foundation

[1]
https://www.percona.com/blog/2014/05/02/how-to-identify-and-cure-mysql-replication-slave-lag/
[2] https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html
[3] https://phabricator.wikimedia.org/T273375

[Attachment #5 (text/html)]

<div dir="ltr"><div>TLDR:</div><div>* We&#39;d like to drop MySQL 5.5 support for the \
&quot;<span class="gmail-str">lagDetectionMethod=</span>pt-heartbeart&quot; option in \
$<span class="gmail-pln">wgLBFactoryConf</span>.</div><div>* If you have not \
configured the <span class="gmail-str">lagDetectionMethod option, or use MySQL 5.6+, \
then this does not affect \
you.<br></span></div><div><br></div><div>Hi,</div><div><br></div><div>If you host \
MediaWiki using MySQL (or MariaDB) and have a cluster of two or more database hosts \
(using replication), then MediaWiki uses lag detection, via the wikimedia/rdbms \
library. For example, if lag is too high, MediaWiki tries to connect to a different \
replica database, or it may automatically set the wiki in read-only mode for a few \
seconds until replication catches up.</div><div><br></div><div>By default, MediaWiki \
uses the MySQL built-in<span class="gmail-str"> &quot;<span \
class="gmail-str">Seconds_Behind_Master&quot; feature to power this lag \
detection.</span></span></div><div><span class="gmail-str"><span \
class="gmail-str"><br></span></span></div><div><span class="gmail-str"><span \
class="gmail-str"></span></span></div><div><span class="gmail-str"><span \
class="gmail-str">We also support use of Percona&#39;s pt-heartbeat service, which \
can be more accurate, [1] and is what WMF currently uses. However, we are currently \
unable to use its accuracy very well, because TIMESTAMPDIFF is not supported in MySQL \
5.5 (it was introduced in MySQL 5.6.4). [2]</span></span></div><div><span \
class="gmail-str"><span class="gmail-str"><br></span></span></div><div><span \
class="gmail-str"><span class="gmail-str">In order to make pt-heartbeat more useful \
as a lag detection method, whilst avoiding expensive roundtrips or runtime detection \
(which are not acceptable in this hot code path), we&#39;d either have to support \
three lag detection methods, or to change the current one to require MySQL \
5.6.</span></span></div><div><span class="gmail-str"><span \
class="gmail-str"><br></span></span></div><div><span class="gmail-str"><span \
class="gmail-str">MySQL 5.5 reached end-of-life in Dec 2018, and there is an open \
proposal at T273375 to drop support for it completely in a future version of \
MediaWiki. [3] However, I&#39;d like to propose we drop support for it now with the \
pt-heartbeat feature specifically, as being opt-in and rarely used, so as to not \
require additional complexity and maintenance for us in the form a third lag \
detection method. Especially, as it might not be used by \
anyone.</span></span></div><div><span class="gmail-str"><span \
class="gmail-str"><br></span></span></div><div><span class="gmail-str"><span \
class="gmail-str">If you&#39;re affected by this, then the upcoming MediaWiki 1.36 \
release would require that you either set MW to use the default lag detection \
instead, or upgrade to MySQL 5.6+.<br></span></span></div><div><span \
class="gmail-str"><span class="gmail-str"><br></span></span></div><div><span \
class="gmail-str"><span class="gmail-str">Task: <a \
href="https://phabricator.wikimedia.org/T248481">https://phabricator.wikimedia.org/T248481</a></span></span></div><div><span \
class="gmail-str"><span class="gmail-str">Patch: <a \
href="https://gerrit.wikimedia.org/r/c/mediawiki/core/+/657471">https://gerrit.wikimed \
ia.org/r/c/mediawiki/core/+/657471</a></span></span></div><div></div><div><br></div><div>--</div><div>Timo \
Tijhof</div><div>Performance Team</div><div>Wikimedia \
Foundation</div><div><br></div><div>[1] <a \
href="https://www.percona.com/blog/2014/05/02/how-to-identify-and-cure-mysql-replicati \
on-slave-lag/">https://www.percona.com/blog/2014/05/02/how-to-identify-and-cure-mysql-replication-slave-lag/</a></div><div>[2] \
<a href="https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html">https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html</a></div><div>[3] \
<a href="https://phabricator.wikimedia.org/T273375">https://phabricator.wikimedia.org/T273375</a></div></div>



[Attachment #6 (text/plain)]

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic