Proper way do delete datatypes ( map )

Alexander Popov mogadanez at gmail.com
Thu Oct 2 14:10:51 EDT 2014


Since I use http interface I decide for now to not delete records at all.
I just empty it by
{ remove :[allmykeys], update:{timestamp}}
command.
Probably later I will implement kind of task to kill lost empty items, but
now this way work  fine for me. I will never get siblings headache and
yokozuna index is fine all time

P.s I'm realy appreciate new RIAK. It is incredible improvement.  Great
work!
02.10.2014 20:10 пользователь "Russell Brown" <russell.brown at me.com>
написал:

> Hi Alexander,
>
> I think you are deleting data-types the proper way.
>
> What is your `delete_mode` setting, please?
>
> I would guess that sibling you are seeing is a tombstone, which suggests
> you have some concurrent update with the delete.
>
> You will only ever have a single CRDT sibling, and 1 (or possibly more)
> tombstone siblings.
>
> If you write back just the binary CRDT sibling as the value in the normal
> K/V interface, any concurrent data type updates will merge ok to a single
> value.
>
> I don’t know about your Yokozuna question, but I think it is just that
> Yokozuna indexes each sibling as an independent document.
>
> Let me know if that works out OK for you, please?
>
> Cheers
>
> Russell
>
> On 2 Oct 2014, at 12:54, Alexander Popov <mogadanez at gmail.com> wrote:
>
> I have map bucket with some data( with neseted maps )
> aprox structure( don't know does it matter or not ):
> {
> "update": {
> "some_register": "value",
> "some_flag": "disable",
> "nested_map": {
> "update": {
> "nested1_map": {
> "update": {
> "some_register": "value",
> "some_flag": "disable",
> }
> },
> "nested1_map": {
> "update": {
> "some_register": "value",
> "some_flag": "disable",
> }
> }
> }
> },
> "some_counter": 13,
> }
> }
>
>
> Updates works fine. Even simultaneous
> But Sometimes  I need recreate entire value, so I Delete it using
> curl -XDELETE http://host:8098/types/maps/buckets/mybucket/keys/some
>
> After that sometimes  siblings appears.
>
>
> curl -H "Accept: multipart/mixed"
> http://host:8098/types/maps/buckets/mybucket/keys/some
>
> show that confict with delete
>
> --XZ98hy0TJbr4sVETS44XBEJf7Yt
> Last-Modified: Thu, 02 Oct 2014 11:29:15 GMT
>
> E
> ��A�6-.... some binary
> --XZ98hy0TJbr4sVETS44XBEJf7Yt
> Content-Type: application/octet-stream
> Link: </buckets/proof-watch-items>; rel="up"
> Etag: 1MqocFt6qWeQxIw8bE1B8e
> Last-Modified: Thu, 02 Oct 2014 11:29:03 GMT
> X-Riak-Deleted: true
>
>
> --XZ98hy0TJbr4sVETS44XBEJf7Yt--
>
>
> Further updates to datatype using
> http://host:8098/types/maps/buckets/mybucket/datatypes/some NOT create
> new sibling. It is replace previous one.
>
> Problems:
>
> 1. I should remove datatype with different method? Or how  to resolve such
> conflicts? probably
> Data I receive is binary, and query like
> curl -H "Accept: multipart/mixed"
> http://host:8098/types/maps/buckets/mybucket/datatypes/some
> to get json data not works.Should I post it as binary back?
>
>
> 2. I have also search index on this bucket.
>   each further  updates to this datatype before resolution creates new
> records in solr because
> _yz_id includes sibling id:
> 1*maps*mybucket*some*34*46hGXxyhuW3yn3L8bRHIml
>
> good news that when I delete record again all entries in solr deleted too.
>
>
>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20141002/706d2fb6/attachment.html>


More information about the riak-users mailing list