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
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