]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agorgw: convert bucket info if needed
Yehuda Sadeh [Tue, 7 Jan 2014 02:32:42 +0000 (18:32 -0800)]
rgw: convert bucket info if needed

Fixes: #7110
In dumpling, the bucket info was separated into bucket entry point and
bucket instance objects. When setting bucket attrs we only ended up
updating the bucket instance object. However, pre-dumpling buckets still
keep everything at the entry-point object, so acl changes didn't affect
anything (because we never updated the entry point). This change just
converts the bucket info into the new format.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit a5f8cc7ec9ec8bef4fbc656066b4d3a08e5b215b)

11 years agoosd: ignore OSDMap messages while we are initializing
Sage Weil [Sun, 5 Jan 2014 06:40:43 +0000 (22:40 -0800)]
osd: ignore OSDMap messages while we are initializing

The mon may occasionally send OSDMap messages to random OSDs, but is not
very descriminating in that we may not have authenticated yet.  Ignore any
messages if that is the case; we will reqeust whatever we need during the
BOOTING state.

Fixes: #7093
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit f68de9f352d53e431b1108774e4a23adb003fe3f)

11 years agomon: only send messages to current OSDs
Sage Weil [Sun, 5 Jan 2014 06:43:26 +0000 (22:43 -0800)]
mon: only send messages to current OSDs

When choosing a random OSD to send a message to, verify not only that
the OSD id is up but that the session is for the same instance of that OSD
by checking that the address matches.

Fixes: #7093
Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 98ed9ac5fed6eddf68f163086df72faabd9edcde)

11 years agoosd: discriminate based on connection messenger, not peer type
Sage Weil [Mon, 26 Aug 2013 20:58:47 +0000 (13:58 -0700)]
osd: discriminate based on connection messenger, not peer type

Replace ->get_source().is_osd() checks and instead see if it is the
cluster_messenger so that we do not confuse ourselves when we get
legit requests from other OSDs on our public interface.

NOTE: backporting this because a mixed cluster may send OSD requests
via the client interface, even though dumpling doesn't do this.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a6b04c5d8ba043727a2e39a62e9d4126485bcfeb)

Conflicts:

src/osd/OSD.cc

11 years agoqa: test for error when ceph osd rm is EBUSY
Loic Dachary [Sun, 15 Dec 2013 21:59:51 +0000 (22:59 +0100)]
qa: test for error when ceph osd rm is EBUSY

http://tracker.ceph.com/issues/6824 fixes #6824

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 31507c90f0161c4569a2cc634c0b5f671179440a)

11 years agomon: set ceph osd (down|out|in|rm) error code on failure
Loic Dachary [Sun, 15 Dec 2013 15:27:02 +0000 (16:27 +0100)]
mon: set ceph osd (down|out|in|rm) error code on failure

Instead of always returning true, the error code is set if at least one
operation fails.

EINVAL if the OSD id is invalid (osd.foobar for instance).
EBUSY if trying to remove and OSD that is up.

When used with the ceph command line, it looks like this:

    ceph -c ceph.conf osd rm osd.0
    Error EBUSY: osd.0 is still up; must be down before removal.
    kill PID_OF_osd.0
    ceph -c ceph.conf osd down osd.0
    marked down osd.0.
    ceph -c ceph.conf osd rm osd.0 osd.1
    Error EBUSY: removed osd.0, osd.1 is still up; must be down before removal.

http://tracker.ceph.com/issues/6824 fixes #6824

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 15b8616b13a327701c5d48c6cb7aeab8fcc4cafc)

11 years agomon: OSDMonitor: fix some annoying whitespace
Joao Eduardo Luis [Tue, 29 Oct 2013 20:30:37 +0000 (20:30 +0000)]
mon: OSDMonitor: fix some annoying whitespace

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 42c4137cbfacad5654f02c6608cc0e81b45c06be)

11 years agolibrbd: call user completion after incrementing perfcounters
Josh Durgin [Fri, 27 Dec 2013 01:38:52 +0000 (17:38 -0800)]
librbd: call user completion after incrementing perfcounters

The perfcounters (and the ictx) are only valid while the image is
still open.  If the librbd user gets the callback for its last I/O,
then closes the image, the ictx and its perfcounters will be
invalid. If the AioCompletion object is has not run the rest of its
complete() method yet, it will access these now-invalid addresses,
possibly leading to a crash.

The AioCompletion object is independent of the ictx and does not
access it again after incrementing perfcounters, so avoid this race by
calling the user's callback after this step. The AioCompletion object
will be cleaned up by the rest of complete_request(), independent of
the ImageCtx.

Fixes: #5426
Backport: dumpling, emperor
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 4cea7895da7331b84d8c6079851fdc0ff2f4afb1)

11 years agoobjecter: don't take extra throttle budget for resent ops
Josh Durgin [Sat, 7 Dec 2013 00:03:20 +0000 (16:03 -0800)]
objecter: don't take extra throttle budget for resent ops

These ops have already taken their budget in the original op_submit().
It will be returned via put_op_budget() when they complete.
If there were many localized reads of missing objects from replicas,
or cache pool redirects, this would cause the objecter to use up all
of its op throttle budget and hang.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 8d0180b1b7b48662daef199931efc7f2a6a1c431)

Conflicts:

src/osdc/Objecter.cc

11 years agorbd: check write return code during bench-write
Josh Durgin [Fri, 6 Dec 2013 01:44:37 +0000 (17:44 -0800)]
rbd: check write return code during bench-write

This is allows rbd-bench to detect http://tracker.ceph.com/issues/6938
when combined with rapidly changing the mon osd full ratio.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3caf3effcb113f843b54e06099099909eb335453)

11 years agoobjecter: resend all writes after osdmap loses the full flag
Josh Durgin [Fri, 6 Dec 2013 01:36:33 +0000 (17:36 -0800)]
objecter: resend all writes after osdmap loses the full flag

Now that the osd does not respond if it gets a map with the full flag
set first, clients need to resend all writes.

