php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74235 Memcache returns stale or incorrect data under heavy read loads
Submitted: 2017-03-10 20:28 UTC Modified: 2017-03-10 20:29 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: malberts at zynga dot com Assigned:
Status: Open Package: memcache (PECL)
PHP Version: 5.6.29 OS: Amazon Linux AMI 2015.03
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-03-10 20:28 UTC] malberts at zynga dot com
Description:
------------
I believe this bug is related to https://bugs.php.net/bug.php?id=59542. The symptoms are similar.  

Content
 - php56 - 5.6.29 (5.6.29-1.131.amzn1)
 - php56-pecl-memcache - 3.0.8 (3.0.8-6.17.amzn1)
 - amazon linux - 3.14.35-28.38.amzn1.x86_64 #1 SMP Wed Mar 11 22:50:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
 - mpm prefork
 - httpd 2.4 - (2.4.25-1.68.amzn1 )

I'm noticing stale data on read. It's not 100%, fairly low volume, ~25 per hour with a request volume of 50 million per hour.

I'm able to detect the issue by either
 1. processing a netcat execution from within the script
 2. processing a secondary read

Data Context
 - key - ZAPI_IDMAPPER_72752798226
 - value on first read - {"zapi_identity_player_result_72752798226":"{\\"i\\":{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"},\\"n2p\\":{\\"72613683383\\":{\\"5003043\\":\\"72613683383\\"}}}"}
 - value on second read - {"ZAPI_IDMAPPER_72752798226":"{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}"}
 - value on netcat - ["VALUE ZAPI_IDMAPPER_72752798226 0 38","{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}","END"]

Notice NetCat and the secondary read returned the same value, which is the correct value ... which is not that value returned on the initial read.

I cant provide another example that mirrors the report

 - key - zapi_playerid_mapping|n2p|72752798226
 - value on first read - {"ZAPI_IDMAPPER_72752798226":"{\\"72613683383\\":\\"24\\",\\"72752798226\\":\\"1\\"}"}
 - value on second read - []
 - value on netcat - [END] 

In both cases the value returned on the first read is a value that would have been returned on a lookup at an earlier stage in the execution.  In fact, in both cases, when the value returned is incorrect, the incorrect value would have been the result of the get preceding this one in the call stack (e.g. it appears to be returning stale data from the previous call to get).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-10 20:29 UTC] malberts at zynga dot com
-PHP Version: 5.6.30 +PHP Version: 5.6.29
 [2017-03-10 20:29 UTC] malberts at zynga dot com
correcting version to 5.6.29
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 04:01:24 2019 UTC