Last modified: 2014-01-29 06:18:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58069, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56069 - incr destroys expiration on RedisBagOStuff
incr destroys expiration on RedisBagOStuff
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.22.0
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 21:32 UTC by Matthew Flaschen
Modified: 2014-01-29 06:18 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2013-10-23 21:32:57 UTC
The fix to bug 55986 has a problem, which is that incr loses the expiration date.  This is because Redis does not preserve it on set (http://redis.io/commands/expire).  So until we can use the built-in Redis INCR, we need to re-set the expiration.
Comment 1 Matthew Flaschen 2013-10-23 21:36:54 UTC
It should work (with a very small time error) to check it with http://redis.io/commands/ttl then reset it after the increment.
Comment 2 Aaron Schulz 2013-10-23 21:49:51 UTC
We should really just not serialize integers, which could avoid all these problems without a bunch of round trips.
Comment 3 Matthew Flaschen 2013-10-23 22:04:06 UTC
Agreed.  It might cause some breakage with existing values, though.
Comment 4 Tyler Romeo 2013-10-24 04:26:43 UTC
(In reply to comment #2)
> We should really just not serialize integers, which could avoid all these
> problems without a bunch of round trips.

We should really file this as an upstream bug.
Comment 5 Matthew Flaschen 2013-10-24 06:19:53 UTC
(In reply to comment #4)
> We should really file this as an upstream bug.

To where, phpredis?  I'm fine with that if it makes sense, but we should first think a bit what the "right" thing is.  Note that strings are also serialized currently ("s:3:\"123\";").

So if you simply serialize neither, you can no longer preserve the type info:

gettype( "3" ) vs. gettype( 3 )

That might be fine for some applications, but not always.  Or you could let numbers be the only thing not serialized in SERIALIZER_PHP mode, but I'm not 100% positive that's best either.

And of course, if you don't serialize it all, it solves this, but if I understand the phpredis code, your objects and arrays are now just "Object" and "Array".
Comment 6 Matthew Flaschen 2013-10-24 06:22:32 UTC
(In reply to comment #5)
> That might be fine for some applications, but not always.  Or you could let
> numbers be the only thing not serialized in SERIALIZER_PHP mode, but I'm not
> 100% positive that's best either.

Even if it is for us, it may or may not work upstream (and existing values are still an issue).
Comment 7 Gerrit Notification Bot 2013-11-21 18:44:36 UTC
Change 96801 had a related patch set uploaded by Aaron Schulz:
Fixes to RedisBagOStuff

https://gerrit.wikimedia.org/r/96801
Comment 8 Gerrit Notification Bot 2013-12-03 20:48:22 UTC
Change 96801 merged by jenkins-bot:
Fixes to RedisBagOStuff

https://gerrit.wikimedia.org/r/96801

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links