Clients talking to old osds are still subject to the race condition,
so both sides must be upgraded to avoid it.

Refs: #6938
Backport: dumpling, emperor
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit e32874fc5aa6f59494766b7bbeb2b6ec3d8f190e)

Conflicts:

src/osdc/Objecter.h

11 years agoosd: drop writes when full instead of returning an error
Josh Durgin [Fri, 6 Dec 2013 01:34:38 +0000 (17:34 -0800)]
osd: drop writes when full instead of returning an error

There's a race between the client and osd with a newly marked full
osdmap.  If the client gets the new map first, it blocks writes and
everything works as expected, with no errors from the osd.

If the osd gets the map first, however, it will respond to any writes
with -ENOSPC. Clients will pass this up the stack, and not retry these
writes later.  -ENOSPC isn't handled well by all clients. RBD, for
example, may pass it on to qemu or kernel rbd which will both
interpret it as EIO.  Filesystems on top of rbd will not behave well
when they receive EIOs like this, especially if the cluster oscillates
between full and not full, so some writes succeed.

To fix this, never return ENOSPC from the osd because of a map marked
full, and rely on the client to retry all writes when the map is no
longer marked full.

Old clients talking to osds with this fix will hang instead of
propagating an error, but only if they run into this race
condition. ceph-fuse and rbd with caching enabled are not affected,
since the ObjectCacher will retry writes that return errors.

Refs: #6938
Backport: dumpling, emperor
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 4111729dda7437c23f59e7100b3c4a9ec4101dd0)

11 years agoobjecter: clean pause / unpause logic
Yehuda Sadeh [Thu, 7 Nov 2013 00:55:52 +0000 (16:55 -0800)]
objecter: clean pause / unpause logic

op->paused holds now whether operation should be paused or not, and it's
being updated when scanning requests. No need to do a second scan.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 5fe3dc647bf936df8e1eb2892b53f44f68f19821)

11 years agoobjecter: set op->paused in recalc_op_target(), resend in not paused
Yehuda Sadeh [Thu, 7 Nov 2013 00:15:47 +0000 (16:15 -0800)]
objecter: set op->paused in recalc_op_target(), resend in not paused

When going through scan_requests() in handle_osd_map() we need to make
sure that if an op should not be paused anymore then set it on the op
itself, and return NEED_RESEND. Otherwise we're going to miss reset of
the full flag.
Also in handle_osd_map(), make sure that op shouldn't be paused before
sending it. There's a lot of cleanup around that area that we should
probably be doing, make the code much more tight.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 98ab7d64a191371fa39d840c5f8e91cbaaa1d7b7)

11 years agoobjecter: don't resend paused ops
Josh Durgin [Wed, 6 Nov 2013 02:46:37 +0000 (10:46 +0800)]
objecter: don't resend paused ops

Paused ops are meant to block on the client side until a new map that
unpauses them is recieved. If we send paused writes when the FULL flag
is set, we'll get -ENOSPC from the osds, which is not what Objecter
users expect. This may cause rbd without caching to produce an I/O
error instead of waiting for the cluster to have capacity.

Fixes: #6725
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c5c399d327cfc0d232d9ec7d49ababa914d0b21a)

11 years agoMerge pull request #808 from ceph/wip-6152-dumpling
Sage Weil [Mon, 30 Dec 2013 05:10:30 +0000 (21:10 -0800)]
Merge pull request #808 from ceph/wip-6152-dumpling

rgw: Fix S3 auth when using response-* query string params

11 years agov0.67.5 v0.67.5
Gary Lowell [Thu, 19 Dec 2013 20:53:10 +0000 (20:53 +0000)]
v0.67.5

11 years agorgw: fix use-after-free when releasing completion handle
Yehuda Sadeh [Wed, 18 Dec 2013 21:11:01 +0000 (13:11 -0800)]
rgw: fix use-after-free when releasing completion handle

Backport: emperor, dumpling
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c8890ab2d46fe8e12200a0d2f9eab31c461fb871)

11 years agorgw: don't return data within the librados cb
Yehuda Sadeh [Wed, 18 Dec 2013 21:10:21 +0000 (13:10 -0800)]
rgw: don't return data within the librados cb

Fixes: #7030
The callback is running within a single Finisher thread, thus we
shouldn't block there. Append read data to a list and flush it within
the iterate context.

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit d6a4f6adfaa75c3140d07d6df7be03586cc16183)

11 years agorgw: Allow wildcard in supported keystone roles.
Christophe Courtaut [Mon, 22 Jul 2013 13:15:38 +0000 (15:15 +0200)]
rgw: Allow wildcard in supported keystone roles.

http://tracker.ceph.com/issues/4365 fixes #4365

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
(cherry picked from commit 60195581273aee259e8c83d0b471af859d928342)

11 years agoValidate S3 tokens against Keystone
Roald J. van Loon [Fri, 9 Aug 2013 11:31:10 +0000 (13:31 +0200)]
Validate S3 tokens against Keystone

- Added config option to allow S3 to use Keystone auth
- Implemented JSONDecoder for KeystoneToken
- RGW_Auth_S3::authorize now uses rgw_store_user_info on keystone auth
- Minor fix in get_canon_resource; dout is now after the assignment

Reviewed-by: Yehuda Sadeh<yehuda@inktank.com>
Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
(cherry picked from commit a200e184b15a03a4ca382e94caf01efb41cb9db7)

Conflicts:
src/rgw/rgw_swift.h

11 years agorgw: init src_bucket_name, src_object in the S3 handler
Yehuda Sadeh [Tue, 22 Oct 2013 01:02:32 +0000 (18:02 -0700)]
rgw: init src_bucket_name, src_object in the S3 handler

Be consistent and initialize these fields also in the S3 case.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit ccaab2abf9e49ce3e50c15df793a3a3ca6b29bb8)

