]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agorgw: RGWObjState() initialize memebers
Yehuda Sadeh [Thu, 27 Sep 2012 21:38:21 +0000 (14:38 -0700)]
rgw: RGWObjState() initialize memebers

Initialize members at constructor. Fixes coverity issues.

Conflicts:
src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: initialize members at RGWRados()
Yehuda Sadeh [Thu, 27 Sep 2012 21:35:35 +0000 (14:35 -0700)]
rgw: initialize members at RGWRados()

fixes coverity issues

Conflicts:
src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agocls_rgw: check pointer before dereferencing
Yehuda Sadeh [Thu, 27 Sep 2012 21:29:55 +0000 (14:29 -0700)]
cls_rgw: check pointer before dereferencing

Fixes coverity issue 719577

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: multiple coverity fixes of uninitialized fields
Yehuda Sadeh [Thu, 27 Sep 2012 20:14:37 +0000 (13:14 -0700)]
rgw: multiple coverity fixes of uninitialized fields

Fields were not initialized explicitly by constractor.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: trivial fix
Yehuda Sadeh [Thu, 27 Sep 2012 20:09:36 +0000 (13:09 -0700)]
rgw: trivial fix

fix coverity issue 728052

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: change size_t to ssize_t for string.rfind() result
Yehuda Sadeh [Thu, 27 Sep 2012 20:07:14 +0000 (13:07 -0700)]
rgw: change size_t to ssize_t for string.rfind() result

fixes coverity bug 728053

string.rfind() may return negative value, switch to ssize_t instead
of size_t.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix resource leak
Yehuda Sadeh [Thu, 27 Sep 2012 19:44:33 +0000 (12:44 -0700)]
rgw: fix resource leak

coverity bug 728055

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-admin-rest'
Yehuda Sadeh [Mon, 8 Oct 2012 21:30:17 +0000 (14:30 -0700)]
Merge branch 'wip-admin-rest'

Conflicts:
doc/radosgw/index.rst
src/rgw/rgw_admin.cc
src/rgw/rgw_main.cc
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest.cc
src/rgw/rgw_rest.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_swift.h
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_swift_auth.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: virtual bucket affects resource lookup
Yehuda Sadeh [Wed, 26 Sep 2012 00:06:05 +0000 (17:06 -0700)]
rgw: virtual bucket affects resource lookup

Removed special casing of virtual bucket handling
and just prepending it to the URI. So now virtual
bucket also affects admin and swift* protocols.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: document admin, usage api
Yehuda Sadeh [Tue, 25 Sep 2012 23:38:29 +0000 (16:38 -0700)]
rgw: document admin, usage api

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix chunked object PUT for small objects
Yehuda Sadeh [Tue, 25 Sep 2012 22:48:23 +0000 (15:48 -0700)]
rgw: fix chunked object PUT for small objects

We didn't update buffer size according to read data.
Also, didn't update the total obj_size (was doing it only
for the second chunk being put, but for chunked input that
only had a single piece we ended up with zero obj_size). Also
remove assertion that second call to handle_data() means that
ofs > chunk size. This isn't true for chunked input.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: abort_early should initialize formatter if needed
Yehuda Sadeh [Tue, 25 Sep 2012 19:04:06 +0000 (12:04 -0700)]
rgw: abort_early should initialize formatter if needed

The formatter might not have been initialized, as we
abort early (e.g., when protocol handler wasn't found)
so we need to initialize it in order to dump error
status.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: configurable set of enabled apis
Yehuda Sadeh [Tue, 25 Sep 2012 18:57:04 +0000 (11:57 -0700)]
rgw: configurable set of enabled apis

We can now specify which set of apis the gateway supports. Also,
passed resource should not start with a slash, we prepend that
automatically.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add user caps
Yehuda Sadeh [Tue, 25 Sep 2012 17:55:19 +0000 (10:55 -0700)]
rgw: add user caps

User info now holds caps map, which contains a mapping between
a freestyle cap name string to permissions bitfield (read, write).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: usage trim
Yehuda Sadeh [Mon, 24 Sep 2012 21:55:39 +0000 (14:55 -0700)]
rgw: usage trim

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: usage show accepts more params
Yehuda Sadeh [Mon, 24 Sep 2012 21:34:23 +0000 (14:34 -0700)]
rgw: usage show accepts more params

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: different formatters for different services
Yehuda Sadeh [Mon, 24 Sep 2012 19:30:29 +0000 (12:30 -0700)]
rgw: different formatters for different services

Use json formatter by default for new usage stuff. Also
make it configurable.

We use the JSON formatter for the swift auth.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add a flusher to handle output data, simplify client api
Yehuda Sadeh [Sat, 22 Sep 2012 00:26:05 +0000 (17:26 -0700)]
rgw: add a flusher to handle output data, simplify client api

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoFormatter: fix XML formatter
Yehuda Sadeh [Fri, 21 Sep 2012 23:10:27 +0000 (16:10 -0700)]
Formatter: fix XML formatter

XML formatter wasn't clearing stream string buffer
when completing the section.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add rest-usage handler
Yehuda Sadeh [Fri, 21 Sep 2012 16:19:44 +0000 (09:19 -0700)]
rgw: add rest-usage handler

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: REST resources init uses configurables
Yehuda Sadeh [Fri, 21 Sep 2012 00:13:16 +0000 (17:13 -0700)]
rgw: REST resources init uses configurables

Also, move it to main().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: refactor protocol stacking
Yehuda Sadeh [Thu, 20 Sep 2012 22:32:24 +0000 (15:32 -0700)]
rgw: refactor protocol stacking

New RESTMgr* classes to handle a specific uri entry
point. Actions are handled by RGWHandler*.

Changing init order, newly instantiated RGWHandler
for every op.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: tie callbacks in different handlers directly to REST
Yehuda Sadeh [Thu, 20 Sep 2012 18:17:35 +0000 (11:17 -0700)]
rgw: tie callbacks in different handlers directly to REST

Don't translate RESTful operations into a more meaningful
callback name. The handlers themselves should do that
translation. This way we can later register different
handlers with different meanings for the operations.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: sed 's/_REST/_ObjStore/g' *
Yehuda Sadeh [Thu, 20 Sep 2012 17:09:27 +0000 (10:09 -0700)]
rgw: sed 's/_REST/_ObjStore/g' *

It's all REST, we want to add new non objstore handling,
so let's differentiate by the actual type.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: start moving usage management functions
Yehuda Sadeh [Wed, 19 Sep 2012 22:02:49 +0000 (15:02 -0700)]
rgw: start moving usage management functions

Move usage management functionality to its own place.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: hide fcgi details from client code
Yehuda Sadeh [Wed, 19 Sep 2012 19:36:44 +0000 (12:36 -0700)]
rgw: hide fcgi details from client code

client code (rgw_rest* et al) does not need to see the
fcgi library details.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agodoc: Added admonishments to use separate host for clients.
John Wilkins [Mon, 8 Oct 2012 17:48:27 +0000 (10:48 -0700)]
doc: Added admonishments to use separate host for clients.

fixes: 3264

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoMerge branch 'wip-osd-caps'
Josh Durgin [Fri, 5 Oct 2012 23:21:12 +0000 (16:21 -0700)]
Merge branch 'wip-osd-caps'

Conflicts:
src/osd/OSDCap.cc
src/test/osd/osdcap.cc

Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agoupstart: OSD journal can be a symlink; if it's dangling, don't start.
Tommi Virtanen [Fri, 5 Oct 2012 16:22:34 +0000 (09:22 -0700)]
upstart: OSD journal can be a symlink; if it's dangling, don't start.

This lets a $osd_data/journal symlink point to
/dev/disk/by-partuuid/UUID and the osd will not attempt to start until
that disk is available.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoosd: Make --get-journal-fsid not really start the osd.
Sage Weil [Fri, 5 Oct 2012 16:10:31 +0000 (09:10 -0700)]
osd: Make --get-journal-fsid not really start the osd.

This way, it won't need -i ID and it won't access the osd_data_dir.
That makes it useful for locating the right osd to use with an
external journal partition.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoosd: Make --get-journal-fsid not attempt aio or direct_io.
Tommi Virtanen [Fri, 5 Oct 2012 16:08:56 +0000 (09:08 -0700)]
osd: Make --get-journal-fsid not attempt aio or direct_io.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-prepare: Use the OSD uuid as the partition GUID.
Tommi Virtanen [Thu, 4 Oct 2012 23:03:40 +0000 (16:03 -0700)]
ceph-disk-prepare: Use the OSD uuid as the partition GUID.

This will make locating the right data partition for a given journal
partition a lot easier.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agodebian/control, ceph-disk-prepare: Depend on xfsprogs, use xfs by default.
Tommi Virtanen [Wed, 3 Oct 2012 19:38:38 +0000 (12:38 -0700)]
debian/control, ceph-disk-prepare: Depend on xfsprogs, use xfs by default.

Ext4 as a default is a bad choice, as we don't perform enough QA with
it. To use XFS as the default for ceph-disk-prepare, we need to depend
on xfsprogs.

btrfs-tools is already recommended, so no change there. If you set
osd_fs_type=btrfs, and don't have the package installed, you'll just
get an error message.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-{prepare,activate}: Default mkfs arguments and mount options.
Tommi Virtanen [Wed, 3 Oct 2012 17:13:17 +0000 (10:13 -0700)]
ceph-disk-{prepare,activate}: Default mkfs arguments and mount options.

The values for the settings were copied from teuthology task "ceph".

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-prepare: Avoid triggering activate before prepare is done.
Tommi Virtanen [Wed, 3 Oct 2012 15:47:20 +0000 (08:47 -0700)]
ceph-disk-prepare: Avoid triggering activate before prepare is done.

Earlier testing never saw this, but now a mount of a disk triggers a
udev blockdev-added event, causing ceph-disk-activate to run even
before ceph-disk-prepare has had a chance to write the files and
unmount the disk.

Avoid this by using a temporary partition type uuid ("ceph 2 be"), and
only setting it to the permanent ("ceph osd"). The hotplug event won't
match the type uuid, and thus won't trigger ceph-disk-activate.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-activate: Add a comment about user_xattr being default now.
Tommi Virtanen [Wed, 3 Oct 2012 00:06:11 +0000 (17:06 -0700)]
ceph-disk-activate: Add a comment about user_xattr being default now.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-activate: Use mount options from ceph.conf
Tommi Virtanen [Tue, 2 Oct 2012 23:53:35 +0000 (16:53 -0700)]
ceph-disk-activate: Use mount options from ceph.conf

Always uses default cluster name ("ceph") for now, see
http://tracker.newdream.net/issues/3253

Closes: #2548
Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-activate: Refactor to extract detect_fstype call.
Tommi Virtanen [Tue, 2 Oct 2012 23:43:08 +0000 (16:43 -0700)]
ceph-disk-activate: Refactor to extract detect_fstype call.

This allows us to use the fstype for a config lookup.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-activate: Unmount on errors (if it did the mount).
Tommi Virtanen [Tue, 2 Oct 2012 23:37:07 +0000 (16:37 -0700)]
ceph-disk-activate: Unmount on errors (if it did the mount).

This cleans up the error handling to not leave disks mounted
in /var/lib/ceph/tmp/mnt.* when something fails, e.g. when
the ceph command line tool can't talk to mons.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-prepare: Allow setting mkfs arguments and mount options in ceph.conf
Tommi Virtanen [Tue, 2 Oct 2012 23:23:55 +0000 (16:23 -0700)]
ceph-disk-prepare: Allow setting mkfs arguments and mount options in ceph.conf

Tested with meaningless but easy-to-verify values:

  [global]
  osd_fs_type = xfs
  osd_fs_mkfs_arguments_xfs = -i size=512
  osd_fs_mount_options_xfs = noikeep

ceph-disk-activate does not respect the mount options yet.

Closes: #2549
Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-disk-prepare: Allow specifying fs type to use.
Tommi Virtanen [Tue, 2 Oct 2012 23:04:15 +0000 (16:04 -0700)]
ceph-disk-prepare: Allow specifying fs type to use.

Either use ceph.conf variable osd_fs_type or command line option
--fs-type=

Default is still ext4, as currently nothing guarantees xfsprogs
or btrfs-tools are installed.

Currently both btrfs and xfs seems to trigger a disk hotplug event at
mount time, thus triggering a useless and unwanted ceph-disk-activate
run. This will be worked around in a later commit.

Currently mkfs and mount options cannot be configured.

Bug: #2549
Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agodoc: clarify osd journal as a block device
Josh Durgin [Fri, 5 Oct 2012 21:46:27 +0000 (14:46 -0700)]
doc: clarify osd journal as a block device

Someone on IRC was confused by this and thought it had to be a file.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: ls -l format tweaks:
Dan Mick [Fri, 5 Oct 2012 18:29:39 +0000 (11:29 -0700)]
rbd: ls -l format tweaks:

Add PROT and LOCK columns, for protection status and presence of any
locks of type "excl" or "shr" (lock list for the gory details)

Shrink FORMAT to FMT

Remove TYPE column; one can infer type from presence of @ in name (snap)
or presence of parent (clone)

Dump prettybyte_t in favor of new si_t for compactness

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: Make lock list adapt 'number' of msg (1 lock, 2 locks)
Dan Mick [Fri, 5 Oct 2012 18:12:07 +0000 (11:12 -0700)]
rbd: Make lock list adapt 'number' of msg (1 lock, 2 locks)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: set_conf_param() rewhack:
Dan Mick [Fri, 5 Oct 2012 18:17:44 +0000 (11:17 -0700)]
rbd: set_conf_param() rewhack:

1) comment set_conf_param and the loop that uses it
2) put back error checking for "called with full param list" in macro
3) make all the loop calls consistent
4) add a third arg placeholder to handle lock remove

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoAdd si_t type for large-number "just the suffix, no space"
Dan Mick [Fri, 5 Oct 2012 21:12:16 +0000 (14:12 -0700)]
Add si_t type for large-number "just the suffix, no space"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoceph-disk-activate, upstart: Use "initctl emit" to start OSDs.
Tommi Virtanen [Mon, 17 Sep 2012 15:55:14 +0000 (08:55 -0700)]
ceph-disk-activate, upstart: Use "initctl emit" to start OSDs.

This avoids an error if the daemon was running already, and is
already being done with the other services.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-create-keys: Refactor to share wait_for_quorum call.
Tommi Virtanen [Thu, 13 Sep 2012 18:34:03 +0000 (11:34 -0700)]
ceph-create-keys: Refactor to share wait_for_quorum call.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-create-keys: Create a bootstrap-osd key too.
Tommi Virtanen [Thu, 13 Sep 2012 21:06:04 +0000 (14:06 -0700)]
ceph-create-keys: Create a bootstrap-osd key too.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoRevert "rbd: gracefully handle extra arguments"
Dan Mick [Fri, 5 Oct 2012 04:13:35 +0000 (21:13 -0700)]
Revert "rbd: gracefully handle extra arguments"

Insufficient understanding of fragile algorithm.  This needs more
thought and I don't want the parsing broken as it is now.

This reverts commit 0d4887932032054d1e2d1ccc832e19c5f7ee7af6.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoOSD: separate class caps from normal read/write
Josh Durgin [Fri, 5 Oct 2012 00:42:37 +0000 (17:42 -0700)]
OSD: separate class caps from normal read/write

This properly accounts for multi-op requests. Use MOSDOp->rmw_flags for
internal caps requirements, leaving MOSDOp->flags for client specified
options. Use accessors so the flags don't need to be known by the callers.

Also separate capability checks (need_*_cap) from the nature of the MOSDOp
(may_{read,write}). This preserves the semantics of may_{read,write},
which are used in several places outside of capability checks.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: gracefully handle extra arguments
Dan Mick [Fri, 5 Oct 2012 00:52:05 +0000 (17:52 -0700)]
rbd: gracefully handle extra arguments

Instead of looping across all args, with increments inside the loop,
which can run off the end of the vector, demand that the final
argument parsing have exactly the right number of args, or complain
about the extras and die.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa: report success if race is not detected
Josh Durgin [Thu, 4 Oct 2012 23:50:42 +0000 (16:50 -0700)]
qa: report success if race is not detected

This test still verifies that the race is handled correctly if it
occurs, but will no longer clutter test results with spurious failures
when the race is not reproduced.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa scripts: Replace cut -f 1 with awk '{print $1;}'
Dan Mick [Thu, 4 Oct 2012 23:56:53 +0000 (16:56 -0700)]
qa scripts: Replace cut -f 1 with awk '{print $1;}'

This is to handle TextTable output, which doesn't use tabs

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: Use TextTable for showmapped and lock list
Dan Mick [Thu, 4 Oct 2012 22:42:51 +0000 (15:42 -0700)]
rbd: Use TextTable for showmapped and lock list

