Sorry, should have mentioned that, I do set allow_mult=true. Also, it seems I had a problem with my initial test - what was failing to find the object was my map reduce query, a simple find by key worked just fine. But now there seem to be two issues:
1) How does Riak handle siblings when doing a map reduce query? I assumed that there would simply be more elements in the values array, but it seems that this is not the case. Basically, the beginning of my javascript map function looks something like this: function(param) { for ( var i=0; i < param.values.length; i++ ) { ... do stuff with param.values[i] ... but this does not seem to let me access all the siblings (or I might have screwed something up elsewhere in my code, of course). Is this how siblings should be handled in map reduce? If not, how? 2) Now I'm running into another issue where even a simple find by key seems to act weird. When I PUT the object for the first time, I get this vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= Then I read the object, and get the same vclock back: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= Then, I modify it, PUT it again, and get a new vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5bEyzHy95TRfFgA= Then, I do two deletes, one with each of the vlocks: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5bEyzHy95TRfFgA= Then, I do another read, and I get a 300 response with 3 siblings, two marked X-Riak-Deleted and a third one whose value matches the second PUT. The vclock I get along with the 300 response is: a85hYGBgzGDKBVIcypz/fgZJFyllMCWy5LEyzHy95TRfFgA= (Full packet capture, including the setup of the bucket attached). Why does Riak create the third sibling? All I've basically done is created a new object, modified it, and then deleted it, once with a stale vclock, once with the latest vclock. On Mon, Sep 23, 2013 at 7:19 PM, Brady Wetherington <br...@bespincorp.com>wrote: > Well, I'm not sure, and I'm new to Riak too, but I *think* you'd need to > set allow_multi on the bucket. > > -B. > > > On Mon, Sep 23, 2013 at 4:01 AM, Gints <gints.gaili...@gmail.com> wrote: > >> I did a PUT, and the vclock that came back was: >> a85hYGBgzGDKBVIcypz/fgZJFylnMCUy5rEyNOdtOc2XBQA= >> >> Then I read the object back, modified it, and PUT it again, providing the >> old vclock, and got a new vclock: >> a85hYGBgzGDKBVIcypz/fgZJFylnMCUy5bEyNOdtOc2XBQA= >> >> (Notice they are slightly different: Uy5rEy -> Uy5bEy) >> >> Then, I did a DELETE, using the first vector clock, not the second, >> updated >> one. >> >> After that the object was gone, I could not find it in the database any >> more. >> >> Is this supposed to be like that - deleting an object providing a stale >> vclock actually deletes it? Or am I probably doing something wrong? >> >> Thanks, >> Gints >> >> >> >> >> -- >> View this message in context: >> http://riak-users.197444.n3.nabble.com/DELETE-and-vclocks-tp4029176.html >> Sent from the Riak Users mailing list archive at Nabble.com. >> >> _______________________________________________ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> > >
------------------------------------------------------------------ PUT /buckets/14926742_test_objects/props HTTP/1.1 Host: localhost:8098 Accept: */* Content-Type: application/json Content-Length: 54 {"props":{"n_val":3,"r":2,"w":2,"dw":2,"pr":2,"pw":2}} HTTP/1.1 204 No Content Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 0 ------------------------------------------------------------------ PUT /buckets/14926742_test_objects/props HTTP/1.1 Host: localhost:8098 Accept: */* Content-Type: application/json Content-Length: 29 {"props":{"allow_mult":true}} HTTP/1.1 204 No Content Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 0 ------------------------------------------------------------------ PUT /buckets/14926742_test_objects/keys/123?returnbody=true HTTP/1.1 Host: localhost:8098 Accept: */* Content-Type: application/json x-riak-index-_sync_worker_num_int: 0 x-riak-index-id_int: 123 Content-Length: 169 {"id":123,"int":1,"_last_update_mts":1379954585386,"_deleted":false,"_vtags":"a:1:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;}","_sync_worker_num":0} HTTP/1.1 200 OK X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= x-riak-index-id_int: 123 x-riak-index-_sync_worker_num_int: 0 Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Link: </buckets/14926742_test_objects>; rel="up" Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT ETag: "7tE0kxbo5ovXc49Njz6jZ" Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 169 {"id":123,"int":1,"_last_update_mts":1379954585386,"_deleted":false,"_vtags":"a:1:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;}","_sync_worker_num":0} ------------------------------------------------------------------ GET /buckets/14926742_test_objects/keys/123 HTTP/1.1 Host: localhost:8098 Accept: multipart/mixed Accept: application/json HTTP/1.1 200 OK X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= x-riak-index-id_int: 123 x-riak-index-_sync_worker_num_int: 0 Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Link: </buckets/14926742_test_objects>; rel="up" Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT ETag: "7tE0kxbo5ovXc49Njz6jZ" Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 169 {"id":123,"int":1,"_last_update_mts":1379954585386,"_deleted":false,"_vtags":"a:1:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;}","_sync_worker_num":0} ------------------------------------------------------------------ PUT /buckets/14926742_test_objects/keys/123?returnbody=true HTTP/1.1 Host: localhost:8098 Accept: */* Content-Type: application/json X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= x-riak-index-_sync_worker_num_int: 0 x-riak-index-id_int: 123 Content-Length: 231 {"id":123,"int":2,"_last_update_mts":1379954585402,"_deleted":false,"_vtags":"a:2:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;s:48:\"001379954585402:eedf0a117d3d00de7dfb77728337c3c6\";i:1;}","_sync_worker_num":0} HTTP/1.1 200 OK X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5bEyzHy95TRfFgA= x-riak-index-id_int: 123 x-riak-index-_sync_worker_num_int: 0 Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Link: </buckets/14926742_test_objects>; rel="up" Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT ETag: "1SPC3oOtT5H9voW0eIcMsw" Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 231 {"id":123,"int":2,"_last_update_mts":1379954585402,"_deleted":false,"_vtags":"a:2:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;s:48:\"001379954585402:eedf0a117d3d00de7dfb77728337c3c6\";i:1;}","_sync_worker_num":0} ------------------------------------------------------------------ DELETE /buckets/14926742_test_objects/keys/123 HTTP/1.1 Host: localhost:8098 Accept: */* X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5rEyzHy95TRfFgA= HTTP/1.1 204 No Content Vary: Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: application/json Content-Length: 0 ------------------------------------------------------------------ DELETE /buckets/14926742_test_objects/keys/123 HTTP/1.1 Host: localhost:8098 Accept: */* X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCUy5bEyzHy95TRfFgA= HTTP/1.1 204 No Content Vary: Accept, Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: text/plain Content-Length: 0 ------------------------------------------------------------------ GET /buckets/14926742_test_objects/keys/123 HTTP/1.1 Host: localhost:8098 Accept: multipart/mixed Accept: application/json HTTP/1.1 300 Multiple Choices X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fgZJFyllMCWy5LEyzHy95TRfFgA= Vary: Accept, Accept-Encoding Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT ETag: "5z0Amml5azjy81APTysbPZ" Date: Mon, 23 Sep 2013 16:43:05 GMT Content-Type: multipart/mixed; boundary=UiTacyd0BczYDw1Dow5QYRlfDZt Content-Length: 969 --UiTacyd0BczYDw1Dow5QYRlfDZt Content-Type: application/octet-stream Link: </buckets/14926742_test_objects>; rel="up" Etag: 2bhNOw6eQgfGfZnNm1j6Hi Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT X-Riak-Deleted: true --UiTacyd0BczYDw1Dow5QYRlfDZt Content-Type: application/octet-stream Link: </buckets/14926742_test_objects>; rel="up" Etag: 6VyhkLsUYMj1bCtBTJFue4 Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT X-Riak-Deleted: true --UiTacyd0BczYDw1Dow5QYRlfDZt Content-Type: application/json Link: </buckets/14926742_test_objects>; rel="up" Etag: 1SPC3oOtT5H9voW0eIcMsw Last-Modified: Mon, 23 Sep 2013 16:43:05 GMT x-riak-index-_sync_worker_num_int: 0 x-riak-index-id_int: 123 {"id":123,"int":2,"_last_update_mts":1379954585402,"_deleted":false,"_vtags":"a:2:{s:48:\"001379954585386:5c91802edbfb6ed98dd3f11673df1884\";i:1;s:48:\"001379954585402:eedf0a117d3d00de7dfb77728337c3c6\";i:1;}","_sync_worker_num":0} --UiTacyd0BczYDw1Dow5QYRlfDZt--
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com