When is Vclock generated?
sean at basho.com
Fri Jul 22 09:06:07 EDT 2011
Are you trying to store the vclock as part of the value? I'm
Well-behaved clients should always fetch before writing, so your client
should have the most reasonably-fresh version of the object when you write.
There's really no way to guarantee that some other actor won't write a new
version between the time that you fetch the object and store it back, or
even in the time between your client issuing the write and it actually being
written to disk. Vector clocks and sibling values exist in part to help
disambiguate those race conditions. If you're submitting the write without
the vclock, your write could very well be ignored, so please fetch before
On Thu, Jul 21, 2011 at 6:13 PM, Andrew Berman <rexxe98 at gmail.com> wrote:
> I'm looking to store the vclock on my object to be used for
> versioning. Currently, when I get the object from Riak I fill in the
> version with the vclock from Riak (which I use to determine if the
> object is persistent and for passing back to Riak when putting) and
> then when the object is saved it saves the version as the previous
> vclock value. I'm wondering when the vclock is actually generated.
> Can I write a pre-commit hook that fills in the version so it has the
> most updated value or is there no way for me to do it. It's not a
> huge deal because the version value in the db is immediately updated
> upon loading the data from Riak, but I just feel like it would make
> things more consistent if I could have the version matching the
> updated vclock.
> Thanks for any help!
> riak-users mailing list
> riak-users at lists.basho.com
Sean Cribbs <sean at basho.com>
Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users