11 years agorgw: get rid of req_state.bucket_name
Yehuda Sadeh [Mon, 21 Oct 2013 21:45:59 +0000 (14:45 -0700)]
rgw: get rid of req_state.bucket_name

No need for this field, as we already have req_state.bucket_name_str.
This saves us some memory allocation / freeing through every request
processing.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit db7eb771226beaa2372ef5860ce742cb3457cd89)

Conflicts:
src/rgw/rgw_rest_s3.cc

11 years agorgw: turn swift COPY into PUT
Yehuda Sadeh [Mon, 21 Oct 2013 21:17:12 +0000 (14:17 -0700)]
rgw: turn swift COPY into PUT

Fixes: #6606
The swift COPY operation is unique in a sense that it's a write
operation that has its destination not set by the URI target, but by a
different HTTP header. This is problematic as there are some hidden
assumptions in the code that the specified bucket/object in the URI is
the operation target. E.g., certain initialization functions, quota,
etc. Instead of creating a specialized code everywhere for this case
just turn it into a regular copy operation, that is, a PUT with
a specified copy source.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit cbf8f9a51737e7d89fb0ec0832b50fd47c35b08d)

11 years agoOSDMonitor: add 'osd perf' command to dump recent osd perf information
Samuel Just [Wed, 14 Aug 2013 03:32:14 +0000 (20:32 -0700)]
OSDMonitor: add 'osd perf' command to dump recent osd perf information

Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 94c3f29a32cbf169d896015da6765febd3c724e0)

11 years agoObjectStore: add ObjectStore::get_cur_stats and impl in FileStore
Samuel Just [Wed, 14 Aug 2013 00:36:57 +0000 (17:36 -0700)]
ObjectStore: add ObjectStore::get_cur_stats and impl in FileStore

Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit ebde89d5602536b4bc651737e4280fdfb6634c32)

11 years agoosd_types: add osd_perf_stat_t type
Samuel Just [Wed, 14 Aug 2013 00:21:39 +0000 (17:21 -0700)]
osd_types: add osd_perf_stat_t type

Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 95f3353a6ab3a4dd2bf28eaca7122487942e913e)

11 years agorgw: do not use UNPRIVILEGED_DAEMON option
Sage Weil [Tue, 3 Dec 2013 19:22:56 +0000 (11:22 -0800)]
rgw: do not use UNPRIVILEGED_DAEMON option

This is sort of a backport for 4f403c26dc0048ad63e20d20369fa86bfb31c50e
in that we get the same behavior change, but only for rgw.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd/OSDMonitor: accept 'osd pool set ...' value as string
Sage Weil [Wed, 4 Dec 2013 05:51:26 +0000 (21:51 -0800)]
osd/OSDMonitor: accept 'osd pool set ...' value as string

Newer monitors take this as a CephString.  Accept that so that if we are
mid-upgrade and get a forwarded message using the alternate schema from
a future mon we will handle it properly.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoinit, upstart: prevent daemons being started by both
Josh Durgin [Mon, 25 Nov 2013 21:43:43 +0000 (13:43 -0800)]
init, upstart: prevent daemons being started by both

There can be only one init system starting a daemon. If there is a
host entry in ceph.conf for a daemon, sysvinit would try to start it
even if the daemon's directory did not include a sysvinit file. This
preserves backwards compatibility with older installs using sysvinit,
but if an upstart file is present in the daemon's directory, upstart
will try to start them, regardless of host entries in ceph.conf.

If there's an upstart file in a daemon's directory and a host entry
for that daemon in ceph.conf, both sysvinit and upstart would attempt
to manage it.

Fix this by only starting daemons if the marker file for the other
init system is not present. This maintains backwards compatibility
with older installs using neither sysvinit or upstart marker files,
and does not break any valid configurations. The only configuration
that would break is one with both sysvinit and upstart files present
for the same daemon.

Backport: emperor, dumpling
Reported-by: Tim Spriggs <tims@uahirise.org>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 5e34beb61b3f5a1ed4afd8ee2fe976de40f95ace)

11 years agoOSD: allow project_pg_history to handle a missing map
Samuel Just [Mon, 4 Nov 2013 05:02:36 +0000 (21:02 -0800)]
OSD: allow project_pg_history to handle a missing map

If we get a peering message for an old map we don't have, we
can throwit out: the sending OSD will learn about the newer
maps and update itself accordingly, and we don't have the
information to know if the message is valid. This situation
can only happen if the sender was down for a long enough time
to create a map gap and its PGs have not yet advanced from
their boot-up maps to the current ones, so we can rely on it

Fixes: #6712
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit cd0d612e1abdf5c87082eeeccd4ca09dd14fd737)

11 years agorgw: bucket meta remove don't overwrite entry point first
Yehuda Sadeh [Mon, 19 Aug 2013 23:56:27 +0000 (16:56 -0700)]
rgw: bucket meta remove don't overwrite entry point first

Fixes: #6056
When removing a bucket metadata entry we first unlink the bucket
and then we remove the bucket entrypoint object. Originally
when unlinking the bucket we first overwrote the bucket entrypoint
entry marking it as 'unlinked'. However, this is not really needed
as we're just about to remove it. The original version triggered
a bug, as we needed to propagate the new header version first (which
we didn't do, so the subsequent bucket removal failed).

Reviewed-by: Greg Farnum <greg@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 0373d749cea7d9b532069ba8ebca2f005b2c9f59)

11 years agorgw: lower some debug message
Yehuda Sadeh [Fri, 22 Nov 2013 15:04:01 +0000 (07:04 -0800)]
rgw: lower some debug message

Fixes: #6084
Backport: dumpling, emperor

Reported-by: Ron Allred <rallred@itrefined.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit b35fc1bc2ec8c8376ec173eb1c3e538e02c1694e)

11 years agoosd: fix bench block size
Josh Durgin [Mon, 18 Nov 2013 22:39:12 +0000 (14:39 -0800)]
osd: fix bench block size

The command was declared to take 'size' in dumpling, but was trying to
read 'bsize' instead, so it always used the default of 4MiB. Change
the bench command to read 'size', so it matches what existing clients
are sending.

Fixes: #6795
Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 40a76ef0d09f8ecbea13712410d9d34f25b91935)

Conflicts:
src/osd/OSD.cc

11 years agoos, osd, tools: Add backportable compatibility checking for sharded objects
David Zafman [Wed, 25 Sep 2013 16:19:16 +0000 (09:19 -0700)]
os, osd, tools: Add backportable compatibility checking for sharded objects

OSD
  New CEPH_OSD_FEATURE_INCOMPAT_SHARDS
FileStore
  NEW CEPH_FS_FEATURE_INCOMPAT_SHARDS
  Add FSSuperblock with feature CompatSet in it
  Store sharded_objects state using CompatSet
  Add set_allow_sharded_objects() and get_allow_sharded_objects() to FileStore/ObjectStore
  Add read_superblock()/write_superblock() internal filestore functions
ceph_filestore_dump
  Add OSDsuperblock to export format
  Use CompatSet from OSD code itself in filestore-dump tool
  Always check compatibility of OSD features with on-disk features
  On import verify compatibility of on-disk features with export data
  Bump super_ver due to export format change

Backport: dumpling, cuttlefish

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit c6b83180f9f769de27ca7890f5f8ec507ee743ca)

Conflicts:

src/os/FileStore.cc
src/os/FileStore.h
src/osd/OSD.cc

Excluded from cherry-pick:
  Didn't add set_allow_sharded_objects() and get_allow_sharded_objects() to FileStore/ObjectStore
  Didn't add code to check for incomplete transition to sharded objects in ceph-filestore-dump

11 years agorgw: Wrap hex_to_num table into class HexTable
Ray Lv [Tue, 29 Oct 2013 11:34:51 +0000 (19:34 +0800)]
rgw: Wrap hex_to_num table into class HexTable

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Ray Lv <xiangyulv@gmail.com>
(cherry picked from commit 588ed60a8ec1d8db5e096fd8f7b762f2afcf7dd3)

11 years agoMerge pull request #805 from ceph/wip-rgw-replica-log-dumpling
Yehuda Sadeh [Tue, 5 Nov 2013 20:27:42 +0000 (12:27 -0800)]
Merge pull request #805 from ceph/wip-rgw-replica-log-dumpling

backport a bunch of rgw stuff to dumpling

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw: don't turn 404 into 400 for the replicalog api 805/head
Josh Durgin [Fri, 1 Nov 2013 23:12:52 +0000 (16:12 -0700)]
rgw: don't turn 404 into 400 for the replicalog api

404 is not actually a problem to clients like radosgw-agent, but 400
implies something about the request was incorrect.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 306ec7142d699c26ce874b11dc02ccdb3cf296c7)

11 years agorgw: when failing read from client, return correct error
Yehuda Sadeh [Tue, 3 Sep 2013 20:27:21 +0000 (13:27 -0700)]
rgw: when failing read from client, return correct error

Fixes: #6214
When getting a failed read from client when putting an object
we returned the wrong value (always 0), which in the chunked-
upload case ended up in assuming that the write was done
successfully.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 0499948aad64c6c66668b43963403fb0cb1a2737)

11 years agorgw: Fix S3 auth when using response-* query string params 808/head
Sylvain Munaut [Thu, 29 Aug 2013 14:17:30 +0000 (16:17 +0200)]
rgw: Fix S3 auth when using response-* query string params

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
(cherry picked from commit 7a7361d7e798d94796d4985e2e4b35af22463ae2)

11 years agorgw: fix leak in RGWMetadataManager::remove()
Yehuda Sadeh [Mon, 30 Sep 2013 21:15:19 +0000 (14:15 -0700)]
rgw: fix leak in RGWMetadataManager::remove()

Backport: dumpling
Fixes: #6445
handler->get() returns a newly allocated obj, need to delete it when
done.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 8dd7ea3fadc06b5ebb330af41d686d3da155fb5d)

11 years agorgw: quiet down warning message
Yehuda Sadeh [Mon, 26 Aug 2013 18:16:08 +0000 (11:16 -0700)]
rgw: quiet down warning message

Fixes: #6123
We don't want to know about failing to read region map info
if it's not found, only if failed on some other error. In
any case it's just a warning.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 055e31359ac977943f014270cc56a1b7786abee3)

11 years agorgw: try to create log pool if doesn't exist
Yehuda Sadeh [Fri, 13 Sep 2013 21:43:54 +0000 (14:43 -0700)]
rgw: try to create log pool if doesn't exist

When using replica log, if the log pool doesn't exist all operations are
going to fail. Try to create it if doesn't exist.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 4216eac0f59af60f60d4ce909b9ace87a7b64ccc)

11 years agoformatter: dump_bool dumps unquoted strings
Yehuda Sadeh [Fri, 11 Oct 2013 23:56:46 +0000 (16:56 -0700)]
formatter: dump_bool dumps unquoted strings

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit ad409f8a6d230e9b1199226a333bb54159c2c910)

11 years agoFormatter: add dump_bool()
Yehuda Sadeh [Fri, 27 Sep 2013 20:15:35 +0000 (13:15 -0700)]
Formatter: add dump_bool()

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 28949d5d43beba7cef37cb2f83e3399d978061a6)

11 years agorgw: escape bucket and object names in StreamReadRequests
Josh Durgin [Thu, 24 Oct 2013 15:42:48 +0000 (08:42 -0700)]
rgw: escape bucket and object names in StreamReadRequests

This fixes copy operations for objects that contain unsafe characters,
like a newline, which would return a 403 otherwise, since the GET to
the source rgw would be unable to verify the signature on a partially
valid bucket name.

Fixes: #6604
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit ec45b3b88c485140781b23d2c4f582f2cc26ea43)

11 years agorgw: move url escaping to a common place
Josh Durgin [Thu, 24 Oct 2013 15:37:25 +0000 (08:37 -0700)]
rgw: move url escaping to a common place

This is useful outside of the s3 interface. Rename url_escape()
url_encode() for consistency with the exsting common url_decode()
function. This is in preparation for the next commit, which needs
to escape url-unsafe characters in another place.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit dd308cd481b368f90a64220847b91fc233d92a59)

11 years agorgw: update metadata log list to match data log list
Josh Durgin [Thu, 24 Oct 2013 15:34:24 +0000 (08:34 -0700)]
rgw: update metadata log list to match data log list

Send the last marker whether the log is truncated in the same format
as data log list, so clients don't have more needless complexity
handling the difference.  Keep bucket index logs the same, since they
contain the marker already, and are not used in exactly the same way
metadata and data logs are.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit e0e8fb1b2b4a308b2a9317e10c6fd53ad48dbfaf)

11 years agorgw: include marker and truncated flag in data log list api
Josh Durgin [Thu, 24 Oct 2013 15:26:19 +0000 (08:26 -0700)]
rgw: include marker and truncated flag in data log list api

Consumers of this api need to know their position in the log. It's
readily available when fetching the log, so return it.  Without the
marker in this call, a client could not easily or efficiently figure
out its position in the log, since it would require getting the global
last marker in the log, and then reading all the log entries.

This would be slow for large logs, and would be subject to races that
would cause potentially very expensive duplicate work.

Returning this atomically while fetching the log entries simplifies
all of this.

Fixes: #6615
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c275912509255f8bb4c854e181318b45ab0f8564)

11 years agocls_log: always return final marker from log_list
Josh Durgin [Thu, 24 Oct 2013 15:18:19 +0000 (08:18 -0700)]
cls_log: always return final marker from log_list

There's no reason to restrict returning the marker to the case where
less than the whole log is returned, since there's already a truncated
flag to tell the client what happened.

Giving the client the last marker makes it easy to consume when the
log entries do not contain their own marker. If the last marker is not
returned, the client cannot get the last marker without racing with
updates to the log.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit e74776f4176470122485a79a4c07e9c12c9fc036)

11 years agorgw: skip read_policy checks for system_users
Josh Durgin [Thu, 10 Oct 2013 22:50:39 +0000 (15:50 -0700)]
rgw: skip read_policy checks for system_users

A system user should still be able to examine suspended buckets, and
get -ENOENT instead of -EACCESS for a deleted object.

Fixes: #6616
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit ea816c1c2fd47eab647d6fab96c9ca4bfeecd5bb)

11 years agocommon/crc32c: fix #ifdef to be x86_64 specific
Sage Weil [Tue, 29 Oct 2013 15:39:27 +0000 (08:39 -0700)]
common/crc32c: fix #ifdef to be x86_64 specific

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorgw: fix rgw test to reflect usage change
Loic Dachary [Tue, 24 Sep 2013 06:05:38 +0000 (08:05 +0200)]
rgw: fix rgw test to reflect usage change

otherwise src/test/cli/radosgw-admin/help.t fails when running make
check when run after a configure --with-radosgw

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit e50343e4423e20130035c860ba47a0edea876f7c)

11 years agorbd.py: increase parent name size limit
Josh Durgin [Fri, 25 Oct 2013 00:25:16 +0000 (17:25 -0700)]
rbd.py: increase parent name size limit

64 characters isn't all that long. 4096 ought to be enough for anyone.

Fixes: #6072
Backport: dumpling, cuttlefish
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3c0042cde5a12de0f554a16b227ab437c6254ddd)

11 years agocommon/config: include --cluster in default usage message
Sage Weil [Mon, 23 Sep 2013 21:10:36 +0000 (14:10 -0700)]
common/config: include --cluster in default usage message

Clean it up a bit too.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 157754b3a0191c5ff534a84adbeed88025615898)

11 years agomds: fix infinite loop of MDCache::populate_mydir().
Yan, Zheng [Thu, 10 Oct 2013 02:35:48 +0000 (10:35 +0800)]
mds: fix infinite loop of MDCache::populate_mydir().

make MDCache::populate_mydir() only fetch bare-bone stray dirs.
After all stray dirs are populated, call MDCache::scan_stray_dir(),
it fetches incomplete stray dirs.

Fixes: #4405
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 007f06ec174d4ee5cfb578c8b3f1c96b2bb0c238)

Conflicts:

src/mds/MDCache.h

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agorgw: fix authenticated users acl group check
Yehuda Sadeh [Tue, 15 Oct 2013 17:20:48 +0000 (10:20 -0700)]
rgw: fix authenticated users acl group check

Fixes: #6553
Backport: bobtail, cuttlefish, dumpling
Authenticated users group acl bit was not working correctly. Check to
test whether user is anonymous was wrong.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit bebbd6cb7b71697b34b8f27652cabdc40c97a33b)

11 years agorgw: change default log level
Yehuda Sadeh [Tue, 15 Oct 2013 17:55:07 +0000 (10:55 -0700)]
rgw: change default log level

Fixes: #6554
Backport: cuttlefish, dumpling
Default log level was just too high, bring it down a bit.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 8d7dbf85472cfca9268d81ecf057ea078cf345b3)

11 years agorgw: swift update obj metadata also add generic attrs
Yehuda Sadeh [Fri, 4 Oct 2013 20:00:26 +0000 (13:00 -0700)]
rgw: swift update obj metadata also add generic attrs

Fixes: #6462
We were missing the generic attributes when we updated the object
metadata (operation that only exists in the swift api).

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit f2645e1c6d7383a0ace3b239f4304e353249c4bb)

11 years agomds: return -EAGAIN if standby replay falls behind
Yan, Zheng [Wed, 2 Oct 2013 03:43:12 +0000 (11:43 +0800)]
mds: return -EAGAIN if standby replay falls behind

standby replay may fall behind and get -ENOENT when reading the
journal. return -EAGAIN in this case, it makes the MDS respawn itself.

