Commit Graph

31237 Commits

Author SHA1 Message Date
Haomai Wang
cfdfb98ad3 Make ObjectStore unit tests shared with KeyValueStore
Via gtest's value-parameterized feature, let the successors of
ObjectStore share the same unit tests.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2014-01-29 21:50:29 +08:00
Haomai Wang
972d4b24c4 Add KeyValueStore implementation
KeyValueStore is another ObjectStore implementation with FileStore. It
uses KV store wrapper(StripObjectMap) which inherited GenericObjectMap
to implement ObjectStore APIs.

Each object has a header key in KV backend, which encapsulated the metadata
of object such as size, the status of keys. A complete object data maybe spread
around multi keys. The CRUD operation of object need to access the header key
of object to know the details, then the actual data keys will be get.

Now the actual KV backend of KeyValueStore is only LevelDB, more KV backend
(RocksDB, NVM API) will be introduced in the near future.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2014-01-29 21:50:15 +08:00
Wido den Hollander
03da035f76 docs: Typo in CloudStack user creation 2014-01-29 12:16:05 +01:00
Wido den Hollander
f0f4b8df81 docs: Improve CloudStack documentation.
Add a section about creating a CephX user for CloudStack.
2014-01-29 11:08:08 +01:00
Haomai Wang
8fb366f089 Add a new KV wrapper GenericObjectMap
Now we already have DBObjectMap which implement ObjectMap and other
interfaces, and ObjectMap.h implied that ObjectMap is used to encapsulates
the FileStore key value store. There exists limitation in current DBObjectMap
implementation, such as lacking of "coll_t" in "key", complicated prefix
hard-coded and inflexible extending.

So in order to provide a more flexible API and clear implementation to wrap KV
store, I copy the origin DBObjectMap and redesign the partial implementation.
Adding "coll_t" argument to all API and export "prefix" to callers. Prefixes
are divided into two parts "INTERN" and "USER". "INTERN" keys used by self to
manage and "USER" keys are managed by callers. Besides above, misc fixes are
imported such as more clear member function name and extendible header
structure.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2014-01-29 17:46:00 +08:00
Sage Weil
b31c0f03cf civetweb: fix warning
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 21:08:03 -08:00
Sage Weil
1e85bc99c9 cls_user: init cls_user_list_buckets_op fields
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 20:08:18 -08:00
Sage Weil
fd260c990b cls_user: init cls_user_stats fields in ctor
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 20:07:00 -08:00
Sage Weil
d0f13f5414 OSDMap: fix deepish_copy_from
Start with a shallow copy!

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 18:46:37 -08:00
Josh Durgin
d7b0c7faaf ceph-disk: run the right executables from udev
When run by the udev rules, PATH is not defined. Thus,
ceph-disk-activate relies on its which() function to locate the
correct executable.  The which() function used os.defpath if none was
set, and this worked for anything using it.

ad6b4b4b08 added a new default value to
PATH, so only /usr/bin was checked by callers that did not use
which(). This resulted in the mount command not being found when
ceph-disk-activate was run by udev, and thus osds failing to start
after being prepared by ceph-deploy.

Make ceph-disk consistently use the existing helpers (command() and
command_check_call()) that use which(), so lack of PATH does not
matter. Simplify _check_output() to use command(),
another wrapper around subprocess.Popen.

Fixes: #7258
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-28 17:27:21 -08:00
Gregory Farnum
152c2c4182 Merge pull request #1155 from ceph/wip-7190
OSD: don't assume we have the pool in handle_pg_create
Reviewed-by: Greg Farnum <greg@inktank.com>
2014-01-28 13:14:59 -08:00
Josh Durgin
ccfe243db5 Merge pull request #1154 from ceph/wip-7169-2
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-28 13:13:59 -08:00
Samuel Just
318e208ab6 OSD: don't assume we have the pool in handle_pg_create
The pool may have been removed since the creation message
was sent.  Previously, role would end up as -1 and this
path would be avoided.

Fixes: 7190
Introduced in 268ae82ac3
Signed-off-by: Samuel Just <sam.just@inktank.com>
2014-01-28 13:05:49 -08:00
Sage Weil
2a737d841e leveldb: add leveldb_* options
The osd_leveldb_* and mon_leveldb_* are now deprecated.  If they are
still used, they override these values.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 12:18:15 -08:00
Yehuda Sadeh
11cf9bbb29 rgw: fix multipart min part size
As part of the fix for wip-7169 it turned out that we removed
min_part_size. Looking back, the original implementation was broken
anyway and didn't do anything. This fixes it and makes it configurable.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-28 12:16:59 -08:00
Sage Weil
12ba8a3ac0 Add a virtual interface init, open, create_and_open to KeyValueDB
This will provide an opportunity to set leveldb_* settings in the next
patch.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-28 12:14:42 -08:00
Yehuda Sadeh
2e7bd83f99 rgw: fix multipart upload listing
Fixes: #7169

