r99061 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99060‎ | r99061 | r99062 >
Date:23:41, 5 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
MFT r94199
Modified paths:
  • /branches/wmf/1.18wmf1/includes/objectcache/MemcachedClient.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/objectcache/MemcachedClient.php
@@ -958,6 +958,12 @@
959959 } else {
960960 $this->stats[$cmd] = 1;
961961 }
 962+
 963+ // Memcached doesn't seem to handle very high TTL values very well,
 964+ // so clamp them at 30 days
 965+ if ( $exp > 2592000 ) {
 966+ $exp = 2592000;
 967+ }
962968
963969 $flags = 0;
964970

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94199Merge r93797 to trunk, in a somewhat modified form: clamp expiries for memcac...catrope21:15, 10 August 2011

Comments

#Comment by Midom (talk | contribs)   23:46, 5 October 2011

btw, my 1.17 logic makes sense, I don't know why you guys dropped the < 1e9 check

#Comment by Reedy (talk | contribs)   00:04, 6 October 2011

Blame Roan

#Comment by Catrope (talk | contribs)   13:23, 6 October 2011

Maybe you could tell me why the <1e9 was there? Maybe you could have even put this in a comment when you committed the change in the first place so we wouldn't have to guess and/or ask?

#Comment by Midom (talk | contribs)   13:31, 6 October 2011

"avoid not caching data because of stupid memcached heuristics on ttl value"

see, heuristics doesn't mean "handling very high TTL values very well", Wikipedia defines it as:

"Heuristic ( /hjʉˈrɪstɨk/; or heuristics; Greek: "Εὑρίσκω", "find" or "discover") refers to experience-based techniques for problem solving, learning, and discovery. Heuristic methods are used to speed up the process of finding a satisfactory solution, where an exhaustive search is impractical. Examples of this method include using a "rule of thumb", an educated guess, an intuitive judgment, or common sense."

What it means here, is that I'm overwriting some kind of rule of thumb and deliberately want to leave a high value by establishing another boundary in the check.

Why would I want that?

Because heuristics decide whether TTL is relative or absolute, and we still allow that. I was trying to make the change without enforcing bad behavior.

When you dropped the range check, you potentially broke something, without thinking much, and blaming that you were not informed enough. You were informed, you had the check in the code, which was based on whatever I was contemplating on at that time.

Cheers! ;-)

Status & tagging log