Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

.Net client problem with byte[] to ulong binary conversion

1 reply [Last post]
  • Login or register to post comments
Mon, 08/15/2011 - 12:07
slegay
Offline
Joined: 06/11/2010
Groups: None

Hi there, one of our counters last week reached a value greater than ~ 2B and started producing corrupt data (negative values).

We identified the issue to be on the Enyim client's method that parses ulong bytes. It looks as if half of the bytes gets parsed property, the other half doesn't.

I submitted an issue, unit test and temporary fix on the Github project:

https://github.com/enyim/EnyimMemcached/issues/77

but you guys might want to elevate priority on this since it can be really devastating for anyone relying on Memcached counters.

The fix I provided creates a new byte array in order to reverse the bytes and BitConverter to parse it. Using bit shifting would probably be more efficient, but the approach we took was guaranteed to produce a reliable value.

New unit tests should also be created to test all 8-byte integer conversions with values outside the 4-byte range. I *think* UInt64 encoding is working as expected, but you may want to take a closer look.

Top
  • Login or register to post comments
Mon, 08/15/2011 - 16:58
perry
Offline
Joined: 10/11/2010
Groups:

Thanks slegay, I'll get the right eyes on this.

Perry

__________________

Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!

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