If a template is created, and then used on a page, and then the template
is updated, all within an hour, then the page_touched of the page is
never updated and the user will always see the old template contents.
This is because htmlCacheUpdate jobs are fully suppressed for one hour
following template creation, due to the WAN backlink partition cache.
So:
* Revert 4f3efbf406, so that htmlCacheUpdate jobs always do
something regardless of the state of the partition cache.
* Factor out the job queueing parts of WikiPage::onArticleCreate,
::onArticleDelete and ::onArticleEdit. Instead of queueing a job
unconditionally, check for the existence of backlinks in a post-send
deferred update. If there are none, don't queue the job.
* It's convenient to use BacklinkCache::hasLinks(), however, it suffered
from the same stale cache problem as BacklinkCache::partition(). It's
a short and fast query, and code review shows that none of the callers
are particularly performance sensitive. So, do not use the WAN cache
in BacklinkCache::hasLinks().
* Since hasLinks() and getNumLinks() no longer share a significant
amount of code, separate them. Remove the $max parameter from
getNumLinks(), which only existed to support hasLinks() and has no
other usages in codesearch.
* Log a debug message when entering the post-send request stage, so that
it's easier to confirm that no additional pre-send queries are done.
* Add a regression test, confirmed to previously fail.
Bug: T368006
Change-Id: Id5c7af6d4fcdbeb6724a9036133742c5f76624df
Changed some inserts to use multi-row insert for small performance
benefit where possible and not already used.
InsertQueryBuilder does not return a value, deprecated since 1.33
Bug: T353219
Change-Id: I2380ebc8ec8db178dd790247aefbdd798b6d62ff
Calling `count()` in a for loop is terrible as the no. of elements in
the array gets recomputed every time. Instead, just call it once and
use the variable to avoid slowness of tests. We shouldn't put more load
on CI to make it slower :D
Change-Id: I9b94bda646e8d922e1f91c9d83d16370caaf8fbd
BacklinkCache::get(), ::getLinks(), ::getCascadeProtectedLinks()
have been removed from core. No longer used.
Change-Id: I84d743719e08c755dc98777ecf6d6d1e92eb2d2b
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
The day has gone. Still keeping the code as the schema changes are not
done in production but the data migration has been finished.
Bug: T299417
Change-Id: I906e069a63d1dae14924c72318b22b16244371d6
- schema change to allow tl_namespace and tl_title being empty
This is done by removing them from primary key. They don't need to be
nullable as they have default value.
- Make sure with WRITE_NEW, updater avoids writing to the old columns
Bug: T306674
Change-Id: I2b8a29043e952060e7a79b6a7a3d647d48cd16fb
Expected value is the first parameter to assertSame() or assertEquals().
And turn to use assertCount() for some assertions aginst count of array.
Based on code search `assert(?:Same|Equals)\(.+,.+expected` and I look
through files roughly, so some assertions that don't contains 'expected'
are also fixed. In the meantime, some assertions that I am not clear
about are not touched.
Change-Id: I75798b60d29fd19b33f4fdf34ed3c788db420d01