Hello Zsolt, Whether or not it is correct or valuable for you to use delete operations is (as with many features of Riak) largely dependent on your use-case. Deletes in the strongly consistent mode are much less valuable than deletes in the eventually consistent mode because keys are never reaped from strongly consistent buckets. You might be able to reclaim some disk space with a strongly consistent delete by shrinking the size of the stored value, but that key will never be removed from the system. The next time a GET is performed for that key, the return value should look like the return value for a key that never existed though, so if those are the semantics you're after it might still be correct to delete keys.
I hope that answered your question. Best, -Drew On Fri, Jan 9, 2015 at 4:55 AM, Zsolt Laky <zsolt.l...@lamardan.com> wrote: > Hello Drew, > > Thinking through the delete operation on a strong consistent bucket, a > question popped up for me. > > Should not we use delete_object instead to keep strong consistency? The > delete function takes a key and does not care about the current state/value > of the object itself. If in the meantime another process changes the value > of an object, delete will simply delete it. So is there a benefit using > delete on strongly consistent bucket other than swipe the bucket not caring > about other processes store their state info? > > Thanks for your thoughts, > Zsolt > > -----Eredeti üzenet----- > Feladó: riak-users [mailto:riak-users-boun...@lists.basho.com] Meghatalmazó > Drew Pirrone-Brusse > Küldve: Thursday, January 08, 2015 12:32 AM > Címzett: Igor Birman > Másolatot kap: riak-users@lists.basho.com > Tárgy: Re: Deleting a strongly consistent key > > Hello Igor, > > Deletions should be a strongly consistent operation, yes. If after a > successful strongly consistent delete a GET of that key returns stale data > something is likely wrong, be it with your application, the cluster, or Riak > itself. > > That said, deletions don't actually remove keys from Riak. Strongly > consistent deletions should behave identically to conditional PUTs, where > the value put is a tombstone. When Riak is running in an eventually > consistent mode, those tombstones are (sometimes) eventually harvested and > removed from disk. In the strongly consistent mode (as with `delete_mode = > keep`) Riak will never harvest those tombstones, so they will remain on disk > indefinitely. > Our documentation has lots of good information, if you're looking for some > implementation details[1]. > > Generally speaking, if you know you're going to immediately re-use a key, > it's better to simply overwrite values than issuing an intermittent delete. > > Best regards, > -Drew > > [1]: > http://docs.basho.com/riak/latest/ops/advanced/strong-consistency/#Implement > ation-Details > > On Wed, Jan 7, 2015 at 10:01 AM, Igor Birman <igor_bir...@yahoo.com> wrote: >> Is deleting a strongly consistent key a consistent operation? I have >> found in testing that if I delete a key and then attempt to >> immediately reuse it, sometimes the delete completes after I have >> reused it. Should I expect that when I get a 204 from a delete that I >> can immediately create a new key with the same id? >> >> _______________________________________________ >> 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 > > > --- > This email has been checked for viruses by Avast antivirus software. > http://www.avast.com > _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com