Hi Qiang,

Since you are running with allow_mult=false, make sure the clocks of your
Riak nodes are synchronized. If they are out of sync, newer values may get
overridden by older ones on read, depending on the node a request hits
first. Of course this won't cover 100% of cases because a perfect clock
synchronization is just impossible.

Also, setting notfound_ok to "false" may help if you encounter not founds
for keys you are sure have been written.

Good luck!
Vitaly

On Fri, Mar 4, 2016 at 5:19 AM, Qiang Cao <caoqiang...@gmail.com> wrote:

> Sargun, do you mean I should also pass back the vclock with the GET
> request?
>
>
> On Thu, Mar 3, 2016 at 10:05 PM, Qiang Cao <caoqiang...@gmail.com> wrote:
>
>> Thanks, Sargun and Alexander! I tried setting pr, pw, and sloppy_quorum.
>> It looks that these help. I got less stale values. But the issue wasn't
>> completely resolved. I'm using Riak 2.1.2.
>>
>> -Qiang
>>
>>
>> On Thu, Mar 3, 2016 at 9:46 PM, Sargun Dhillon <sar...@sargun.me> wrote:
>>
>>> So, if you pass back the vclock while pr=pw=quorum, and sloppy_quorum
>>> = false you should get RYOW consistency.
>>>
>>> On Thu, Mar 3, 2016 at 6:25 PM, Christopher Mancini <cmanc...@basho.com>
>>> wrote:
>>> > If you don't need strong consistency for all Riak requests, just
>>> certain
>>> > ones, then explore the use of R and N vals that can be passed along
>>> with the
>>> > request or on a bucket-type level.
>>> >
>>> > On Thu, Mar 3, 2016 at 9:23 PM Mark Schmidt <mschm...@orcawave.net>
>>> wrote:
>>> >>
>>> >> Hi Qiang,
>>> >>
>>> >>
>>> >>
>>> >> Other more skilled folks can correct me if I am wrong, but I believe
>>> you
>>> >> can enforce strong consistency on your nodes:
>>> >> http://docs.basho.com/riak/latest/theory/concepts/strong-consistency/
>>> >>
>>> >>
>>> >>
>>> >> If I recall, you will take a performance hit as all nodes must
>>> receive the
>>> >> data.
>>> >>
>>> >>
>>> >>
>>> >> Thanks,
>>> >>
>>> >>
>>> >>
>>> >> -          Mark Schmidt
>>> >>
>>> >>
>>> >>
>>> >> From: riak-users [mailto:riak-users-boun...@lists.basho.com] On
>>> Behalf Of
>>> >> Qiang Cao
>>> >> Sent: Thursday, March 03, 2016 6:13 PM
>>> >> To: Dave King <djk...@gmail.com>
>>> >> Cc: riak-users <riak-users@lists.basho.com>
>>> >> Subject: Re: Continuous HTTP POSTs to Riak
>>> >>
>>> >>
>>> >>
>>> >> Thanks, Dave! I'm aware of Riak's eventual consistency. I wonder how
>>> I can
>>> >> get Riak work in the way as I need. I'm in a situation where I expect
>>> the
>>> >> immediate GET reads the value I've just posted. And the GET request
>>> isn't
>>> >> sent out until the POST is done.
>>> >>
>>> >>
>>> >>
>>> >> Thanks,
>>> >>
>>> >> -Qiang
>>> >>
>>> >>
>>> >>
>>> >> On Thu, Mar 3, 2016 at 6:53 PM, Dave King <djk...@gmail.com> wrote:
>>> >>
>>> >> You need to google 'Eventual consistency'.
>>> >>
>>> >>
>>> >>
>>> >> - Peace
>>> >>
>>> >> Dave
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Thu, Mar 3, 2016 at 4:23 PM, Qiang Cao <caoqiang...@gmail.com>
>>> wrote:
>>> >>
>>> >> Hi All,
>>> >>
>>> >>
>>> >>
>>> >> I use Riak as a KV store and send http requests to its REST API to
>>> update
>>> >> entries. Instead of using curl, I use Apache HttpClient to send
>>> requests.
>>> >>
>>> >>
>>> >>
>>> >> One thing bothering me is that sometimes I find the entry isn't
>>> properly
>>> >> updated after an HTTP POST/PUT. For example, if I do an HTTP GET on
>>> the same
>>> >> key immediately after an HTTP POST, the chance is good that I get a
>>> stale
>>> >> value. This happens when I continuously POST to a multi-node Riak,
>>> and some
>>> >> of the posts target the same key.
>>> >>
>>> >>
>>> >>
>>> >> Also, I find I don't have this issue if I use a single-node Riak. So I
>>> >> think something wasn't correct with my multi-node Riak cluster (I set
>>> >> "allow_mult" to false).  Any thoughts?
>>> >>
>>> >>
>>> >>
>>> >> Thanks in advance!
>>> >>
>>> >>
>>> >>
>>> >> Qiang
>>> >>
>>> >>
>>> >>
>>> >> _______________________________________________
>>> >> riak-users mailing list
>>> >> riak-users@lists.basho.com
>>> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> _______________________________________________
>>> >> riak-users mailing list
>>> >> riak-users@lists.basho.com
>>> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>> >
>>> > --
>>> > Sincerely,
>>> >
>>> > Christopher Mancini
>>> > -----------------------------
>>> >
>>> > employee = {
>>> >     purpose: solve problems with code,
>>> >     phone:    7164625591,
>>> >     email:     cmanc...@basho.com,
>>> >     github:    http://www.github.com/christophermancini
>>> > }
>>> >
>>> > _______________________________________________
>>> > riak-users mailing list
>>> > riak-users@lists.basho.com
>>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>> >
>>>
>>
>>
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to