]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/versions.rst
update ceph source to reef 18.2.1
[ceph.git] / ceph / doc / dev / versions.rst
CommitLineData
7c673cae
FG
1==================
2Public OSD Version
3==================
4
5We maintain two versions on disk: an eversion_t pg_log.head and a
6version_t info.user_version. Each object is tagged with both the pg
7version and user_version it was last modified with. The PG version is
8modified by manipulating OpContext::at_version and then persisting it
9to the pg log as transactions, and is incremented in all the places it
10used to be. The user_version is modified by manipulating the new
11OpContext::user_at_version and is also persisted via the pg log
12transactions.
13user_at_version is modified only in PrimaryLogPG::prepare_transaction
14when the op was a "user modify" (a non-watch write), and the durable
15user_version is updated according to the following rules:
161) set user_at_version to the maximum of ctx->new_obs.oi.user_version+1
17and info.last_user_version+1.
182) set user_at_version to the maximum of itself and
19ctx->at_version.version.
203) ctx->new_obs.oi.user_version = ctx->user_at_version (to change the
21object's user_version)
22
23This set of update semantics mean that for traditional pools the
24user_version will be equal to the past reassert_version, while for
25caching pools the object and PG user-version will be able to cross
26pools without making a total mess of things.
27In order to support old clients, we keep the old reassert_version but
28rename it to "bad_replay_version"; we fill it in as before: for writes
29it is set to the at_version (and is the proper replay version); for
30watches it is set to our user version; for ENOENT replies it is set to
31the replay version's epoch but the user_version's version. We also now
32fill in the version_t portion of the bad_replay_version on read ops as
33well as write ops, which should be fine for all old clients.
34
35For new clients, we prevent them from reading bad_replay_version and
36add two proper members: user_version and replay_version; user_version
37is filled in on every operation (reads included) while replay_version
38is filled in for writes.
39
40The objclass function get_current_version() now always returns the
41pg->info.last_user_version, which means it is guaranteed to contain
42the version of the last user update in the PG (including on reads!).