Commit graph

13 commits

Author SHA1 Message Date
Umherirrender
1d09a3750d docs: Migrate to IDatabase::newInsertQueryBuilder
Bug: T353219
Change-Id: I088f6046a67c2eb1a7589d6b2ee4ef5a9c03f669
2024-04-14 21:45:08 +02:00
Timo Tijhof
5001f914d5 docs: Set stable permalink on markdown files
In Doxygen 1.9.7, the URL generation logic changed such that input
files in directories (i.e. /docs/Hooks.md) are published with the
slug `md_docs_2Hooks.html` instead of `md_docs_Hooks.html`.

This was done to improve an edge case where if two conflicting
files existed (e.g. docs_Foo.md and docs/Foo.md) both can now get
their own stable URL in a determimistic way (e.g. as opposed to
a-z sorting and appending _2 only if a conflict exists). But this
made other more common URLs no longer stable. Work around this by
setting an explict permalink for each markdown file.

Ref https://github.com/doxygen/doxygen/issues/10721.

Change-Id: Ifeb03602452c1148bd372555bebac9922c583ac2
2024-03-09 22:04:05 +00:00
Bartosz Dziewoński
4aebcfe097 Change more uses of getDBLoadBalancerFactory() to getConnectionProvider()
Some less trivial cases. Also update variable names.

This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.

Follow-up to 8604c384f6.

Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
2024-01-23 16:34:45 +01:00
Daimona Eaytoy
b381630ded docs: Use IConnectionProvider instead of LoadBalancer in database.md
Change-Id: I3a154806cf5f27d9afc618c0874ad04db808db33
2023-12-01 17:04:23 +00:00
Meno25
2369a0b7df docs: Don't point people to deprecated Diffusion copies of gerrit repos
Change-Id: I72e511dba5b607b3b215435b9d7ec8a3621d5cf8
2023-04-03 10:27:57 -04:00
Timo Tijhof
7cbb74133e Remove obsolete Rdbms query groups from getConnection calls
The currently supported groups are documented in database.md.

While at it, prefer the string form of the $groups parameter where
possible, since the complexity of an array is never utilized, as the
groups either can't overlap, or are decided on by the caller instead.

This also helps with the simpler LBFactory::getConnection() proposed
in T326274.

Bug: T263127
Bug: T326274
Change-Id: I7a31a07a8c3f1e265ac43ab59f23326590b407c3
2023-02-15 17:10:26 +00:00
Timo Tijhof
6365db67ba rdbms: Remove "read-only primary" and restore "short cache" in lagged mode
== What

* Trigger "lagged replica mode" even when all replicas are lagged.
  This partially undoes I53b261dfe (f59e4ad95e).
  This restores "shorten CDN cache" behaviour for third-party wikis.

* Change "lagged replica mode" to no longer have the side-effect of
  making primary DBs read-only, under any circumstances.

* Change "getLaggedReplicaMode" to no longer trigger a connection.
  If no data was queried, no stale data was served (mostly, there is
  potential via Memcached, but we don't measure that either way, and
  should be taken care of by rebound purges for production, though
  as explained below, this mode doesn't matter for production).

== Why

Follows-up I53b261dfe (f59e4ad95e), which changed lagged-replica
mode to no longer be triggered when all replicas are lagged. This
was motivated by the fact that
1. It is understood that at WMF it is impossible for all replicas to
   be lagged due to MySQL semi-sync, and
2. That this mode often triggers at WMF anyway due to how we measure
   lag, and
3. When this mode is activated it needlessly makes MW read-only.

This has as downsides that it means lagged-replica mode no longer
triggers for third-parties without semi-sync either, and thus the
side-effect of shortening caches doesn't work, and the Skin footer
message wouldn't be shown either.

The problem we want to solve, which I think translates to both WMF
and thid-parties, is that MediaWiki doesn't need to be responsible
for turning the site read-only when a replica is lagged. For scales
where that is a big problem, MySQL semi-sync can be used by the site
admin, and smaller sites either don't have replicas or are small enough
to not yet have this problem, and likely would be bottlenecked well
before the DB level anyway.

As such, solve T314975 differently by removing this activation of
read-only mode instead, and preserve/restore the rest of it in simpler
form.

== Background

The docs were very outdated, in particular the statement about
30 seconds. Historical references to that changing:
* 2015: The MW default setting was lowered from 30s to 10s,
  with commit I56a7f35382 (453d88605b, T95501).
* 2015: The WMF config for 'max lag' in $wgLBFactoryConf was gradually
  lowered from 30s to 6s, e.g. commit I7f71d75b (744722e784) and
  I02b1789095 (e8276e074f).
* 2019: The MW default was lowered from 10s to 6s,
  with commit Ic2e82a8cc (e8276e074f).

Bug: T314975
Change-Id: Ie55aad42d99c71c54137c7c4138093082e561097
2023-01-30 22:09:09 +00:00
Amir Sarabadani
e4f76d6e91 docs: Update database related documentation a bit
- Remove all of PG-related schema docs, explain it's automatically
   generated.
 - Similar for Sqlite.
 - Avoid calling $dbr->select().
 - wfGetDB() is deprecated.

Bug: T313863
Change-Id: Iad099c73009983008af1e4215ba9f3a05120be62
2022-08-26 16:12:42 +02:00
Siddharth VP
8242e84f9d Fix typos in docs
Change-Id: I5ccf296e0bd9afd8a82b620002346496cef18f0e
2022-01-09 21:59:57 +05:30
James D. Forrester
f2f9345e39 Replace uses of DB_MASTER with DB_PRIMARY in documentation and local variables
This is just a start.

Bug: T254646
Change-Id: I9213aad4660e27afe7ff9e5d2e730cbf03911068
2021-05-14 12:40:34 -07:00
Nikki Nikkhoui
3067ec77c2 Add db group documentation
Add section to database.md outlining simple
usage of database groups and the 3 remaining
supported types.

Bug: T267077
Change-Id: I66cb2fb063f291afc94ff207ef8d9a035bfc6a86
2020-12-09 23:10:48 +00:00
Reedy
d019a0775f s/slave/replica
Bug: T254646
Change-Id: I8397fc890e5ca19e28c50422ba056ff42e9fe23f
2020-06-11 00:50:10 +00:00
arcayn
2834212cc9 docs: Change docs/contenthandler.txt and docs/database.txt to markdown
Bug: T233244
Change-Id: Ieddd5e8850988b2ee66fd6c2c047000526c16a34
2019-12-04 19:20:54 +00:00