A separate fix has been created for dumpling.

Previously we read the entire list of parts, disregarding the actual
marker and the requested max parts. This fix refactors the way we read
the list of parts (doing it in parts, using marker).

Create new upload-id format that is used to identify uploads with sorted
omap entries. Make sure we're backward compatible and handle correctly
mixed-versions rgw uploads.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-28 11:59:11 -08:00
Joao Eduardo Luis
f1b5309356 osd: OSDMonitor: ignore pgtemps from removed pool
There's a window in-between receiving an MOSDPGTemp message from an OSD
and actually handling it that may lead to the pool the pg temps refer to
no longer existing. This may happen if the MOSDPGTemp message is queued
pending dispatching due to an on-going proposal (maybe even the pool
removal).

This patch fixes such behavior in two steps:

1. Check if the pool exists in the osdmap upon preprocessing
 - if pool does not exist in the osdmap, then the pool must have been
   removed prior to handling the message, but after the osd sent it.
 - safe to ignore the pg update
2. If all pg updates in the message have been ignored, ignore the whole
   message.  Otherwise, let prepare handle the rest.

3. Recheck if pool exists in the osdmap upon prepare
 - We may have ignored this pg back in preprocess, but other pgs in the
   message may have led the message to be passed on to prepare; ignore
   pg update once more.
4. Check if pool is pending removal and ignore pg update if so.

We delegate checking the pending value to prepare_pgtemp() because in this
case we should only ignore the update IFF the pending value is in fact
committed.  Otherwise we should retry the message.  prepare_pgtemp() is
the appropriate place to do so.

Fixes: 7116

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit f513f66f48)
2014-01-28 11:19:58 -08:00
Sage Weil
da2da48b86 Merge pull request #1153 from ceph/wip-7116-joao
osd: OSDMonitor: ignore pgtemps from removed pool

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-28 11:18:48 -08:00
Sage Weil
ff5abfbdae buffer: make 0-length splice() a no-op
This was causing a problem in the Striper, but fixing it here will avoid
corner cases all over the tree.  Note that we have to bail out before
the end-of-buffer check to avoid hitting that check when the bufferlist is
also empty.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2014-01-28 10:26:12 -08:00
Yehuda Sadeh
86c3c5a5c9 test/Makefile.am: update test_cls_rgw* rules
Need to link with libcls_user_client.a

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-28 10:25:44 -08:00
Yehuda Sadeh
26ace1ef7d test_rgw_admin_opstate: get it compiled
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-28 10:25:43 -08:00
Gregory Farnum
3447825bde Merge pull request #1137 from ceph/wip-7060
fix #7060 mon scrub problem due to osdmap copying

Reviewed-by: Greg Farnum <greg@inktank.com>
2014-01-28 10:10:41 -08:00
Sage Weil
28c7388d32 osdc/Striper: test zero-length add_partial_result
If we add a partial result that is 0-length, we used to hit an assert in
buffer::list::splice().  Add a unit test to verify the fix.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
2014-01-28 10:09:17 -08:00
Joao Eduardo Luis
f513f66f48 osd: OSDMonitor: ignore pgtemps from removed pool
There's a window in-between receiving an MOSDPGTemp message from an OSD
and actually handling it that may lead to the pool the pg temps refer to
no longer existing. This may happen if the MOSDPGTemp message is queued
pending dispatching due to an on-going proposal (maybe even the pool
removal).

This patch fixes such behavior in two steps:

1. Check if the pool exists in the osdmap upon preprocessing
 - if pool does not exist in the osdmap, then the pool must have been
   removed prior to handling the message, but after the osd sent it.
 - safe to ignore the pg update
2. If all pg updates in the message have been ignored, ignore the whole
   message.  Otherwise, let prepare handle the rest.

3. Recheck if pool exists in the osdmap upon prepare
 - We may have ignored this pg back in preprocess, but other pgs in the
   message may have led the message to be passed on to prepare; ignore
   pg update once more.
4. Check if pool is pending removal and ignore pg update if so.