fixes: #5458

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d2cb2bf6bac83ac6db9df6cb876317d30e7493cc)
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agomon/MDSMonitor: don't reset incarnation when creating newfs
Yan, Zheng [Thu, 12 Sep 2013 01:50:51 +0000 (09:50 +0800)]
mon/MDSMonitor: don't reset incarnation when creating newfs

Fixes: #6279
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit 40613b700b87b495d67793101ae05d6ba58b2a9a)
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoosdc/ObjectCacher: finish contexts after dropping object reference
Yan, Zheng [Thu, 12 Sep 2013 02:36:39 +0000 (10:36 +0800)]
osdc/ObjectCacher: finish contexts after dropping object reference

The context to finish can be class C_Client_PutInode, which may drop
inode's last reference. So we should first drop object's reference,
then finish contexts.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit b66ac77fa7aa3ff37804918c4308a348f239af09)

11 years agoGo back to $PWD in fsstress.sh if compiling from source.
Sandon Van Ness [Tue, 8 Oct 2013 19:08:08 +0000 (12:08 -0700)]
Go back to $PWD in fsstress.sh if compiling from source.

Although fsstress was being called with a static path the directory
it was writing to was in the current directory so doing a cd to the
source directory that is made in /tmp and then removing it later
caused it to be unable to write the files in a non-existent dir.

This change gets the current path first and cd's back into it after
it is done compiling fsstress.

Issue #6479.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
11 years agoceph.spec.in: radosgw package doesn't require mod_fcgi
Gary Lowell [Tue, 27 Aug 2013 16:53:12 +0000 (09:53 -0700)]
ceph.spec.in:  radosgw package doesn't require mod_fcgi

Fixes #5702

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
11 years agoMerge branch 'dumpling' of jenkins:ceph/ceph into dumpling
Gary Lowell [Fri, 4 Oct 2013 19:51:32 +0000 (19:51 +0000)]
Merge branch 'dumpling' of jenkins:ceph/ceph into dumpling

11 years agoceph_test_rados: do not let rollback race with snap delete
Sage Weil [Fri, 4 Oct 2013 04:47:26 +0000 (21:47 -0700)]
ceph_test_rados: do not let rollback race with snap delete

Note that the OSD behaves in a weird way when you rollback to a non-
existent snap, so the test probably isn't the only party at fault here.

Fixes (test half of): #6254
Backport: dumpling, cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 55d279b98553ba4542219b126fc7159b20b18b1f)

Conflicts:

src/test/osd/RadosModel.h
src/test/osd/TestRados.cc

11 years agov0.67.4 v0.67.4
Gary Lowell [Thu, 3 Oct 2013 22:41:31 +0000 (22:41 +0000)]
v0.67.4

11 years agorgw: fix keystone token expiration test
Yehuda Sadeh [Fri, 20 Sep 2013 21:04:47 +0000 (14:04 -0700)]
rgw: fix keystone token expiration test

Fixes: #6360
The test was inverted, need expiration to be greater than
current time in order for token to be valid.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoosd/OSD.cc: Use MIN() so that we don't exceed osd_recovery_max_active
David Zafman [Wed, 11 Sep 2013 23:55:06 +0000 (16:55 -0700)]
osd/OSD.cc: Use MIN() so that we don't exceed osd_recovery_max_active

Caused by 944f3b73531af791c90f0f061280160003545c63

Fixes: #6291
Backport: dumpling

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 139a714e13aa3c7f42091270b55dde8a17b3c4b8)

Conflicts:

src/osd/OSD.cc

11 years agomon: OSDMonitor: do not write full_latest during trim
Joao Eduardo Luis [Wed, 25 Sep 2013 21:08:24 +0000 (22:08 +0100)]
mon: OSDMonitor: do not write full_latest during trim

On commit 81983bab we patched OSDMonitor::update_from_paxos() such that we
write the latest full map version to 'full_latest' each time the latest
full map was built from the incremental versions.

This change however clashed with OSDMonitor::encode_trim_extra(), which
also wrote to 'full_latest' on each trim, writing instead the version of
the *oldest* full map.  This duality of behaviors could lead the store
to an inconsistent state across the monitors (although there's no sign of
it actually imposing any issues besides rebuilding already existing full
maps on some monitors).

We now stop OSDMonitor::encode_trim_extra() from writing to 'full_latest'.
This function will still write out the oldest full map it has in the store,
but it will no longer write to full_latest, instead leaving it up to
OSDMonitor::update_from_paxos() to figure it out -- and it already does.

Fixes: #6378
Backport: dumpling

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit bd0f29a2c28cca496ec830eac932477ebf3182ba)

11 years agocrush: invalidate rmap on create (and thus decode)
Sage Weil [Tue, 1 Oct 2013 22:53:42 +0000 (15:53 -0700)]
crush: invalidate rmap on create (and thus decode)

If we have an existing CrushWrapper object and decode from a bufferlist,
reset build_rmaps so that they get rebuilt.

Remove the build_rmaps() all in decode that was useless on a redecode
(because have_rmaps == true in that case and it did nothing).

Fixes: #6442
Backport: dumpling, maybe cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 9b7a2ae329b6a511064dd3d6e549ba61f52cfd21)

11 years agoInvoke python with /usr/bin/env python instead of directly
Dan Mick [Mon, 30 Sep 2013 21:58:11 +0000 (14:58 -0700)]
Invoke python with /usr/bin/env python instead of directly

Fixes: #6311
Signed-off-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit b9000b314b9166845ff302d4a827a996775d9a14)

11 years agoqa/workunits/mon/crush_ops.sh: fix test
Sage Weil [Wed, 25 Sep 2013 17:10:21 +0000 (10:10 -0700)]
qa/workunits/mon/crush_ops.sh: fix test

Fix root.

Fixes: #6392
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c8cae87e9e08468cc86145e0fd60c05d12826239)

11 years agoRevert "ceph: parse CEPH_ARGS environment variable"
Sage Weil [Mon, 23 Sep 2013 16:04:34 +0000 (09:04 -0700)]
Revert "ceph: parse CEPH_ARGS environment variable"

