jenkins-bot has submitted this change and it was merged.
Change subject: objectcache: Add comments about DB isolation to WANObjectCache
......................................................................
objectcache: Add comments about DB isolation to WANObjectCache
Change-Id: Ic3454d0ebfdb05488dd650f77e09264842caea1c
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/libs/objectcache/WANObjectCache.php
b/includes/libs/objectcache/WANObjectCache.php
index 130caeb..45eb986 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -150,6 +150,13 @@
* - c) When the source data that "check" keys represent changes,
* the touchCheckKey() method is called on them
*
+ * Source data entities might exists in a DB that uses snapshot
isolation
+ * (e.g. the default REPEATABLE-READ in innoDB). Even for mutable data,
that
+ * isolation can largely be maintained by doing the following:
+ * - a) Calling delete() on entity change *and* creation, before DB
commit
+ * - b) Keeping transaction duration shorter than delete() hold-off
TTL
+ * However, pre-snapshot values might still be seen due to delete()
relay lag.
+ *
* For keys that are hot/expensive, consider using getWithSetCallback()
instead.
*
* @param string $key Cache key
@@ -418,8 +425,8 @@
*
* The simplest way to avoid stampedes for hot keys is to use
* the 'lockTSE' option in $opts. If cache purges are needed, also:
- * a) Pass $key into $checkKeys
- * b) Use touchCheckKey( $key ) instead of delete( $key )
+ * - a) Pass $key into $checkKeys
+ * - b) Use touchCheckKey( $key ) instead of delete( $key )
* Following this pattern lets the old cache be used until a
* single thread updates it as needed. Also consider tweaking
* the 'lowTTL' parameter.
--
To view, visit https://gerrit.wikimedia.org/r/240164
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3454d0ebfdb05488dd650f77e09264842caea1c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits