]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 22:16:17 +0000 (15:16 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

12 years agodoc: Added radosgw temp remove.
John Wilkins [Wed, 10 Oct 2012 22:15:32 +0000 (15:15 -0700)]
doc: Added radosgw temp remove.

fixes: #3278

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Minor clean-up.
John Wilkins [Wed, 10 Oct 2012 22:14:05 +0000 (15:14 -0700)]
doc: Minor clean-up.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: minor clean-up.
John Wilkins [Wed, 10 Oct 2012 22:13:41 +0000 (15:13 -0700)]
doc: minor clean-up.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agorgw: fix compilation
Noah Watkins [Wed, 10 Oct 2012 21:59:16 +0000 (14:59 -0700)]
rgw: fix compilation

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 21:38:50 +0000 (14:38 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Wed, 10 Oct 2012 21:36:51 +0000 (14:36 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

12 years agoMerge branch 'wip-rbd-openstack-doc'
John Wilkins [Wed, 10 Oct 2012 21:36:13 +0000 (14:36 -0700)]
Merge branch 'wip-rbd-openstack-doc'

12 years agomon: drop command replies on paxos reset
Sage Weil [Tue, 9 Oct 2012 00:14:22 +0000 (17:14 -0700)]
mon: drop command replies on paxos reset

If paxos resets, do not send the reply for the commit we were waiting for;
let the command be reprocessed and re-proposed.

Among other things, this could lead to nondeterministic results for
'ceph osd create <uuid>'.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Editing and cleanup.
John Wilkins [Wed, 10 Oct 2012 20:22:47 +0000 (13:22 -0700)]
doc: Editing and cleanup.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agorbd cli tests: copy.sh was looking for old version of rbd ls -l output
Dan Mick [Wed, 10 Oct 2012 00:13:03 +0000 (17:13 -0700)]
rbd cli tests: copy.sh was looking for old version of rbd ls -l output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoclean up of rbd functionality script
tamil [Tue, 9 Oct 2012 23:42:57 +0000 (16:42 -0700)]
clean up of rbd functionality script

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agocleaned up the perl module
tamil [Tue, 9 Oct 2012 23:40:55 +0000 (16:40 -0700)]
cleaned up the perl module

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agocleaned up the script
tamil [Tue, 9 Oct 2012 22:50:29 +0000 (15:50 -0700)]
cleaned up the script

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agoradosgw-admin: don't try to parse date if wasn't specified
Yehuda Sadeh [Tue, 9 Oct 2012 21:56:28 +0000 (14:56 -0700)]
radosgw-admin: don't try to parse date if wasn't specified

This fixes a regression following the merge of wip-admin-rest.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoceph-debugpack: updates
Sage Weil [Tue, 9 Oct 2012 21:10:48 +0000 (14:10 -0700)]
ceph-debugpack: updates

- avoid copying data around; tar things directly into the tgz
- 'ceph report' instead of all the little bits
- unrotated logs only
- ensure target doesn't already exist

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: separate config from I/O in openstack diagram
Josh Durgin [Tue, 9 Oct 2012 21:06:40 +0000 (14:06 -0700)]
doc: separate config from I/O in openstack diagram

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: clarify rbd openstack docs
Josh Durgin [Tue, 9 Oct 2012 20:53:37 +0000 (13:53 -0700)]
doc: clarify rbd openstack docs

* give upstart example
* restart all relevant services
* explain OpenStack terminology more

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agogitignore: Update to match packaging changes and additions, rest-bench addition.
Tommi Virtanen [Tue, 9 Oct 2012 20:23:37 +0000 (13:23 -0700)]
gitignore: Update to match packaging changes and additions, rest-bench addition.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoconfigure.ac: Typo in human-readable description.
Tommi Virtanen [Tue, 9 Oct 2012 19:47:22 +0000 (12:47 -0700)]
configure.ac: Typo in human-readable description.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agomon: Monitor: resolve keyring option to a file before loading keyring
Joao Eduardo Luis [Tue, 9 Oct 2012 20:25:54 +0000 (21:25 +0100)]
mon: Monitor: resolve keyring option to a file before loading keyring

Otherwise our keyring default location, or any other similarly formatted
location, will be taken as the actual location for the keyring and fail.

Reported-by: tziOm (at) #ceph
Fixes: 3276
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agodoc: simplify wording for rbd-openstack config
Josh Durgin [Tue, 9 Oct 2012 17:34:51 +0000 (10:34 -0700)]
doc: simplify wording for rbd-openstack config

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-gtest-libcephfs'
Sage Weil [Tue, 9 Oct 2012 16:43:42 +0000 (09:43 -0700)]
Merge remote-tracking branch 'gh/wip-gtest-libcephfs'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agodoc: Add doxygen style documentation for libcephfs
Sam Lang [Tue, 9 Oct 2012 14:09:37 +0000 (09:09 -0500)]
doc: Add doxygen style documentation for libcephfs

As well as doxygen doc, we document a few parts of
the interface that are otherwise undocumented and
don't match the standard calls.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agotest: Refactored testceph.cc into gtest framework
Sam Lang [Tue, 9 Oct 2012 14:06:16 +0000 (09:06 -0500)]
test: Refactored testceph.cc into gtest framework

Moved all the functionality tests for the libcephfs
API into the gtest framework.  Also adds tests for
directories to improve test coverage of the libcephfs
interfaces.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agotest: Allow readdir test to be repeated
Sam Lang [Tue, 9 Oct 2012 14:14:35 +0000 (09:14 -0500)]
test: Allow readdir test to be repeated

Use test dir/files that include the pid to avoid
hitting errors when running the same test twice.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agolibcephfs: Check that buffer is non-null
Sam Lang [Tue, 9 Oct 2012 14:11:37 +0000 (09:11 -0500)]
libcephfs: Check that buffer is non-null

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-client-stale'
Sage Weil [Tue, 9 Oct 2012 03:56:05 +0000 (20:56 -0700)]
Merge remote-tracking branch 'gh/wip-client-stale'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomds: Fix removexattr ENODATA error
Sam Lang [Mon, 8 Oct 2012 17:04:57 +0000 (12:04 -0500)]
mds: Fix removexattr ENODATA error

If a client sets an xattr and then attempts to remove in a short
time window, the xattr may not have been committed to the journal
and will only be set on the projected xattrs of the inode.  This
results in a removexattr returning ENODATA at present.  The fix
here checks the xattr name in the projected xattrs, and only
returns ENODATA in the case where the name doesn't exist in that
map either.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoosdmap: fix null deref in dump
Sage Weil [Tue, 9 Oct 2012 03:50:12 +0000 (20:50 -0700)]
osdmap: fix null deref in dump

CID 731938 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (15): Passing null pointer "f" to function "ceph::Formatter::dump_int(char const *, int64_t)", which dereferences it. (The dereference happens because this is a virtual function call.)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmap: fix osdmap dump null check
Sage Weil [Tue, 9 Oct 2012 03:49:41 +0000 (20:49 -0700)]
osdmap: fix osdmap dump null check

CID 731939 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "out" to function "std::operator << <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const *)", which dereferences it.

Broken by 13b841c74605d67a172d787079bcef007d1a8fa5.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: note fall-thru to please coverity
Sage Weil [Tue, 9 Oct 2012 03:48:30 +0000 (20:48 -0700)]
mds: note fall-thru to please coverity

CID 731940 (#1 of 1): Missing break in switch (MISSING_BREAK)
This case (value 23) is not terminated by a 'break' statement.
1719    case CEPH_MSG_CLIENT_RECONNECT:
1720      ALLOW_MESSAGES_FROM(CEPH_ENTITY_TYPE_CLIENT);
The above case falls through to this one.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_cfuse_cache_invalidate: check for errors
Sage Weil [Tue, 9 Oct 2012 03:47:16 +0000 (20:47 -0700)]
test_cfuse_cache_invalidate: check for errors

CID 731941 (#1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
At (6): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Elector: fix leak on monmap from peer
Sage Weil [Tue, 9 Oct 2012 03:44:54 +0000 (20:44 -0700)]
mon/Elector: fix leak on monmap from peer

CID 731942 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (12): Variable "peermap" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agotest_cfuse_cache_invalidate: zero buffer
Sage Weil [Tue, 9 Oct 2012 03:44:10 +0000 (20:44 -0700)]
test_cfuse_cache_invalidate: zero buffer

CID 731943 (#1 of 1): Uninitialized scalar variable (UNINIT)
At (5): Using uninitialized element of array "buf" when calling "pwrite(int, void const *, size_t, __off64_t)".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoFileJournal: ignore osd journal size for block devices
Josh Durgin [Tue, 9 Oct 2012 00:59:36 +0000 (17:59 -0700)]
FileJournal: ignore osd journal size for block devices

Using part of a block device doesn't make much sense. This makes the
common case, where you partition a disk to act as several journals,
easier to configure.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agorgw: switch perm to uint32_t
Yehuda Sadeh [Mon, 8 Oct 2012 23:34:12 +0000 (16:34 -0700)]
rgw: switch perm to uint32_t

Should fix a warning.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: flexible attr fields
Yehuda Sadeh [Mon, 8 Oct 2012 23:13:04 +0000 (16:13 -0700)]
rgw: flexible attr fields

Fixes: #3114
Instead of having a few hard coded attrs that are
special cased, make it more generic. This allows supporting
more header fields, such as cache-control, expires, etc.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: get bucket logging stub
Yehuda Sadeh [Wed, 26 Sep 2012 23:41:17 +0000 (16:41 -0700)]
rgw: get bucket logging stub

Trivial implementation that just returns that
bucket logging is not enabled.

Fixes: #3225
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: check_disk_state also updates other object metadata
Yehuda Sadeh [Fri, 28 Sep 2012 18:11:04 +0000 (11:11 -0700)]
rgw: check_disk_state also updates other object metadata

When we do a check_disk_state() on an object that is not complete,
we need to also update etag, content_type, owner, and display_name.
Otherwise, we'd end up missing that from the bucket index. In
practice this only affects swift, as only there we're actually
looking at that info (when listing a container).

Fixes: #3234
Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-rgw-coverity2'
Yehuda Sadeh [Mon, 8 Oct 2012 22:23:08 +0000 (15:23 -0700)]
Merge branch 'wip-rgw-coverity2'

12 years agorgw: set null termination explicitly
Yehuda Sadeh [Thu, 27 Sep 2012 23:02:21 +0000 (16:02 -0700)]
rgw: set null termination explicitly

Make sure that string is null terminated.
Fixes coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agocls_rgw: return returned ret code
Yehuda Sadeh [Thu, 27 Sep 2012 22:33:28 +0000 (15:33 -0700)]
cls_rgw: return returned ret code

Wasn't setting the ret code. A coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add missing parantheses
Yehuda Sadeh [Thu, 27 Sep 2012 22:30:16 +0000 (15:30 -0700)]
rgw: add missing parantheses

.. around logic operations at process_intent_log().
Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: check NULL before dereference
Yehuda Sadeh [Thu, 27 Sep 2012 22:27:00 +0000 (15:27 -0700)]
rgw: check NULL before dereference

Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw-admin: pass object by reference
Yehuda Sadeh [Thu, 27 Sep 2012 22:24:45 +0000 (15:24 -0700)]
rgw-admin: pass object by reference

Large object should be passed by reference (coverity fix).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix leaks in certain error paths
Yehuda Sadeh [Thu, 27 Sep 2012 22:13:46 +0000 (15:13 -0700)]
rgw: fix leaks in certain error paths

Fixes a few coverity issues

Conflicts:
src/rgw/rgw_rados.cc

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: fix (im)possible leak
Yehuda Sadeh [Thu, 27 Sep 2012 22:00:09 +0000 (15:00 -0700)]
rgw: fix (im)possible leak

Fixes coverity issue

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: catch possible exception
Yehuda Sadeh [Thu, 27 Sep 2012 21:58:12 +0000 (14:58 -0700)]
rgw: catch possible exception

Fix coverity issue 717168.

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

Fixes more coverity issues

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

Fixes a few coverity issues.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
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 agoRevert "admin/build-doc: Use installed Sphinx and its dependencies, when possible."
Dan Mick [Mon, 8 Oct 2012 20:35:38 +0000 (13:35 -0700)]
Revert "admin/build-doc: Use installed Sphinx and its dependencies, when possible."

This reverts commit c65ffe9f7f27bc0fe5afab36e9ef0de42bc3c74c.

oneiric, where the doc gitbuilder runs, doesn't have the
--system-site-packages option; let's get docs back and sort this out
offline.  (virtualenv 1.6.4-0ubuntu1 on oneiric, 1.7.1.2-1 on precise)

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 agomds: Reset session stale timer at end of open
Sam Lang [Fri, 5 Oct 2012 16:32:33 +0000 (11:32 -0500)]
mds: Reset session stale timer at end of open

The mds gets an open session request and immediately sets the session
stale timer.  If logging the session and sending the reply takes longer
than the timer, the client sees a stale session message before getting
the open session reply.  This fix resets the session stale timer on
completion of the mds logging operation to reduce the likelihood of
the session getting marked stale before the client can receive the
open session reply and start sending renewcaps messages.

We reset the session timer for renewcaps and force_open_sessions right
before returning the SESSION_OPEN reply to the client.  This avoids stale
sessions in the cases where the mds is highly loaded and the session_open
reply back to the client is delayed.

Signed-off-by: Sam Lang <sam.lang@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 agoclient: Fix assert when stale arrives before open
Sam Lang [Fri, 5 Oct 2012 16:10:05 +0000 (11:10 -0500)]
client: Fix assert when stale arrives before open

The client sends an open session request to the mds, which may not
get a chance to reply before the mds timer times out the session and
sends the client a stale message.  This fix avoids the assertion by
checking that a pending open session request is in progress.

Signed-off-by: Sam Lang <sam.lang@inktank.com>