Deletion followed by re-addition leads to siblings when it shouldn't

Kaspar Thommen kaspar.thommen at gmail.com
Fri Aug 3 02:48:45 EDT 2012


Anyone please?
On Jul 28, 2012 6:59 PM, "Kaspar Thommen" <kaspar.thommen at gmail.com> wrote:

> Hi,
>
> I ran the following Java snippet that creates a bucket, stores a key/value
> pair in it, deletes the key, and adds a new value for that same key. The
> n-value is 3 and all r- and w-values are also set to 3 to ensure full
> consistency (for testing only). Here's the code:
>
>     public static void main(String[] args) throws Exception {
>         IRiakClient riak = RiakFactory.pbcClient();
>         try {
>             // store an object in a new bucket
>             Bucket testBucket =
> riak.createBucket("testBucket").nVal(3).allowSiblings(true).execute();
>             testBucket.store("key", "value1").w(3).execute();
>
> System.out.println(testBucket.fetch("key").r(3).execute().getValueAsString());
>  // prints 'value1'
>
>             // now delete it and store another object with the same key
>             testBucket.delete("key").r(3).w(3).execute();
>             testBucket.store("key", "value2").w(3).execute();
>
> System.out.println(testBucket.fetch("key").r(3).execute().getValueAsString());
>  // throws 'UnresolvedConflictException: Siblings found'
>
>         } finally {
>             riak.shutdown();
>         }
>     }
>
> As you can see by the comment I have added to the code fetching the key a
> second time should, in my opinion, return the new value, but it fails
> because there are siblings. Maybe I didn't fully understand how sibling
> handling works, but I don't see how there can possibly be any siblings
> given that r and w are 3. Any pointers? I tried the LevelDB and memory
> backends, same result.
>
> Thanks,
> Kaspar
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120803/e3fa9c04/attachment.html>


More information about the riak-users mailing list