Last modified: 2013-05-28 10:44:41 UTC
2012-12-19 18:54:25 srv195 tawikisource: Memcached error for key "tawikisource:shorturls:title:திருவிவிலியம்/இணைத்_திருமுறை_நூல்கள்/பாரூக்கு_(எரேமியாவின்_மடல்)/அதிகாரங்கள்_5_முதல்_6_வரை" on server ":": A BAD KEY WAS PROVIDED/CHARACTERS OUT OF RANGE
What's the maximum length?
What's the practical influence of this? Asking as http://ta.wikisource.org/wiki/திருவிவிலியம்/இணைத்_திருமுறை_நூல்கள்/பாரூக்கு_(எரேமியாவின்_மடல்)/அதிகாரங்கள்_5_முதல்_6_வரை still shows and offers http://ta.wikisource.org/s/30q as a ShortURL which works...
It hits the database everytime that is queried, so not as performant as it should be. Plus of course, not the 'right' thing to do.
(In reply to comment #1) > What's the maximum length? The maximum length is 250 *bytes*: https://github.com/memcached/memcached/blob/master/doc/protocol.txt (In reply to comment #2) > What's the practical influence of this? Asking as > http://ta.wikisource.org/wiki/திருவிவிலியம்/இணைத்_திருமுறை_நூல்கள்/ > பாரூக்கு_(எரேமியாவின்_மடல்)/அதிகாரங்கள்_5_முதல்_6_வரை > still shows and offers http://ta.wikisource.org/s/30q as a ShortURL which > works... You could have overlapping keys if the difference between them exists beyond the 250 character mark. There's a simple solution to this, and it's to hash the title before using it in a key. sha1($title) will give you a 40-byte string.
According to quick google search pecl/memcached does hashing automatically if the key is too long, so just a small change to our php/memcached layer then?
Removing 'easy'.
Is anyone working on this?
I suppose this would be a core change?
(In reply to comment #8) > I suppose this would be a core change? I would just change the extension now and worry about core later.
Is it okay to invalidate current keys? If not, I'll just hash keys that are longer than the limit, assuming that is a hard limit. This will make sure that current keys are not invalidated. If it is okay to invalidate I'll just hash everything.
(In reply to comment #10) > Is it okay to invalidate current keys? If this means breaking links, I'd say: absolutely not okay, ever.
(In reply to comment #11) > If this means breaking links, I'd say: absolutely not okay, ever. No - the links are stored in the database. Invalidating keys will only mean a slight increase in the memcached miss rate for a period of time.
Related URL: https://gerrit.wikimedia.org/r/59165 (Gerrit Change I386794c46cbd8e203cbc45115a40d8f399e0939b)
https://gerrit.wikimedia.org/r/59165 (Gerrit Change I386794c46cbd8e203cbc45115a40d8f399e0939b) | change APPROVED and MERGED [by jenkins-bot]
Gerrit patch got merged, can this bug report get closed as RESOLVED FIXED or is there anything else to do?
I guess so, though I would have hoped answer for comment #5
(In reply to comment #5) > According to quick google search pecl/memcached does hashing automatically if > the key is too long, so just a small change to our php/memcached layer then? It doesn't hash automatically. By default it just silently fails to set key. See https://gist.github.com/atdt/fd88e2e4a0c31884907f.