Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Couchbase PHP client library v1.1.1 returns random integer on get request

7 replies [Last post]
  • Login or register to post comments
Fri, 12/21/2012 - 05:57
creotiv
Offline
Joined: 11/14/2011
Groups: None

I'm experiencing strange bug. While script making get request to the server,key value equal 0,it returns some random int from zero to infinity.

Top
  • Login or register to post comments
Fri, 12/21/2012 - 06:34
creotiv
Offline
Joined: 11/14/2011
Groups: None

Found strange correlation between key and result.

t:pt:741083ced77095344721b2ca604e8866 = 41083
t:pt:b188d55343d629c5317b162821e1d9fb = 188
.. etc

Does any one have any ideas what can it be?

Top
  • Login or register to post comments
Mon, 12/24/2012 - 01:57
ingenthr
Offline
Joined: 03/16/2010
Groups:

I'm not certain I understand the issue you're describing. Do you have a small snippet of code that demonstrates it?

Top
  • Login or register to post comments
Mon, 12/24/2012 - 02:13
creotiv
Offline
Joined: 11/14/2011
Groups: None

i have key that can be equal 1 or 0, but sometimes Couchbase returns number much bigger then 1. And this number it get from key (like this t:pt:741083ced77095344721b2ca604e8866 = 41083)

Unfortunately i still didn't find what exactly cause this bug. But seems to me that appears under high concurrency of get requests.

Top
  • Login or register to post comments
Thu, 12/27/2012 - 00:07
daschl
Offline
Joined: 05/19/2012
Groups: None

Hey, again can you please post a short script that produces the issue? Normally this shouldn't happen, also please make sure that you don't (re)use the CAS variable (maybe the response from the set) accidentally.

Top
  • Login or register to post comments
Thu, 12/27/2012 - 01:20
creotiv
Offline
Joined: 11/14/2011
Groups: None

problem is that the code that produce this bug is simple get request, without cas and other. In normal situаtion it work normally. But some times gives this values.
I will check maybe something before this request creating such situation. If i found something i will post here.

Top
  • Login or register to post comments
Wed, 01/09/2013 - 05:43
creotiv
Offline
Joined: 11/14/2011
Groups: None

Finally i reproduced this bug. But honestly i don't understand it at all.

Here is PHP code:

$cache = new Couchbase("176.9.18.166:8091", "", "", "default");
echo "1: " . $cache->get('backp:bc_mock_100002726262169');
echo "\n";
echo "2: " . $cache->get('t:u:6081232');
echo "\n";
echo "3: " . $cache->get('t:019b4c82261ee64d55296e94170a11ba');
echo "\n";
echo "4: " . $cache->get('t:pt:019b4c82261ee64d55296e94170a11ba');
echo "\n";

Answer:
1:
2: 3976df0c9944ed0f86eb80f45ee876dc
3: {"users_min": "5", "time_end": 1357734600, "level_min": "34", "tournament_id": "3976df0c9944ed0f86eb80f45ee876dc", "start_type": "daily", "users_max": "2000", "time_start": 1357732800, "level_max": "38", "fishtypes": ["144"], "disable_timeables": "0", "start_day": "5", "awards": [{"money_v": "1000", "money_r": "10", "items": {}, "reputation": "5", "place": "1", "exp": "1100", "social": "default", "provision": "0"}, {"money_v": "5000", "money_r": "0", "items": {}, "reputation": "5", "place": "1", "exp": "1100", "social": "pengyou", "provision": "0"}, {"money_v": "250", "money_r": "4", "items": {}, "reputation": "3", "place": "2", "exp": "300", "social": "default", "provision": "0"}, {"money_v": "1850", "money_r": "0", "items": {}, "reputation": "3", "place": "2", "exp": "300", "social": "pengyou", "provision": "0"}, {"money_v": "125", "money_r": "2", "items": {}, "reputation": "1", "place": "3", "exp": "150", "social": "default", "provision": "0"}, {"money_v": "925", "money_r": "0", "items": {}, "reputation": "1", "place": "3", "exp": "150", "social": "pengyou", "provision": "0"}], "tournament_type": "29", "desc": "The task is to catch the biggest Freshwater Stingray at Wild Coast (Amur River) among all players participating in the Tournament.", "name": "Freshwater Stingray Tournament", "map_pid": "3", "enabled": 1, "variant_type": 4002, "cost_r": "0", "location_pid": "1", "result_type": "maxWeight", "cost_v": "750", "enable_week": "0"}
4: 976 (must be zero)

But if i remove few lines of code(first get request), code:

$cache = new Couchbase("176.9.18.166:8091", "", "", "default");
echo "2: " . $cache->get('t:u:6081232');
echo "\n";
echo "3: " . $cache->get('t:019b4c82261ee64d55296e94170a11ba');
echo "\n";
echo "4: " . $cache->get('t:pt:019b4c82261ee64d55296e94170a11ba');
echo "\n";

Answer:
2: 3976df0c9944ed0f86eb80f45ee876dc
3: {"users_min": "5", "time_end": 1357734600, "level_min": "34", "tournament_id": "3976df0c9944ed0f86eb80f45ee876dc", "start_type": "daily", "users_max": "2000", "time_start": 1357732800, "level_max": "38", "fishtypes": ["144"], "disable_timeables": "0", "start_day": "5", "awards": [{"money_v": "1000", "money_r": "10", "items": {}, "reputation": "5", "place": "1", "exp": "1100", "social": "default", "provision": "0"}, {"money_v": "5000", "money_r": "0", "items": {}, "reputation": "5", "place": "1", "exp": "1100", "social": "pengyou", "provision": "0"}, {"money_v": "250", "money_r": "4", "items": {}, "reputation": "3", "place": "2", "exp": "300", "social": "default", "provision": "0"}, {"money_v": "1850", "money_r": "0", "items": {}, "reputation": "3", "place": "2", "exp": "300", "social": "pengyou", "provision": "0"}, {"money_v": "125", "money_r": "2", "items": {}, "reputation": "1", "place": "3", "exp": "150", "social": "default", "provision": "0"}, {"money_v": "925", "money_r": "0", "items": {}, "reputation": "1", "place": "3", "exp": "150", "social": "pengyou", "provision": "0"}], "tournament_type": "29", "desc": "The task is to catch the biggest Freshwater Stingray at Wild Coast (Amur River) among all players participating in the Tournament.", "name": "Freshwater Stingray Tournament", "map_pid": "3", "enabled": 1, "variant_type": 4002, "cost_r": "0", "location_pid": "1", "result_type": "maxWeight", "cost_v": "750", "enable_week": "0"}
4: 0 (that is normal answer)

Also if key 4 changed to value 1, then answer will be 1976(it add 1 at the start of answer)

Answer on 4th request corelate with answer from key 't:u:6081232' that equal '3976df0c9944ed0f86eb80f45ee876dc'.
Also if i add get('_') before 3rd request i will get normal answer on 4th request.
I think problem may lay in response buffer.

Top
  • Login or register to post comments
Wed, 01/09/2013 - 05:58
creotiv
Offline
Joined: 11/14/2011
Groups: None

Created issue in bug tracker: http://www.couchbase.com/issues/browse/PCBC-179

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker