Commit Graph

31102 Commits

Author SHA1 Message Date
Sage Weil
e1349df450 Merge pull request #1158 from yuyuyu101/keyvaluestore-dev
Keyvaluestore Support

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-29 06:38:03 -08:00
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
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
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
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
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
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
Sage Weil
715586fed7 Merge pull request #1143 from dachary/wip-vstart-disk-usage
unittests: fail early when low on disk

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-26 12:14:29 -08:00
Loic Dachary
c1c1aa9157 Merge pull request #1003 from dachary/wip-handle-forward-unittest
mon: test for MForward messages

Reviewed-by: Joao Eduardo Luis <joao@inktank.com>
2014-01-26 05:25:36 -08:00
Loic Dachary
fffbfc942e mon: test for MForward messages
Creates two mons, send a mon command to the peon and check that the
command is forwarded to the leader.

Add a test to check that the connection features of the client are
preserved when the message reaches the leader.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-26 13:40:53 +01:00
Loic Dachary
d9a689d69a mon: shell test helpers to run MONs from sources
The intent is to make it more convenient to reproduce a specific mon
behavior and observe the result by grepping the logs. It can be handy
for bug diagnostic. The test could be included as a unit test to
be run on make check.

The setup function will prepare a directory and kill leftover from a
previous run. The teardown function cleans up on success. The run
function is expected to be provided by the calling script and can make
use of the run_mon function to mkfs + run a monitor.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-26 13:40:53 +01:00
Loic Dachary
c06eca2448 unittests: fail early when low on disk
Scripts from qa that are run as unittests via test/vstart_wrapper.sh may
fail because the partition on which it runs is low on space ( 95% full
). When it happens the cause of the problem may be unclear because it
is likely to show only as a client not being able to reach the mon.

A test is added in test/vstart_wrapper.sh to verify the disk space usage
using the same method as the mon would and fail with a detailed error if
it is the case.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-26 13:32:57 +01:00
Yehuda Sadeh
9413a5196e rgw: simplify a code path
remove some duplicate code.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:33:57 -08:00
Yehuda Sadeh
1b0567b0af radosgw-admin: add usage for user stats [--sync-stats]
add missing usage

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:25:51 -08:00
John Wilkins
97edd2fcad doc: Switched logging to true. Now required for sync agent.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2014-01-24 15:11:32 -08:00
Yehuda Sadeh
9a55fa1cac cls_user: add generate_test_instances() implementation
to all the encoded/decoded stuff

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:07:36 -08:00
Yehuda Sadeh
e5dc8d6583 rgw, cls_user: handle error cases related to response decoding
Certain operations weren't handling errors in decode, add some missing
logic.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:07:36 -08:00
Yehuda Sadeh
8a69ac89e2 rgw: implement restful set user quota request
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:07:36 -08:00
Yehuda Sadeh
92cabd411c rgw: new restful api for retrieving user quota info
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:07:36 -08:00
Yehuda Sadeh
0f7b3c722f rgw: quota thread for full user stats sync
Get user stats up to date periodically. Add configurables for different
periods, whether we update idle users.
Make sure radosgw-admin does not start the quota threads.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 15:07:35 -08:00
Yehuda Sadeh
2f9a93d385 rgw: round bytes to the next 4k for quota use
Be more consistent as we round it like this in the objclass, so we need
the accounting to match.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:53 -08:00
Yehuda Sadeh
6f34df45ed rgw: sync bucket stats thread
a new thread that periodically sync stats of recently modified buckets.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:53 -08:00
Yehuda Sadeh
7545177ab7 rgw, cls_user: fix bucket creation
There's a single op to create and update the user bucket info, however,
the cases differ a bit, as we only need to guard against ENOENT if we're
updating the info.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:53 -08:00
Yehuda Sadeh
d9920439e2 radosgw-admin: dump header when requested for user stats
header also contains sync timestamps, so we should dump it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:52 -08:00
Yehuda Sadeh
5976bfcc58 radosgw-admin: update stats sync completion
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:52 -08:00
Yehuda Sadeh
ba39512892 cls_user: op to keep track of sync completion time
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:52 -08:00
Yehuda Sadeh
a68b52afa4 cls_user: keep time info about stats update
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2014-01-24 10:28:52 -08:00