We delegate checking the pending value to prepare_pgtemp() because in this
case we should only ignore the update IFF the pending value is in fact
committed.  Otherwise we should retry the message.  prepare_pgtemp() is
the appropriate place to do so.

Fixes: 7116

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2014-01-28 17:22:28 +00:00
Josh Durgin
b135128095 Merge pull request #1105 from ceph/wip-7168
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-27 18:14:36 -08:00
Sage Weil
3c77c4c5a1 OSDMap: use deepish_copy_from in remove_redundant_temporaries
Better not to open-code it.  We do a bit of extra work here, but it's worth
it.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-27 17:13:19 -08:00
Josh Durgin
120b3fbf90 Merge pull request #1080 from onlyjob/master
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-01-27 14:57:06 -08:00
Sage Weil
368852f6c0 OSDMap: fix damaging input osdmap from remove_down_temps
The default copy constructor copies shared_ptrs do vectors that are then
modified by apply_incremental, which means that the const osdmap argument
isn't in fact const.  Fix this by doing a deep(ish) copy.

Fixes: #7060
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-27 14:17:02 -08:00
Sage Weil
bd54b9841b OSDMap: deepish_copy_from()
Make a deep(ish) copy of another OSDMap.  Unfortunatley we can't make the
compiler-generated copy operator/constructors private until c++11.  :(

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-27 14:17:02 -08:00
Derek Yarnell
9e523984a9 packaging: apply udev hack rule to RHEL
In the RPM spec file there is a test to deploy the uuid hack udev rules
for older udev operating systems. This includes CentOS and RHEL, but the
check currently only is for CentOS, causing RHEL clients to get a bogus
osd rules file.

Adjust the conditional to apply to RHEL as well as CentOS. (The %{rhel}
macro is defined in both platforms' redhat-rpm-config package.)

Fixes http://tracker.ceph.com/issues/7245

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
(cherry picked from commit 64a0b4fa56)
2014-01-27 13:50:44 -08:00
Sage Weil
536306df91 Merge pull request #1149 from kdreyer-inktank/wip-7245-redhat-udev
packaging: apply udev hack rule to RHEL

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Derek Yarnell <derek@umiacs.umd.edu>
2014-01-27 13:49:56 -08:00
Derek Yarnell
64a0b4fa56 packaging: apply udev hack rule to RHEL
In the RPM spec file there is a test to deploy the uuid hack udev rules
for older udev operating systems. This includes CentOS and RHEL, but the
check currently only is for CentOS, causing RHEL clients to get a bogus
osd rules file.

Adjust the conditional to apply to RHEL as well as CentOS. (The %{rhel}
macro is defined in both platforms' redhat-rpm-config package.)

Fixes http://tracker.ceph.com/issues/7245

Signed-off-by: Ken Dreyer <ken.dreyer@inktank.com>
2014-01-27 12:32:51 -07:00
Yehuda Sadeh
cacdfd9165 Merge branch 'wip-user-quota-2'
Conflicts:
	src/common/config_opts.h
	src/rgw/rgw_common.h
	src/rgw/rgw_json_enc.cc
	src/rgw/rgw_quota.cc
	src/rgw/rgw_rados.cc
	src/rgw/rgw_rados.h
	src/rgw/rgw_user.cc
	src/rgw/rgw_user.h

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-27 11:29:14 -08:00
Li Wang
9265d76a25 client: Avoid uninline empty inline data
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
b99e9d3b51 mds: Handle client compatibility
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
ddbaa5c22f mds: Shutdown old mds when inline enable
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
e3c4c4cd65 mds: Add inline switch
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
81c4f54e0a client: Make inline size tunable
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
40a693918c client: Fallocate inline data path
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:25:00 +08:00
Li Wang
47e6a78207 client: Write inline data path
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
a0cb524251 client: Read inline data path
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
4a5c09909d client: Add inline data migration helper
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
165ddb9ad7 client: Push inline data to mds by send cap
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
3c05e80983 client: Receive inline data pushed from mds
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
be3db0b8f4 client: Add inline fields to Inode
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
45c2ab4580 mds: Receive updated inline data from client
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
1280d99eab mds: Push inline data to client in inodestat
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:59 +08:00
Li Wang
7af7a5e1d5 ceph: Add inline fields to InodeStat
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:58 +08:00
Li Wang
cf63f7e6ea mds: Push inline data to client in cap message
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
2014-01-27 15:24:58 +08:00