Also update ocf/rbd.in to handle new output form (spaces)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agorbd: use TextTable to implement ls -l
Dan Mick [Thu, 4 Oct 2012 21:40:03 +0000 (14:40 -0700)]
rbd: use TextTable to implement ls -l

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoAdd TextTable class for table output
Dan Mick [Thu, 4 Oct 2012 21:39:16 +0000 (14:39 -0700)]
Add TextTable class for table output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix error handling in get_parent_info
Dan Mick [Thu, 4 Oct 2012 20:53:27 +0000 (13:53 -0700)]
librbd: fix error handling in get_parent_info

Return ENOENT if no parent.
Return error if pool reverse lookup fails.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: Whitespace cleanup.
Tommi Virtanen [Thu, 4 Oct 2012 21:51:56 +0000 (14:51 -0700)]
doc: Whitespace cleanup.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agodoc: rst syntax fixes.
Tommi Virtanen [Thu, 4 Oct 2012 21:51:29 +0000 (14:51 -0700)]
doc: rst syntax fixes.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agorbd.py: Fix docstring syntax of list_lockers().
Tommi Virtanen [Thu, 4 Oct 2012 21:43:15 +0000 (14:43 -0700)]
rbd.py: Fix docstring syntax of list_lockers().

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agorbd.py: Docstring syntax.
Tommi Virtanen [Thu, 4 Oct 2012 21:42:36 +0000 (14:42 -0700)]
rbd.py: Docstring syntax.

It's meth for referring to Python class methods:
http://sphinx.pocoo.org/domains.html#python-roles

The links to format() and features() are currently
dead because those methods don't have docstrings.
They'll start working once docstrings are added.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoadmin/build-doc: Use installed Sphinx and its dependencies, when possible.
Sean Channel [Wed, 3 Oct 2012 21:02:55 +0000 (14:02 -0700)]
admin/build-doc: Use installed Sphinx and its dependencies, when possible.

This avoids the delay of installing Sphinx inside the virtualenv;
especially, compiling lxml is slow.