This reverts commit 67a95b9880c9bc6e858150352318d68d64ed74ad.

We now put CEPH_ARGS in the actual args we parse in python, which are passed
to rados piecemeal later.  This lets you put things like --id ... in there
that need to be parsed before librados is initialized.
(cherry picked from commit 97f462be4829f0167ed3d65e6694dfc16f1f3243)

11 years agoAdd CEPH_ARGS at the end of sys.argv
Benoît Knecht [Mon, 23 Sep 2013 13:58:42 +0000 (15:58 +0200)]
Add CEPH_ARGS at the end of sys.argv

This allows, for instance, to pass a different client name to ceph by
exporting CEPH_ARGS="--id client_id".

Signed-off-by: Benoît Knecht <benoit.knecht@fsfe.org>
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 30abe3244c86cbbe1f5b005850c29c9c0eafcad4)

11 years agomon/OSDMonitor: fix 'ceph osd crush reweight ...'
Sage Weil [Tue, 24 Sep 2013 22:26:03 +0000 (15:26 -0700)]
mon/OSDMonitor: fix 'ceph osd crush reweight ...'

The adjust method returns a count of adjusted items.

Add a test.

Fixes: #6382
Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 3de32562b55c6ece3a6ed783c36f8b9f21460339)

11 years agoqa: workunits: mon: crush_ops: test 'ceph osd crush move'
Joao Eduardo Luis [Mon, 9 Sep 2013 23:20:41 +0000 (00:20 +0100)]
qa: workunits: mon: crush_ops: test 'ceph osd crush move'

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 3bc618b7b46496c5110edde0da9cae5d3e68e0e1)

11 years agoosd: change warn_interval_multiplier to uint32_t
Loic Dachary [Tue, 24 Sep 2013 17:04:23 +0000 (19:04 +0200)]
osd: change warn_interval_multiplier to uint32_t

to prevent overflow in OpTracker::check_ops_in_flight when
multiplying warn_interval_multiplier *= 2

Backport: cuttlefish, dumpling

http://tracker.ceph.com/issues/6370 fixes #6370

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 1bce1f009bffd3e28025a08775fec189907a81db)

11 years agocrushtool: do not dump core with non-unique bucket IDs
David Zafman [Mon, 9 Sep 2013 20:01:12 +0000 (13:01 -0700)]
crushtool: do not dump core with non-unique bucket IDs

Return -EEXIST on duplicate ID
BUG FIX: crush_add_bucket() mixes error returns and IDs
  Add optional argument to return generated ID

Fixes: #6246
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 8c76f3a0f9cf100ea2c941dc2b61c470aa5033d7)

11 years agoqa: workunits: cephtool: check if 'heap' commands are parseable
Joao Eduardo Luis [Fri, 20 Sep 2013 16:06:30 +0000 (17:06 +0100)]
qa: workunits: cephtool: check if 'heap' commands are parseable

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit b1eeaddd5f214c1b0883b44fc8cae07c649be7c4)

11 years agoosd: OSD: add 'heap' command to known osd commands array
Joao Eduardo Luis [Fri, 20 Sep 2013 16:50:27 +0000 (17:50 +0100)]
osd: OSD: add 'heap' command to known osd commands array

Must have been forgotten during the cli rework.

Backport: dumpling

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit 296f2d0db31e9f5a59a3a62a1e95b6c440430fa3)

11 years agomds: MDS: pass only heap profiler commands instead of the whole cmd vector
Joao Eduardo Luis [Fri, 20 Sep 2013 15:43:27 +0000 (16:43 +0100)]
mds: MDS: pass only heap profiler commands instead of the whole cmd vector

The heap profiler doesn't care, nor should it, what our command name is.
It only cares about the commands it handles.

Backport: dumpling

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit 238fe272c6bdb62d4e57fd8555c0136de99c8129)

11 years agoperfglue/heap_profiler.cc: expect args as first element on cmd vector
Joao Eduardo Luis [Fri, 20 Sep 2013 15:41:14 +0000 (16:41 +0100)]
perfglue/heap_profiler.cc: expect args as first element on cmd vector

We used to pass 'heap' as the first element of the cmd vector when
handling commands.  We haven't been doing so for a while now, so we
needed to fix this.

Not expecting 'heap' also makes sense, considering that what we need to
know when we reach this function is what command we should handle, and
we should not care what the caller calls us when handling his business.

Fixes: #6361
Backport: dumpling

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit c98b910d49bd2b46ceafdc430044a31524c29f5b)

11 years agorgw: destroy get_obj handle in copy_obj()
Yehuda Sadeh [Mon, 16 Sep 2013 21:35:25 +0000 (14:35 -0700)]
rgw: destroy get_obj handle in copy_obj()

Fixes: #6176
Backport: dumpling
We take different code paths in copy_obj, make sure we close the handle
when we exit the function. Move the call to finish_get_obj() out of
copy_obj_data() as we don't create the handle there, so that should
makes code less confusing and less prone to errors.
Also, note that RGWRados::get_obj() also calls finish_get_obj(). For
everything to work in concert we need to pass a pointer to the handle
and not the handle itself. Therefore we needed to also change the call
to copy_obj_data().

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 9e98620e4325d15c88440a890b267131613e1aa1)

11 years agomon: MonCommands: expect a CephString as 1st arg for 'osd crush move'
Joao Eduardo Luis [Mon, 9 Sep 2013 22:14:11 +0000 (23:14 +0100)]
mon: MonCommands: expect a CephString as 1st arg for 'osd crush move'

Fixes: #6230
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 7d3799fde19138f957f26ec6be10a8a0000fc1f0)

11 years agoosd: revert 'osd max xattr size' limit
Sage Weil [Mon, 23 Sep 2013 23:23:33 +0000 (16:23 -0700)]
osd: revert 'osd max xattr size' limit

