user_at_version is modified only in ReplicatedPG::prepare_transaction
when the op was a "user modify" (a non-watch write), and the durable
user_version is updated according to the following rules:
-1) increment user_at_version
+1) set user_at_version to the maximum of ctx->new_obs.oi.user_version+1
+ and info.last_user_version+1.
2) set user_at_version to the maximum of itself and
-ctx->at_version.version.
+ ctx->at_version.version.
3) ctx->new_obs.oi.user_version = ctx->user_at_version (to change the
-object's user_version)
+ object's user_version)
This set of update semantics mean that for traditional pools the
user_version will be equal to the past reassert_version, while for
is filled in for writes.
The objclass function get_current_version() now always returns the
-user_at_version, which means it is guaranteed to contain the version
-of the last user update in the PG (including on reads!).
-
+pg->info.last_user_version, which means it is guaranteed to contain
+the version of the last user update in the PG (including on reads!).
reply->set_reply_versions(eversion_t(), ctx->obs->oi.user_version);
} else if (result == -ENOENT) {
// on ENOENT, set a floor for what the next user version will be.
- reply->set_enoent_reply_versions(info.last_update, ctx->user_at_version);
+ reply->set_enoent_reply_versions(info.last_update, info.last_user_version);
}
reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);