Thanks Brian, looking forward to the new client. Thanks for the workaround too!
Cheers Cos On Friday, 27 February 2015 at 18:45, Brian Roach wrote: > This was due to the UpdateValueFuture not checking for the exception > when the get() methods were called. Just fixed this, it'll be in the > very-soon-to-be-cut 2.0.1 release. > > https://github.com/basho/riak-java-client/pull/503 > > Sync calls are just a wrapper around the async call that calls get() - > You can currently work around this by calling UpdateValue async: > > RiakFuture<UpdateValue.Response, Location> future = > Riakclient.executeAsync(updateOp); > > future.await(); > if (future.isSuccess()) { > ... > } else { > ... > } > > Thanks, > - Roach > > On Tue, Feb 3, 2015 at 3:39 PM, Cosmin Marginean <[email protected] > (mailto:[email protected])> wrote: > > I have an edge case where consistency is favoured over availability so I’m > > using a "consistent": true bucket type for a very specific operation. > > I worked in testing my setup so ended up faking an entire failure by > > deliberately using an incorrect vClock. > > > > Using StoreValue, the (second) write fails as expected > > > > FetchValue fetchOp = new FetchValue.Builder(location(id)).build(); > > VClock vClock = client.execute(fetchOp).getVectorClock(); > > //fiddle with vClock or allow the first write to finish before the next > > step > > StoreValue storeOp = new StoreValue.Builder(value) > > .withVectorClock(vClock) > > .withLocation(location(id)).build(); > > StoreValue.Response response = client.execute(storeOp); > > > > > > Caused by: com.basho.riak.client.core.netty.RiakResponseException: failed > > at > > com.basho.riak.client.core.netty.RiakResponseHandler.channelRead(RiakResponseHandler.java:52) > > at > > io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:340) > > at > > io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:326) > > > > > > I managed to override the UpdateValue class to simulate a similar failure > > scenario (so I don’t have to do the fetch + store myself). I was expecting a > > similar result, however, after some analysis I realised that an exception is > > being swallowed somewhere. > > I believe the trouble might be around this area: > > https://github.com/basho/riak-java-client/blob/develop/src/main/java/com/basho/riak/client/api/commands/kv/UpdateValue.java#L581 > > > > The exception is not allowed to bubble up to the client code. Additionally, > > another net effect of this seems to be that a null response is returned here > > > > UpdateValue.Response res = client.execute(updateOp); > > > > So a call to res.wasUpdated() will produce a NPE! > > > > The way I see it, this code needs to either > > 1) return not-null res and res.wasUpdated() as false > > or > > 2) allow the exception to bubble up > > > > Please let me know your thoughts > > > > Thank you > > Cos > > > > > > _______________________________________________ > > riak-users mailing list > > [email protected] (mailto:[email protected]) > > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > > >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
