The old encoding was mutually exclusive with putting any data payload on
the operation. That was stupid.. we can't, for example, do xattr ops then
on a src_oid.
Fix this by just including the oid in the data payload inline whenever the
bit is set in the op code. This changes the client protocol in an
incompatible way, which means users of the CLONERANGE operation need to be
upgrade/downgraded in unison.
Signed-off-by: Sage Weil <sage@newdream.net>
The success of the notify call needs to checked before waiting to
receive a notification. If we try notifying on an object that does not
exist, for example, it should fail with -ENOENT, and not hang.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
PGs that are queued for deletion won't be in the osdmap,
and may not be in the pg_map, but if they are, it's safe to
put object_context. Otherwise, the pg is being deleted and
will clean up the object contexts itself.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Watchers and their object contexts need to be cleaned up so
they aren't used after the pg is gone. This happened if the
pool was deleted and the connection to the watcher was reset.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Since we don't join it.
This fixes a leak of per-thread state.. namely, an ~8MB chunk of virtual
memory (and a handful of real pages).
Signed-off-by: Sage Weil <sage@newdream.net>
Semicolons can now be used to give multiple arguments to cephtool in one
invocation. So a command like this is now possible:
$ ./ceph osd dump --format=json \; pg dump --format=json -o -
The backslash is to prevent the shell from consuming the semicolon.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Like set_assert_version, this is an IoCtx operation that affects the next
(and only the next) operation we perform.
Factor out the current assert version check code into a helper that also
handles the src asserts.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Assert a src object has a particular version. This is analogous to the
ASSERT_VER operation, but operations on a src_oid instead of the target.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This was probably broken by the OSD prepare_transaction refactor a few
months ago. Or it never worked. Adding test to testradospp.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Currently mkdir foo ; rmdir foo fails because we can't get_subtree_map()
on a new directory that isn't linked in the committed plane. Since we are
journaling the projected subtree, it makes sense to use
get_projected_subtree_map() here.
It's easiest to keep in both the old and new directories in the rename
project map instead of looking at the next-to-most-recent parent for the
inode. The committed version is irrelevant (could conceivably be multiple
renames behind) and the current projected parent is just newdir; we need
olddir too, and we don't project for cross-mds rename anyway.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This allows clients to determine whether they have the latest
mds, mon, or osd map. This is useful for figuring out if a pool
does not exist, or if the osdmap with it simply hasn't been
received yet.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>