It was recently reported, via the mailing list [1] [2], that 2i range
queries involving integers greater than or equal to 2147483647 (0x7fffffff)
could return
missing results. This bug was confirmed and the cause was identified to be
an issue with the encoding library sext [3], which Riak uses for indexes
stored in
eleveldb.  Sext serializes Erlang terms to a binary while preserving
sort order. For these large integers, this was not the case. Since the 2i
implementation relies on this property, some range queries were
affected.

The issue in sext was quickly patched [4] and will be included in the
next version of Riak (1.3.1).  New installations of Riak 1.3.1 will
immediately take advantage of the change. However, the fix introduces
an incompatibility in the encoding of big integers. Integer
indexes containing values greater than or equal to 2147483647
already written to disk with Riak 1.3 and below will need to be rewritten,
so that range queries over them will return the correct results.

Riak 1.3.1 will include a utility, as part of
`riak-admin`, that will perform the reformatting of these indexes
while the node is online. After the affected indexes have been
reformatted on all nodes, range queries will begin returning the
correct results for previously written data. The utility should be run
against any riak cluster using 2i after upgrading the entire cluster
to 1.3.1, regardless of whether or not large integer index values are
used. It will report how many indexes were affected (rewritten). Unaffected
indexes are not modified and new writes will be written in the correct
format.

More details on how to run the utility will be provided with the release of
Riak 1.3.1. We wanted to begin raising awareness on this now so 2i users
upgrading to 1.3.1 can take advantage of the fix as soon as it is released.
The changes have  been merged into the 1.3 branch. The original branch can
be found on GitHub [5]. If you have any questions or concerns, please let
us know.

Cheers,
Jordan

[1]
http://lists.basho.com/pipermail/riak-users_lists.basho.com/2013-March/011276.html

[2] https://github.com/basho/riak_kv/issues/499

[3] https://github.com/uwiger/sext

[4]
https://github.com/uwiger/sext/commit/ff10beb7a791f04ad439d2c1c566251901dd6bdc

[5] https://github.com/basho/riak_kv/tree/jrw-eas-2i-fix-keys-backport
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to