From 9a4dc4b755351e8637f980b545489a2c40673875 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 29 Jan 2018 17:29:20 -0800 Subject: [PATCH] objectcache: add some WANObjectCache comments to set() and delete() Change-Id: I527f1244c5c7cece888ace25e7a01653cf2b9542 --- includes/libs/objectcache/WANObjectCache.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 409f507969..08424c9c8a 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -419,6 +419,12 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * * Setting 'lag' and 'since' help avoids keys getting stuck in stale states. * + * Be aware that this does not update the process cache for getWithSetCallback() + * callers. Keys accessed via that method are not generally meant to also be set + * using this primitive method. + * + * Do not use this method on versioned keys accessed via getWithSetCallback(). + * * Example usage: * @code * $dbr = wfGetDB( DB_REPLICA ); @@ -535,6 +541,10 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * * Note that set() can also be lag-aware and lower the TTL if it's high. * + * Be aware that this does not clear the process cache. Even if it did, callbacks + * used by getWithSetCallback() might still return stale data in the case of either + * uncommitted or not-yet-replicated changes (callback generally use replica DBs). + * * When using potentially long-running ACID transactions, a good pattern is * to use a pre-commit hook to issue the delete. This means that immediately * after commit, callers will see the tombstone in cache upon purge relay. -- 2.20.1