Hi Robert,
The object user_version is guaranteed to change when there is a write to the object, but versions are generally not consecutive, so you can't compare the distance between two versions and infer anything from that (beyond zero updates vs at least one update).
s
On Tue, Nov 30, 2021 at 9:43 AM Robert Vasek <rvasek01@xxxxxxxxx> wrote:
Hi ceph-dev,_______________________________________________
I have an application that needs to do some atomic reads and writes. To detect races, the application needs to check if the object was written to since the last time it has read it, so that it can fetch the object again and retry -- it needs some generation counter / epoch / version.
Originally I intended to store an integer inside the object and increment it each time the object is written to, and then check with rados_write_op_cmpext(). But then I noticed that RADOS API provides rados_get_last_version() and rados_{read,write}_op_assert_version() functions.
So my question is: when is this object version updated? Is it a simple "how many times was this object written to" counter that would be suitable for my needs?
Thank you!
Cheers,
Robert
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx
_______________________________________________ Dev mailing list -- dev@xxxxxxx To unsubscribe send an email to dev-leave@xxxxxxx