Set it to 0 (unlimited) for now.

Backport: dumpling

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit abb88d70643c3a76435b7a9d5b04ff29f7502361)

11 years agomds: be more careful about decoding LogEvents
Greg Farnum [Wed, 11 Sep 2013 23:24:32 +0000 (16:24 -0700)]
mds: be more careful about decoding LogEvents

We need to wrap the full decode section or we can abort the process
if there's an issue (which we may want to just skip by).

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 73289b34b0be5b6612e38944794d59b5e789f841)

11 years agomon: OSDMonitor: multiple rebuilt full maps per transaction
Joao Eduardo Luis [Tue, 17 Sep 2013 16:58:20 +0000 (17:58 +0100)]
mon: OSDMonitor: multiple rebuilt full maps per transaction

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 0d20cae0be701c5b6151a26ee5e4fe24d89aa20a)

11 years agomon: OSDMonitor: update latest_full while rebuilding full maps
Joao Eduardo Luis [Sun, 15 Sep 2013 20:03:50 +0000 (21:03 +0100)]
mon: OSDMonitor: update latest_full while rebuilding full maps

Not doing so will make the monitor rebuild the osdmap full versions, even
though they may have been rebuilt before, every time the monitor starts.

This mostly happens when the cluster is left in an unhealthy state for
a long period of time and incremental versions build up.  Even though we
build the full maps on update_from_paxos(), not updating 'full_latest'
leads to the situation initially described.

Fixes: #6322
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 81983bab3630520d6c7ee9b7e4a747bc17b8c5c3)

11 years agomon: OSDMonitor: smaller transactions when rebuilding full versions
Joao Eduardo Luis [Sun, 15 Sep 2013 20:00:55 +0000 (21:00 +0100)]
mon: OSDMonitor: smaller transactions when rebuilding full versions

Otherwise, for considerably sized rebuilds, the monitor will not only
consume vast amounts of memory, but it will also have troubles committing
the transaction.  Anyway, it's also a good idea to adjust transactions to
the granularity we want, and to be fair we care that each rebuilt full map
gets to disk, even if subsequent full maps don't (those can be rebuilt
later).

Fixes: #6323
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit 4ac1570c5cdcd6556dc291cc6d7878fd92d343ae)

11 years agomon: OSDMonitor: check if pool is on unmanaged snaps mode on mk/rmsnap
Joao Eduardo Luis [Wed, 28 Aug 2013 14:51:01 +0000 (15:51 +0100)]
mon: OSDMonitor: check if pool is on unmanaged snaps mode on mk/rmsnap

Backport: dumpling
Fixes: #6047
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit fab79543c54c2e446d3f76520d7906645c6b0075)

11 years agolru_map: don't use list::size()
Yehuda Sadeh [Thu, 12 Sep 2013 21:32:17 +0000 (14:32 -0700)]
lru_map: don't use list::size()

replace list::size() with map::size(), which should have
a constant time complexity.

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 7c1d2ded8fa8061bf3f14932800998b963745dd1)

11 years agocommon/lru_map: rename tokens to entries
Yehuda Sadeh [Thu, 12 Sep 2013 21:30:19 +0000 (14:30 -0700)]
common/lru_map: rename tokens to entries

This code was originally used in a token cache, now
as a generic infrastructure rename token fields.

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 532e41a9985a16b35a6e49cdcba38af0ad166fa8)

11 years agorgw: use bufferlist::append() instead of bufferlist::push_back()
Yehuda Sadeh [Wed, 18 Sep 2013 17:37:21 +0000 (10:37 -0700)]
rgw: use bufferlist::append() instead of bufferlist::push_back()

push_back() expects char *, whereas append can append a single char.
Appending a NULL char to push_back is cast as a NULL pointer which is
bad.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 08fe028bad13096d482454a2f303158727c363ff)

11 years agorgw: NULL terminate buffer before parsing it
Yehuda Sadeh [Wed, 11 Sep 2013 20:46:31 +0000 (13:46 -0700)]
rgw: NULL terminate buffer before parsing it

Fixes: #6175
Backport: dumpling
We get a buffer off the remote gateway which might
not be NULL terminated. The JSON parser needs the
buffer to be NULL terminated even though we provide
a buffer length as it calls strlen().

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit e7f7483192cddca1159aba439ce62b1e78669d51)

11 years agorgw: don't call list::size() in ObjectCache
Yehuda Sadeh [Thu, 12 Sep 2013 05:30:12 +0000 (22:30 -0700)]
rgw: don't call list::size() in ObjectCache

Fixes: #6286
Use an external counter instead of calling list::size()

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 31e3a51e933429d286104fe077e98ea883437ad6)

11 years agorgw: drain pending requests before completing write
Yehuda Sadeh [Tue, 10 Sep 2013 19:18:55 +0000 (12:18 -0700)]
rgw: drain pending requests before completing write

Fixes: #6268
When doing aio write of objects (either regular or multipart parts) we
need to drain pending aio requests. Otherwise if gateway goes down then
object might end up corrupted.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 626669afaa333d73707553a85f5c874e99e9cbd8)

11 years agorgw: fix get cors, delete cors
Yehuda Sadeh [Sat, 7 Sep 2013 05:33:38 +0000 (22:33 -0700)]
rgw: fix get cors, delete cors

Remove a couple of variables that overrode class member. Not
really clear how it was working before, might have been a bad
merge / rebase.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 13872785aeeddbe1b8dd97e49fd6a2d879514f8d)

11 years agoMerge branch 'wip-6078-dumpling' into dumpling
Yehuda Sadeh [Wed, 11 Sep 2013 16:47:10 +0000 (09:47 -0700)]
Merge branch 'wip-6078-dumpling' into dumpling

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agorgw: fix certain return status cases in CORS
Yehuda Sadeh [Thu, 29 Aug 2013 04:25:20 +0000 (21:25 -0700)]
rgw: fix certain return status cases in CORS

Change return values in certain cases, reorder
checks, etc.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>