On Mon, Sep 30, 2019 at 12:03 PM Brett Niver <bniver@xxxxxxxxxx> wrote: > > so something like atomic compare/swap? > We had compare and swap, but we couldn't return the result of that operation without re-reading (which was not atomic). There are other places where write operation that returns value is useful. For example, in otp (one time password) objclass, the code check is a write operation as it needs to change the state (otherwise could just retry until success). However, if we return an error (on failure), the new state would not be stored, as rados would regard this as a failed write. So we need to return a success with extra value. To work around it we needed to create transactions that could be queried, which were inefficient. There are many other places where we needed to go through complex workarounds such as this. Yehuda > > On Mon, Sep 30, 2019 at 1:22 PM Yehuda Sadeh-Weinraub <yehuda@xxxxxxxxxx> wrote: >> >> On Sat, Sep 28, 2019 at 9:55 AM Sage Weil <sweil@xxxxxxxxxx> wrote: >> > >> > This just merged: >> > >> > https://github.com/ceph/ceph/pull/30581 >> > >> > which means that it's possible to construct cls methods that do updates >> > *and* return >0 return codes and (limited) data payload. You need to set >> > the WRITEVEC flag on the rados op for it to work, in order to avoid >> > breaking current users of requests like [stat, write] or [cmpxattr, >> > write], since those guard methods occasionally return data. >> > >> > Enjoy! >> >> Finally! >> >> Next iteration should be to look at current objclass users and >> identify places that can take advantage of this. I know that for rgw >> the otp objclass can surely benefit for it, and we may want to take a >> look at the entire versioned objects stuff. I'm sure there are many >> other places where this can be useful. >> >> Thanks, >> Yehuda >> >> > sage >> _______________________________________________ >> 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