This prevents admins being able to view suppressed files, by simply
deleting them, and then undeleting only the file revision that they
want to view.
This dates back to r43288. Unclear if it was intentional.
Bug: T132926
Change-Id: Ib767de853a37099305db20529378fa756ee1bdfe
At the moment the job might start before the transaction
that creates the file's row in the DB has had a chance
to run.
Bug: T106740
Change-Id: If5b94e83d8bbcc6aebfe7193f7b580f03cbd627d
* This puts the complex logic here after the commit step for
all DBs, making the main multi-DB transaction more likely
to be atomic. Previously, the idle callbacks could be hit
bewteen DB commits.
* Enforce transactionality via AtomicSectionUpdate.
* Use $this instead of $that hacks for old PHP versions.
Change-Id: Idf7d54fdac6487f86907099680f5c1c4f5530b4e
* Verify the DB updates and bail before doing anything instead
of relying on rollback() if something does not match up.
* Do the file copying before updating the DB so that there is
nothing to rollback if they fail.
* Improved failCount in case the current version is missing.
It should also reflect all the missing old versions.
Change-Id: Ie2d316548d8e5584cc69bb9f1425db108b05be5c
* This puts the complex logic here after the commit step for
all DBs, making the main multi-DB transaction more likely
to be atomic.
* Made some cleanups to AtomicSectionUpdate and made it cancel
if the transaction is rolled back as it should.
* Also cleaned up some closures for PHP 5.4.
Change-Id: If2f7bb6b1ba6daf1cfdc934f27c32b0b10431a3d
If the first query to the master DB is after lock() and DBO_TRX is
set, make sure that the LocalFile updates still join the implicit
transaction that the rest of the request is in.
This helps keep the commit step tight when multiple DBs are touched
by making sure that the main DB commits in commitMasterChanges()
along with any others.
Bug: T119736
Change-Id: I6cc29f9201947e4415336528d30cba7f88567b41
* Added onTransactionResolution() DB method.
* Use this method so that file unlocks fire on unlockAndRollback()
as well as on DB errors (via MWExceptionHandler::handleException).
This prevents locks from getting stuck for minutes when deadlocks
happen, since the LockManager::destruct() method is not reliable.
* Fix broken reference counting which always released locks on the
first unlock() call, even if there were 2+ lock() calls.
* Added some type hints to IDatabase methods.
* Fixed DatabaseBase::__destruct() logging to include all callbacks.
Bug: T132921
Change-Id: I684706957f4d794cb6fe61505b0d26b7893de706
This single metric is responsible for a substantial proportion of overall
statsd traffic on the Wikimedia cluster, per the task cited below. Nobody is
closely monitoring this statistic. We can reintroduce it with sampling at a
later date if it is deemed to be useful.
Bug: T101141
Change-Id: I6457cb91d527ce42c0918ac4e80613e6b59061ac
Status::getWikiText is used for internal logging, api error messages and
maintenance scripts. All this places are usually in english, so pass an
english language to getWikiText.
Change-Id: I3010fca8eb5740a3a851c55a8b12e171714c78f7
This adds new methods to ManualLogEntry that allow to specify that
a log entry is patrollable. RecentChange::newLogEntry then checks
this in order to allow or not unpatrolled status instead of checking
if there is an associated rev id. This allows to associate a revision
to a log entry without possibly making the recent change unpatrolled,
and extensions can implement patrol of actions not dependent on an
associated revision id.
Bug: T127848
Change-Id: I98298047142819b69639e6ca9d77c5ba982a380c
* The cleanupTempFile() method now only marks it as ready
for unlinking when unreferenced.
* Pass TempFSFile down the FileRepo call chain so that it
can build off a5d903860a and allow more fast async writes
for secondary backends. Previously, the 'store' operation
used on upload forced sync file change replication writes.
* Also fix bogus method call in LocalFile::publishTo().
Bug: T91869
Change-Id: I06caa6e5d8bdec9a7cae2b68cb02dd2e64b9ac74
- Add 'tags' parameters to appropriate API modules
- Add tag-adding logic to appropriate functions that carry out
relevant functions
- ManualLogEntry::{set,get}Tags to handle adding tags to log
entries in a cleaner fashion
- Use ManualLogEntry::setTags in LocalFile::recordUpload2
Bug: T97720
Change-Id: I98c52da7985623bfdafda2dc2dae937b39b72419
UploadBase::performUpload() now takes a $tags parameter and passes it
to LocalFile::upload() and LocalFile::recordUpload2(), which
eventually adds the requested tags to the log_id, rev_id and rc_id
that are created for the file upload.
Previously you'd have to query the database for the latest rev_id and
log_id for the page title under which the title is being uploaded, as
performUpload() is unable to return them to you because it's all
deferred in funny ways.
Bug: T121874
Change-Id: I99a8fd67c84219d2715d3d88cc21500614431179
For file patrolling, we rely on the timestamp of image revision
(`image` table) and log entry (`logging` table) being the same, but we
weren't actually making sure it is the same.
Note that the timestamp of page revision can still differ, but that
shouldn't matter and it's a more involved fix.
Change-Id: I8e1b75d744c4a96cb0bb636b153d6e8ea2ee1fcf
The implementation from 0160b410bd only
stored the associated rev id in the `recentchanges` table, which was
sufficient for its purpose of allowing patrol of these log entries and
provided some change tagging improvements, but ephemeral.
Now we also store it in `logging` and `log_search` tables, which makes
it possible to find a revision for the log entry and vice versa.
* For `log_search` we just add a row with 'associated_rev_id' as key,
it was designed for exactly this purpose.
* For `logging` we store it in log_params field in ManualLogEntry, and
transparently remove it from there when building a DatabaseLogEntry.
Bug: T122089
Change-Id: I559587ff77b3c94b31a6c5951287b6f9c1e167ce
This allows to patrol file uploads, both new files and new file
versions, from the description page, provided $wgUseFilePatrol
is set to true. Special:NewFiles can be filtered to hide patrolled
files.
Bug: T11501
Change-Id: If71af58719a4461f12d125455b7bef07164525ca
* Using addUpdate() makes sure purges are coalesced and
de-duplicated.
* Also removed incosistent $wgUseSquid checks. If CDN caching
is not used, then $wgSquidServers will just be empty anyway.
Bug: T119016
Change-Id: I8b448366f037f668385d252f9d68289b71d1a707
Use deferred updates and transaction hooks
to get the cache updates after the publish()
DB updates instead
Change-Id: I0a922182f7dd5f22c1e661171b0df1a49a637aef
* This gets lag information that is useful when
the calling code is about to run queries that
will have their results cached.
* This is now used in place of trxTimestamp() for
WANObjectCache set() and getWithSetCallback().
* The WAN cache will use a low TTL if the lag is
too high to avoid caching stale data for weeks.
* Bumped MAX_COMMIT_DELAY as nothing enforces it.
Bug: T113204
Change-Id: I2a95b4088cff42d6e980351555f81a4b13519e24