If Sphinx is not installed system-wide (or it's too old), this will
still install a copy inside the virtualenv, to keep working.

Thanks to Sean for the push to make this happen, and testing the
various scenarios; I (Tv) took the liberty of changing the commit to
use venv-python for the manpage build too, avoid the nonstandard
"which" command, be more careful about quoting, and explain more fully
what's going on in the comment.

Closes: https://github.com/ceph/ceph/pull/24
Signed-off-by: Sean Channel <pentabular@gmail.com>
Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Thu, 4 Oct 2012 17:08:46 +0000 (10:08 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agomon: Elector: clean ack set on election start
Joao Eduardo Luis [Thu, 4 Oct 2012 16:34:37 +0000 (17:34 +0100)]
mon: Elector: clean ack set on election start

We should never consider old 'acks' from monitors on a new election. We
usually do it, but we didn't if an election expired, because this code
didn't foresee the possibility of monitors changing ranks in-between
elections -- which doesn't happen if we specify the monmap during the
monitor's mkfs, but may happen when relying on 'mon initial peers'.

Failing to do so triggered an assertion after fixing bug #3252.

Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: Elector: bootstrap on new monmap from elector
Joao Eduardo Luis [Thu, 4 Oct 2012 16:29:22 +0000 (17:29 +0100)]
mon: Elector: bootstrap on new monmap from elector

Whenever we update the monmap we should bootstrap, in order to reset the
monitor's on-going activities and re-probe.

Not doing so contributed to bug #3252, during which we entered an infinite
election cycle. This may only happen though when we rely on 'mon initial
peers'. Specifying a monmap during the monitor's mkfs should not trigger
this bug.

Fixes: #3252
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: dump formatted crushmap on report
Joao Eduardo Luis [Thu, 4 Oct 2012 16:07:33 +0000 (17:07 +0100)]
mon: dump formatted crushmap on report

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: do not tick() until all paxos instances recover
Sage Weil [Wed, 3 Oct 2012 23:24:18 +0000 (16:24 -0700)]
mon: do not tick() until all paxos instances recover

We cannot propose until they all recover.

Fixes: #3260
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge branch 'wip-mds'
Sage Weil [Wed, 3 Oct 2012 17:43:49 +0000 (10:43 -0700)]
Merge branch 'wip-mds'

12 years agoclient: Fix #2215 with cache inval in thread
Sam Lang [Sat, 29 Sep 2012 02:26:16 +0000 (19:26 -0700)]
client: Fix #2215 with cache inval in thread

The client currently deadlocks with kernel buffer cache invalidation
enabled, due to the client lock calling the invalidate callback, which
in turn sends up calls back to the userspace process which try to lock
the same client lock.  The fix is to invoke the invalidate callback in
a separate thread, allowing _release, _flushed, etc. to complete,
unlocking the client lock so that the invalidate callback avoids deadlock
when the up call is made.

We construct a separate work queue (Finisher) that allows scheduling
the invalidate callbacks in a separate thread.  The thread only starts
when the invalidate callback is set.  If no callback is set, the cache
capability reference is decremented inline as before.

Some callers of invalidate_inode_cache (flush and update_inode_file_bits)
don't expect the cache capability to be decremented.  Pass a keep_caps flag to
only decrement the capability ref in the _release case.

Also, we need to make sure the mds is aware that the client has dropped
the cache capability, so we add a call to check_caps in put_cap_ref for the
CEPH_CAP_FILE_CACHE capability.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Remove unnecessary checkafter parameter
Sam Lang [Fri, 28 Sep 2012 18:48:40 +0000 (11:48 -0700)]
client: Remove unnecessary checkafter parameter

The logic in put_cap_ref doesn't do anything but inode->put_cap_ref
if cap is set to CEPH_CAP_FILE_CACHE, so checkafter isn't needed.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoceph-fuse: Test for fuse cache issue (#2215)
Sam Lang [Fri, 28 Sep 2012 17:13:51 +0000 (10:13 -0700)]
ceph-fuse: Test for fuse cache issue (#2215)

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: make migrate_stray() specify full path
Sage Weil [Wed, 3 Oct 2012 16:12:40 +0000 (09:12 -0700)]
mds: make migrate_stray() specify full path

The handle_client_rename() check expects a full path rooted in the MDSDIR.
Do so in migrate_stray().

Also, use the committed (not projected) dn linkage; this was a carry-over
from the original switch to this API forever ago, but the current callers
don't need to migrate an uncommitted stray.  This also aligns us with
reintegrate_stray().

Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: update release-process.rst
Sage Weil [Wed, 3 Oct 2012 15:44:52 +0000 (08:44 -0700)]
doc: update release-process.rst

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix stray reintegration check in handle_client_rename
Sage Weil [Wed, 3 Oct 2012 15:23:08 +0000 (08:23 -0700)]
mds: fix stray reintegration check in handle_client_rename

The stray reintegration generates a source path that will be rooted in a
(possibly remote) MDS's MDSDIR; adjust this check accordingly.  This is a
holdover from way back when the straydir was the base of the tree instead
of mdsdir.

Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Added description of ceph release process.
Gary Lowell [Wed, 3 Oct 2012 06:41:35 +0000 (23:41 -0700)]
doc:  Added description of ceph release process.

12 years agoMerge branch 'wip-msgr' into next
Dan Mick [Tue, 2 Oct 2012 23:06:59 +0000 (16:06 -0700)]
Merge branch 'wip-msgr' into next

12 years agoAvoid sign-extension of non-magic Message* values
Dan Mick [Tue, 2 Oct 2012 22:37:42 +0000 (15:37 -0700)]
Avoid sign-extension of non-magic Message* values

Cast to (unsigned long) when checking for magic values, so
real ptrs don't get sign-extended.  Avoids triggering
assert(inq == &local_queue) failure.

Fixes: #3251
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agorelease: note possible osd caps incompatibilities
Josh Durgin [Mon, 1 Oct 2012 20:43:25 +0000 (13:43 -0700)]
release: note possible osd caps incompatibilities

We can use this file to store release notes for the next release.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: add rbd example to ceph-authtool man page
Josh Durgin [Mon, 1 Oct 2012 20:32:08 +0000 (13:32 -0700)]
doc: add rbd example to ceph-authtool man page

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSD: deprecate CLS_METHOD_PUBLIC flag
Josh Durgin [Sat, 29 Sep 2012 00:25:32 +0000 (17:25 -0700)]
OSD: deprecate CLS_METHOD_PUBLIC flag

Remove all existing usage, but leave the definition so third-party
class plugins don't break.

The public flag let *any* user execute a class method, as long
as they had read and/or write access as the method required. This is
better managed by the new osd caps infrastructure, and it was
entirely undocumented and unused, so it should be safe to remove.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: update ceph-authtool man page for new osd caps
Josh Durgin [Sat, 29 Sep 2012 00:02:16 +0000 (17:02 -0700)]
doc: update ceph-authtool man page for new osd caps

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoobjclass: require each class method to have a flag set
Josh Durgin [Fri, 28 Sep 2012 23:28:24 +0000 (16:28 -0700)]
objclass: require each class method to have a flag set

The osd depends on this to set the client op flags for class call ops.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: add separate caps for class read and class write
Josh Durgin [Fri, 28 Sep 2012 18:03:16 +0000 (11:03 -0700)]
OSDCap: add separate caps for class read and class write

These are useful for rbd layering, since reading an rbd image
requires read-only class methods.

Fixes: #3167
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: allow runs of spaces anywhere
Josh Durgin [Tue, 2 Oct 2012 21:17:13 +0000 (14:17 -0700)]
OSDCap: allow runs of spaces anywhere

I couldn't find a way to do this with skip parsers,
so these are explicitly included in the grammar.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa: try to reproduce a race more times
Josh Durgin [Tue, 2 Oct 2012 19:33:07 +0000 (12:33 -0700)]
qa: try to reproduce a race more times

This was failing occassionally in the nightly runs.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agomds: Avoid creating unnecessary snaprealm
Yan, Zheng [Tue, 2 Oct 2012 08:55:52 +0000 (16:55 +0800)]
mds: Avoid creating unnecessary snaprealm

When moving directory between snaprealms, we can avoid creating snaprealm
if the directory doesn't has its own snaprealm and directory was created
after both realms' newest snapshot.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Properly re-calculate mdsdir inode's auth bit
Yan, Zheng [Tue, 2 Oct 2012 08:55:51 +0000 (16:55 +0800)]
mds: Properly re-calculate mdsdir inode's auth bit

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Trim non auth subtree directory
Yan, Zheng [Tue, 2 Oct 2012 08:55:50 +0000 (16:55 +0800)]
mds: Trim non auth subtree directory

Trim non auth subtree directory if all its dentries were trimmed
and it's not bound of auth subtree.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Properly update dirty dir fragstat during log replay
Yan, Zheng [Tue, 2 Oct 2012 08:55:49 +0000 (16:55 +0800)]
mds: Properly update dirty dir fragstat during log replay

Dirty dir fragstat is managed by filelock instead of nestlock.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Allow export subtrees in other MDS' stray directory
Yan, Zheng [Tue, 2 Oct 2012 08:55:48 +0000 (16:55 +0800)]
mds: Allow export subtrees in other MDS' stray directory

Stray migration is implemented by rename, it may create auth subtrees
in other MDS' stray directory.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Avoid save unnecessary parent snaprealm
Yan, Zheng [Tue, 2 Oct 2012 08:55:47 +0000 (16:55 +0800)]
mds: Avoid save unnecessary parent snaprealm

We can avoid save parent snaprealm if current_parent_since is greater
than parent snaprealm's newest sequence.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Set metablob.renamed_dirino in do_rename_rollback()
Yan, Zheng [Tue, 2 Oct 2012 08:55:46 +0000 (16:55 +0800)]
mds: Set metablob.renamed_dirino in do_rename_rollback()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Fix xlock imports
Yan, Zheng [Tue, 2 Oct 2012 08:55:45 +0000 (16:55 +0800)]
mds: Fix xlock imports

Xlock imports and capability imports are uncorrelated, we should call
xlock_import() even there is no capability import.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Allow rename request for stray migration/reintegration
Yan, Zheng [Tue, 2 Oct 2012 08:55:44 +0000 (16:55 +0800)]
mds: Allow rename request for stray migration/reintegration

Allow rename request to modify system directory if it is for stray
migration/reintegration.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Add finish callback to waiting_for_base_ino wait queue
Yan, Zheng [Tue, 2 Oct 2012 08:55:43 +0000 (16:55 +0800)]
mds: Add finish callback to waiting_for_base_ino wait queue

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Consider stopping MDS when finding peer inode
Yan, Zheng [Tue, 2 Oct 2012 08:55:42 +0000 (16:55 +0800)]
mds: Consider stopping MDS when finding peer inode

To migrate strays, the receiving MDS need find stopping MDS' mdsdir

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Don't drop client request from MDS
Yan, Zheng [Tue, 2 Oct 2012 08:55:41 +0000 (16:55 +0800)]
mds: Don't drop client request from MDS

MDS may send client request for stray migration/reintegration.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agofilejournal: check lseek() return value on darwin
Sage Weil [Tue, 2 Oct 2012 16:45:00 +0000 (09:45 -0700)]
filejournal: check lseek() return value on darwin

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmap, mon: optional dump 'osd tree' in json
Sage Weil [Tue, 2 Oct 2012 16:43:13 +0000 (09:43 -0700)]
osdmap, mon: optional dump 'osd tree' in json

Signed-off-by: Sage Weil <sage@inktank.com>