Re: Continuous HTTP POSTs to Riak

2016-03-06 Thread Vitaly E
Hi Qiang, You mentioned that my suggestion to synchronize the clocks of your Riak nodes had solved the problem. Let me explain why -- it may clear things up for you. Riak uses vector clocks / version vectors to keep track

Re: Continuous HTTP POSTs to Riak

2016-03-05 Thread Qiang Cao
Thanks, Russell. I'm just curious. My application handles that. Maybe that's just because of the vclock. -Qiang On Sat, Mar 5, 2016 at 2:09 PM, Russell Brown wrote: > And you pass the vclock back after a GET with the next POST? Unless we get > a look at the vclocks then

Re: Continuous HTTP POSTs to Riak

2016-03-05 Thread Russell Brown
And you pass the vclock back after a GET with the next POST? Unless we get a look at the vclocks then it's hard to say why or where you have concurrency. But since concurrency is ultimately unavoidable using riak, why the concern? Can your application/data model handle it is the main question?

Re: Continuous HTTP POSTs to Riak

2016-03-05 Thread Qiang Cao
Thanks, Russell! I do a GET immediately after a POST is done. I use apache httpclient, which handles requests synchronously. On the client, POSTs and GETs are sent out sequentially. On Sat, Mar 5, 2016 at 1:57 PM, Russell Brown wrote: > > On 5 Mar 2016, at 18:43, Qiang Cao

Re: Continuous HTTP POSTs to Riak

2016-03-05 Thread Russell Brown
On 5 Mar 2016, at 18:43, Qiang Cao wrote: > Just curious. The POSTs are sent out sequentially and a quorum is set up on > Riak. I wonder how would it happen that Riak still considers the POST > requests concurrent? Did you read the result of POST 1 before sending POST

Re: Continuous HTTP POSTs to Riak

2016-03-05 Thread Qiang Cao
Just curious. The POSTs are sent out sequentially and a quorum is set up on Riak. I wonder how would it happen that Riak still considers the POST requests concurrent? -Qiang On Fri, Mar 4, 2016 at 12:27 PM, Qiang Cao wrote: > This worked! Thank you, Vitaly! > > > On

Re: Continuous HTTP POSTs to Riak

2016-03-04 Thread Qiang Cao
This worked! Thank you, Vitaly! On Fri, Mar 4, 2016 at 3:18 AM, Vitaly E <13vitam...@gmail.com> wrote: > 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

Re: Continuous HTTP POSTs to Riak

2016-03-04 Thread Vitaly E
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. >>> >> >>> &g

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Qiang Cao
; If I recall, you will take a performance hit as all nodes must receive >> the >> >> data. >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> >> >> >> - Mark Schmidt >> >&

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Qiang Cao
gt; > >> If I recall, you will take a performance hit as all nodes must receive > the > >> data. > >> > >> > >> > >> Thanks, > >> > >> > >> > >> - Mark Schmidt > >> > >> > >> > >> From:

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Sargun Dhillon
;> >> >> >> 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 <

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Alexander Sicular
Hi Qiang, Check out RYOW semantics in this blog post, part 2 of a 4 part series , http://basho.com/posts/technical/riaks-config-behaviors-part-2/ . -Alexander @siculars http://siculars.posthaven.com Sent from my iRotaryPhone > On Mar 3, 2016, at 20:12, Qiang Cao

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Qiang Cao
>> 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

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Christopher Mancini
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> &

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Qiang Cao
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

Re: Continuous HTTP POSTs to Riak

2016-03-03 Thread Dave King
You need to google 'Eventual consistency'. - Peace Dave On Thu, Mar 3, 2016 at 4:23 PM, Qiang Cao 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. >

Continuous HTTP POSTs to Riak

2016-03-03 Thread Qiang Cao
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