]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoceph-disk: use new dumpling-style osd caps if we can, or fall back to old-style ones
Alfredo Deza [Thu, 25 Jul 2013 19:42:49 +0000 (12:42 -0700)]
ceph-disk: use new dumpling-style osd caps if we can, or fall back to old-style ones

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoosd: Don't put functional code inside of an assert
David Zafman [Thu, 25 Jul 2013 20:52:16 +0000 (13:52 -0700)]
osd: Don't put functional code inside of an assert

Fix assert in OSDService::get_map()

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoceph_argparse.py: wrong variable used if valid() fails for Ceph{Osd}Name
Dan Mick [Thu, 25 Jul 2013 05:31:17 +0000 (22:31 -0700)]
ceph_argparse.py: wrong variable used if valid() fails for Ceph{Osd}Name

self.t isn't valid in the failure case; use t

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoMerge pull request #456 from dalgaaf/wip-da-CID-1
Sage Weil [Thu, 25 Jul 2013 18:33:18 +0000 (11:33 -0700)]
Merge pull request #456 from dalgaaf/wip-da-CID-1

Fix CID issues

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge pull request #465 from dalgaaf/wip-da-CID-2
Sage Weil [Thu, 25 Jul 2013 18:31:08 +0000 (11:31 -0700)]
Merge pull request #465 from dalgaaf/wip-da-CID-2

Fix some more CID issues

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoconfig_opts.h: increase xfs,btrfs wbthrottle defaults
Samuel Just [Wed, 24 Jul 2013 19:26:46 +0000 (12:26 -0700)]
config_opts.h: increase xfs,btrfs wbthrottle defaults

Also increase fd limit defaults to accomodate the larger number
of fds.

Fixes: #5692
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Mark Nelson <mark.nelson@inktank.com>
12 years agoFileStore::_collection_rename: fix global replay guard
Samuel Just [Tue, 23 Jul 2013 20:51:26 +0000 (13:51 -0700)]
FileStore::_collection_rename: fix global replay guard

If the replay is being replayed, we might have already
performed the rename, skip it.  Also, we must set the
collection replay guard only after we have done the
rename.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoHashIndex: reset attr upon split or merge completion
Samuel Just [Wed, 24 Jul 2013 01:04:40 +0000 (18:04 -0700)]
HashIndex: reset attr upon split or merge completion

A replay of an in progress merge or split might make
our counts unreliable.

Fixes: #5723
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agotest/filestore/store_test: add test for 5723
Samuel Just [Wed, 24 Jul 2013 00:34:25 +0000 (17:34 -0700)]
test/filestore/store_test: add test for 5723

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge tag 'v0.67-rc2' into next
Sage Weil [Thu, 25 Jul 2013 16:49:32 +0000 (09:49 -0700)]
Merge tag 'v0.67-rc2' into next

v0.67-rc2

12 years agoceph.spec.in, debian/control: python-ceph depends on python-flask
Dan Mick [Wed, 24 Jul 2013 01:29:59 +0000 (18:29 -0700)]
ceph.spec.in, debian/control: python-ceph depends on python-flask

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agov0.67-rc2 v0.67-rc2
Gary Lowell [Wed, 24 Jul 2013 23:18:56 +0000 (16:18 -0700)]
v0.67-rc2

12 years agorest/test.py: cope with older requests.py versions
Dan Mick [Wed, 24 Jul 2013 23:08:30 +0000 (16:08 -0700)]
rest/test.py: cope with older requests.py versions

Older requests.py didn't have r.json (or r.json()); avoid by
decoding the json myself

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph-disk: use new get_dev_path helper for list
Sage Weil [Wed, 24 Jul 2013 21:46:24 +0000 (14:46 -0700)]
ceph-disk: use new get_dev_path helper for list

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Tested-by: Olivier Bonvalet <ob.ceph@daevel.fr>
12 years agoceph_rest_api.py: allow config section fallback
Dan Mick [Wed, 24 Jul 2013 21:32:41 +0000 (14:32 -0700)]
ceph_rest_api.py: allow config section fallback

Try clientname, then 'client', then 'global

Fixes: #5743
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoglobal/signal_handler: poll on the control pipe, too
Sage Weil [Wed, 24 Jul 2013 20:56:10 +0000 (13:56 -0700)]
global/signal_handler: poll on the control pipe, too

We also need to poll the control fd/pipe so that we restart the poll loop
when new signal handlers are added.  This was broken by commit 8e4a78f1.

Fixes: #5742
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-cephtool-cleanup' into next
Dan Mick [Wed, 24 Jul 2013 20:53:11 +0000 (13:53 -0700)]
Merge branch 'wip-cephtool-cleanup' into next

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoceph.in: remove dead code
Dan Mick [Wed, 24 Jul 2013 05:11:45 +0000 (22:11 -0700)]
ceph.in: remove dead code

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agorest/test.py: osd lspools should be a 'GET'
Dan Mick [Tue, 23 Jul 2013 07:15:32 +0000 (00:15 -0700)]
rest/test.py: osd lspools should be a 'GET'

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoMonCommands.h: osd pool delete "rw" perms, osd pool set no longer exp
Dan Mick [Tue, 23 Jul 2013 07:16:40 +0000 (00:16 -0700)]
MonCommands.h: osd pool delete "rw" perms, osd pool set no longer exp

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoceph.in/ceph_argparse.py: move find_cmd_target() to ceph_argparse.py
Dan Mick [Thu, 18 Jul 2013 23:33:16 +0000 (16:33 -0700)]
ceph.in/ceph_argparse.py: move find_cmd_target() to ceph_argparse.py

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agomon/OSDMonitor: search for latest full osdmap if record version is missing
Sage Weil [Wed, 24 Jul 2013 18:55:42 +0000 (11:55 -0700)]
mon/OSDMonitor: search for latest full osdmap if record version is missing

In 97462a3213e5e15812c79afc0f54d697b6c498b1 we tried to search for a
recent full osdmap but were looking at the wrong key.  If full_0 was
present we could record that the latest full map was last_committed even
though it wasn't present.  This is fixed in 76cd7ac1c, but we need to
compensate for when get_version_latest_full() gives us a back version
number by repeating the search.

Fixes: #5737
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agorgw/rgw_metadata.h: init cur_shard in LogListCtx with 0 465/head
Danny Al-Gaaf [Wed, 24 Jul 2013 16:48:14 +0000 (18:48 +0200)]
rgw/rgw_metadata.h: init cur_shard in LogListCtx with 0

CID 1054868 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "cur_shard" is not
  initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_metadata.cc: fix possible null dereferencing
Danny Al-Gaaf [Wed, 24 Jul 2013 16:43:00 +0000 (18:43 +0200)]
rgw/rgw_metadata.cc: fix possible null dereferencing

CID 1054827 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "objv_tracker->read_version"
  to function "obj_version::operator =(obj_version const &)", which
  dereferences it.

Moved affected 2 cases into the block checking for objv_tracker

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoos/ObjectStore.cc: don't fallthrough after OP_OMAP_RMKEYRANGE
Danny Al-Gaaf [Wed, 24 Jul 2013 16:30:16 +0000 (18:30 +0200)]
os/ObjectStore.cc: don't fallthrough after OP_OMAP_RMKEYRANGE

CID 1054829 (#1 of 1): Missing break in switch (MISSING_BREAK)
  unterminated_case: This case (value 37) is not terminated by a
  'break' statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/Monitor.cc: init scrub_version with 0 in constructor
Danny Al-Gaaf [Wed, 24 Jul 2013 16:18:59 +0000 (18:18 +0200)]
mon/Monitor.cc: init scrub_version with 0 in constructor

CID 1019623 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "scrub_version" is not
  initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest: test_store_tool: global init before using LevelDBStore
Joao Eduardo Luis [Mon, 17 Jun 2013 13:43:36 +0000 (14:43 +0100)]
test: test_store_tool: global init before using LevelDBStore

Fixes a segfault

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: OSDMonitor: fix a bug introduced on 97462a32
Joao Eduardo Luis [Wed, 24 Jul 2013 11:00:28 +0000 (12:00 +0100)]
mon: OSDMonitor: fix a bug introduced on 97462a32

Fixes: #5737
Backport: cuttlefish

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoconfigure.ac: Remove -rc suffix from the configure version number.
Gary Lowell [Wed, 24 Jul 2013 05:43:59 +0000 (22:43 -0700)]
configure.ac:  Remove -rc suffix from the configure version number.

Remove the rc suffix since RPM complains about.  For rc release
builds the "rc" in the git describe string is suffcient for
everyhting but RPM.  For rc release builds (i.e. not gitbuilder)
add a flag to the spec file.

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
12 years agoglobal/signal_handler: use poll(2) instead of select(2)
Sage Weil [Wed, 24 Jul 2013 04:27:50 +0000 (21:27 -0700)]
global/signal_handler: use poll(2) instead of select(2)

Starting with commit 61a298c39c1a6684682e2b749e45a66d073182c8 we delay the
signal handler setup until after lots of other initialization has happened,
which can result in us having very large (>1024) open fds, which will
break the FD_SET macros for select(2).  Use poll(2) instead.

Fixes: #5722
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agomon/MonmapMonitor: make 'mon remove ...' idempotent
Sage Weil [Wed, 24 Jul 2013 00:14:02 +0000 (17:14 -0700)]
mon/MonmapMonitor: make 'mon remove ...' idempotent

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: signal mds sessions with Contexts instead of Conds
Sage Weil [Mon, 22 Jul 2013 22:21:11 +0000 (15:21 -0700)]
client: signal mds sessions with Contexts instead of Conds

If we try to open an mds session and the MDS responds with close (aka,
"no"), we call _closed_mds_session() which signals the Cond*'s but then
deallocates the list.  wait_on_list() then does a use-after-free trying
to remove itself.

Instead, use Context*'s, so that the waiter does not reference the list.

Fixes: #5689
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoclient: add Context*-based wait_on_list/signal_context_list helpers
Sage Weil [Mon, 22 Jul 2013 22:19:40 +0000 (15:19 -0700)]
client: add Context*-based wait_on_list/signal_context_list helpers

These are better when the list may need to be deallocated.  Context's are
single-shot and the list is not referenced by the caller.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agomon: add quorum_names to quorum_status command output
Sage Weil [Tue, 23 Jul 2013 21:42:55 +0000 (14:42 -0700)]
mon: add quorum_names to quorum_status command output

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-formatted-output' into next
Dan Mick [Tue, 23 Jul 2013 21:04:56 +0000 (14:04 -0700)]
Merge branch 'wip-formatted-output' into next

Formatted output bugfixes

12 years agomon: PGMap dump shouldn't use strings containing '+' as tags
Dan Mick [Tue, 23 Jul 2013 07:04:02 +0000 (00:04 -0700)]
mon: PGMap dump shouldn't use strings containing '+' as tags

XML has a problem with tags containing +, like the PG state names.
Use an enclosing array, and name the state and count items explicitly.

Fixes: #5721
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: "status" is missing a close_section for the overall output
Dan Mick [Tue, 23 Jul 2013 04:55:52 +0000 (21:55 -0700)]
mon: "status" is missing a close_section for the overall output

Fixes: #5720
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: "osd stat" needs a flush now that osdmap.print_summary() doesn't
Dan Mick [Tue, 23 Jul 2013 04:55:08 +0000 (21:55 -0700)]
mon: "osd stat" needs a flush now that osdmap.print_summary() doesn't

Fixes: #5719
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: "mds stat" must open/close section around dump_info
Dan Mick [Tue, 23 Jul 2013 04:54:16 +0000 (21:54 -0700)]
mon: "mds stat" must open/close section around dump_info

dump_info() got a new field outside the mdsmap section; it's ok for
the overall "report", but not for "mds stat".  Add an enclosing section
in "mds stat".  Fix test to expect new level.

Fixes: #5718
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoceph.spec.in: obsolete ceph-libs only on the affected distro
Danny Al-Gaaf [Tue, 23 Jul 2013 19:56:09 +0000 (21:56 +0200)]
ceph.spec.in: obsolete ceph-libs only on the affected distro

The ceph-libs package existed only on Redhat based distro,
there was e.g. never such a package on SUSE. Therefore: make
sure the 'Obsoletes' is only set on these affected distros.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMerge pull request #461 from dalgaaf/wip-da-fix-spec-obsoletes
Gary Lowell [Tue, 23 Jul 2013 21:00:59 +0000 (14:00 -0700)]
Merge pull request #461 from dalgaaf/wip-da-fix-spec-obsoletes

ceph.spec.in: obsolete ceph-libs only on the affected distro

Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
12 years agomon/OSDMonitor: fix base case for 7fb3804fb workaround
Sage Weil [Tue, 23 Jul 2013 20:32:12 +0000 (13:32 -0700)]
mon/OSDMonitor: fix base case for 7fb3804fb workaround

After cluster creation, we have no full map stored and first_committed ==
1.  In that case, there is no need for a full map, since we can get there
from OSDMap() and the incrementals.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao@inktank.com>
12 years agoceph.spec.in: obsolete ceph-libs only on the affected distro 461/head
Danny Al-Gaaf [Tue, 23 Jul 2013 19:56:09 +0000 (21:56 +0200)]
ceph.spec.in: obsolete ceph-libs only on the affected distro

The ceph-libs package existed only on Redhat based distro,
there was e.g. never such a package on SUSE. Therefore: make
sure the 'Obsoletes' is only set on these affected distros.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMerge remote-tracking branch 'gh/next' into next
Sage Weil [Tue, 23 Jul 2013 18:23:24 +0000 (11:23 -0700)]
Merge remote-tracking branch 'gh/next' into next

12 years agomon: OSDMonitor: work around a full version bug introduced in 7fb3804fb
Joao Eduardo Luis [Tue, 23 Jul 2013 16:25:13 +0000 (17:25 +0100)]
mon: OSDMonitor: work around a full version bug introduced in 7fb3804fb

In 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 we moved the full version
stashing logic to the encode_trim_extra() function.  However, we forgot
to update the osdmap's 'latest_full' key that should always point to
the latest osdmap full version.  This eventually degenerated in a missing
full version after a trim.  This patch works around this bug by looking
for the latest available full osdmap version in the store and updating
'latest_full' to its proper value.

Related-to: #5704
Backport: cuttlefish

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: OSDMonitor: get rid of encode_full() as we don't use it.
Joao Eduardo Luis [Tue, 23 Jul 2013 15:34:26 +0000 (16:34 +0100)]
mon: OSDMonitor: get rid of encode_full() as we don't use it.

We have delegated this to encode_trim_extra() since
7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 -- no need to keep this code
around.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agomon: OSDMonitor: update the osdmap's latest_full with the new full version
Joao Eduardo Luis [Tue, 23 Jul 2013 15:36:52 +0000 (16:36 +0100)]
mon: OSDMonitor: update the osdmap's latest_full with the new full version

We used to do this on encode_full(), but since [1] we no longer rely on
PaxosService to manage the full maps for us.  And we forgot to write down
the latest_full version to the store, leaving it in a truly outdated state.

[1] - 7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6

Fixes: #5704
Backport: cuttlefish
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoqa/workunits/suites/fsync-tester.sh: lsof at end
Sage Weil [Tue, 23 Jul 2013 15:42:15 +0000 (08:42 -0700)]
qa/workunits/suites/fsync-tester.sh: lsof at end

Trying to track down occasional EBUSY on umount at end of test.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next' of github.com:ceph/ceph into next
Gary Lowell [Tue, 23 Jul 2013 06:21:33 +0000 (23:21 -0700)]
Merge branch 'next' of github.com:ceph/ceph into next

12 years agoqa/workunits/rest/test: cluster_down/up are now idempotent
Sage Weil [Tue, 23 Jul 2013 04:04:01 +0000 (21:04 -0700)]
qa/workunits/rest/test: cluster_down/up are now idempotent

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #457 from ceph/wip-paxos
Sage Weil [Tue, 23 Jul 2013 01:28:54 +0000 (18:28 -0700)]
Merge pull request #457 from ceph/wip-paxos

paxos fixes

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoosd/ReplicatedPG: drop repop refs in ~SnapTrimmer
Sage Weil [Tue, 23 Jul 2013 00:19:31 +0000 (17:19 -0700)]
osd/ReplicatedPG: drop repop refs in ~SnapTrimmer

This fixes a leak on shutdown.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: disable fd cacher and wbthrottle during replay
Samuel Just [Mon, 22 Jul 2013 19:41:40 +0000 (12:41 -0700)]
FileStore: disable fd cacher and wbthrottle during replay

The fd cache only works correctly when there is at most 1
inode per hobject_t.  This condition is frequently violated
during replay.

Fixes: #5699
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPGLog::merge_log, unidex() only works from tail, we index() below anyway
Samuel Just [Mon, 22 Jul 2013 20:46:26 +0000 (13:46 -0700)]
PGLog::merge_log, unidex() only works from tail, we index() below anyway

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoPGLog::rewind_divergent_log: unindex only works from tail, index() instead
Samuel Just [Mon, 22 Jul 2013 20:46:10 +0000 (13:46 -0700)]
PGLog::rewind_divergent_log: unindex only works from tail, index() instead

Fixes: #5714
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agosrc/test/osd/TestPGLog.cc: check that the object remains in log.objects
Samuel Just [Mon, 22 Jul 2013 20:44:24 +0000 (13:44 -0700)]
src/test/osd/TestPGLog.cc: check that the object remains in log.objects

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agorgw: swift, in create bucket set location_constraints
Yehuda Sadeh [Mon, 22 Jul 2013 20:36:30 +0000 (13:36 -0700)]
rgw: swift, in create bucket set location_constraints

For swift we're setting the location constraint to be the
current region we're in when creating a bucket.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agorgw: translate swift request to s3 when forwarding
Yehuda Sadeh [Mon, 22 Jul 2013 20:33:33 +0000 (13:33 -0700)]
rgw: translate swift request to s3 when forwarding

When forwarding a swift request to a different region, we
need to use the effective uri, and not just send the one
we got since we use S3 authentication for the forwarded
requests. This is achieved through a new using 'effective_uri'
param on the request info (which in swift ponts to the
plain bucket/object uri without the swift/v1 prefix(.
Also, rename the old req_state::effective_uri to relative_uri
in order to prevent confusion.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-5624-b' into next
Sage Weil [Mon, 22 Jul 2013 21:47:18 +0000 (14:47 -0700)]
Merge remote-tracking branch 'gh/wip-5624-b' into next

Reviewed-by: David Zafman <david.zafman@inktank.com>
12 years agoMerge pull request #458 from ceph/wip-5693
Gregory Farnum [Mon, 22 Jul 2013 21:37:29 +0000 (14:37 -0700)]
Merge pull request #458 from ceph/wip-5693

Wip 5693
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoPendingReleaseNotes: update about new rgw copy obj response 458/head
Yehuda Sadeh [Mon, 22 Jul 2013 21:27:01 +0000 (14:27 -0700)]
PendingReleaseNotes: update about new rgw copy obj response

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: add some comments
Yehuda Sadeh [Mon, 22 Jul 2013 21:26:54 +0000 (14:26 -0700)]
rgw: add some comments

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: dump progress through swift object copy
Yehuda Sadeh [Sat, 20 Jul 2013 04:35:47 +0000 (21:35 -0700)]
rgw: dump progress through swift object copy

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: send data back when copying object
Yehuda Sadeh [Sat, 20 Jul 2013 04:11:53 +0000 (21:11 -0700)]
rgw: send data back when copying object

Currently doing it only when copying between regions. This is
needed so that the operation doesn't time out (as it can take
a long time and the web server may just hang on us since we're
not sending any data).
This is configurable and can be disabled. Currently only implemented
for S3.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agomon/Paxos: add failure injection points 457/head
Sage Weil [Sun, 21 Jul 2013 15:57:38 +0000 (08:57 -0700)]
mon/Paxos: add failure injection points

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: fix pn for uncommitted value during collect/last phase
Sage Weil [Sun, 21 Jul 2013 15:48:18 +0000 (08:48 -0700)]
mon/Paxos: fix pn for uncommitted value during collect/last phase

During the collect/last exchange, peers share any uncommitted values
with the leader.  They are supposed to also share the pn under which
that value was accepted, but were instead using the just-accepted pn
value.  This effectively meant that we *always* took the uncommitted
value; if there were multiples, which one we accepted depended on what
order the LAST messages arrived, not which pn the values were generated
under.

The specific failure sequence I observed:

 - collect
  - learned uncommitted value for 262 from myself
  - send collect with pn 901
 - got last with pn 901 (incorrect) for 200 (old) from peer
  - discard our own value, remember the other
 - finish collect phase
  - ignore old uncommitted value

Fix this by storing a pending_v and pending_pn value whenever we accept
a value.  Use this to send an appropriate pn value in the LAST reply
so that the leader can make it's decision about which uncommitted value
to accept based on accurate information.  Also use it when we learn
the uncommitted value from ourselves.

We could probably be more clever about storing less information here,
for example by omitting pending_v and clearing pending_pn at the
appropriate point, but that would be more fragile.  Similarly, we could
store a pn for *every* commit if we wanted to lay some groundwork for
having multiple uncommitted proposals in flight, but I don't want to
speculate about what is necessary or sufficient for a correct solution
there.

Fixes: #5698
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: debug ignored uncommitted values
Sage Weil [Sun, 21 Jul 2013 15:12:46 +0000 (08:12 -0700)]
mon/Paxos: debug ignored uncommitted values

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: only learn uncommitted value if it is in the future
Sage Weil [Sun, 21 Jul 2013 15:11:22 +0000 (08:11 -0700)]
mon/Paxos: only learn uncommitted value if it is in the future

If an older peer sends an uncommitted value, make sure we only take it
if it is in the future, and at least as new as any current uncommitted
value.

(Prior to the previous patch, peers could send values from long-past
rounds.  The pn values are also bogus.)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: only share uncommitted value if it is next
Sage Weil [Mon, 22 Jul 2013 21:13:23 +0000 (14:13 -0700)]
mon/Paxos: only share uncommitted value if it is next

We may have an uncommitted value from our perspective (it is our lc + 1)
when the collector has a much larger lc (because we have been out for
the last few rounds).  Only share an uncommitted value if it is in fact
the next value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon/Paxos: accepted_pn_from has no semantic meaning
Sage Weil [Sun, 21 Jul 2013 14:58:41 +0000 (07:58 -0700)]
mon/Paxos: accepted_pn_from has no semantic meaning

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph-monstore-tool: dump paxos transactions
Sage Weil [Sun, 21 Jul 2013 14:57:23 +0000 (07:57 -0700)]
ceph-monstore-tool: dump paxos transactions

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph.in: reject --admin-daemon so it can't do harm
Dan Mick [Mon, 22 Jul 2013 18:31:09 +0000 (11:31 -0700)]
ceph.in: reject --admin-daemon so it can't do harm

Fixes: #3944
Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agov0.67-rc1 v0.67-rc1
Gary Lowell [Mon, 22 Jul 2013 18:57:27 +0000 (11:57 -0700)]
v0.67-rc1

12 years agoFileJournal: fix posix_fallocate error handling
Noah Watkins [Sun, 21 Jul 2013 17:54:00 +0000 (10:54 -0700)]
FileJournal: fix posix_fallocate error handling

From the man page for posix_fallocate:

    posix_fallocate() returns zero on success, or an error
    number on failure.  Note that errno is not set.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoOSD::_make_pg: use createmap, not osdmap
Samuel Just [Mon, 22 Jul 2013 18:08:04 +0000 (11:08 -0700)]
OSD::_make_pg: use createmap, not osdmap

The osd lock is not held at this point, we must use
the createmap passed in.

Fixes: #5656
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agorgw: read attributes when reading bucket entry point
Yehuda Sadeh [Sat, 20 Jul 2013 05:54:46 +0000 (22:54 -0700)]
rgw: read attributes when reading bucket entry point

Fixes: #5691
We need to also read the attributes, as bucket might be a legacy
bucket and might have all bucket instance info in that object.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Tested-by: Faidon Liambotis <faidon@wikimedia.org>
12 years agoOSD::RemoveWQ: do not apply_transaction while blocking _try_resurrect_pg
Samuel Just [Fri, 19 Jul 2013 22:56:52 +0000 (15:56 -0700)]
OSD::RemoveWQ: do not apply_transaction while blocking _try_resurrect_pg

Some callbacks take the osd lock, so we need to avoid blocking an
osd lock holding thread while waiting on a filestore callback.
Instead, just queue the transaction, and allow _try_resurrect_pg
to cancel us while we are waiting for the transaction to go through
(CLEARING_WAITING).

Fixes: #5672
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoFileStore: use complete() instead of finish() and delete
Samuel Just [Sat, 20 Jul 2013 00:35:22 +0000 (17:35 -0700)]
FileStore: use complete() instead of finish() and delete

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoFinisher: use complete() not finish() and delete
Samuel Just [Sat, 20 Jul 2013 00:34:53 +0000 (17:34 -0700)]
Finisher: use complete() not finish() and delete

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agocommon/Cond.h: add a simpler C_SaferCond Context
Samuel Just [Fri, 19 Jul 2013 22:55:08 +0000 (15:55 -0700)]
common/Cond.h: add a simpler C_SaferCond Context

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoceph.spec.in: Obsolete ceph-libs
Gary Lowell [Wed, 3 Jul 2013 18:28:28 +0000 (11:28 -0700)]
ceph.spec.in:  Obsolete ceph-libs

Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-mon-caps' into next
Sage Weil [Mon, 22 Jul 2013 16:27:35 +0000 (09:27 -0700)]
Merge remote-tracking branch 'gh/wip-mon-caps' into next

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agotest_cls_statelog.cc: fix resource leak, delete 'rop' at end of function 456/head
Danny Al-Gaaf [Mon, 22 Jul 2013 15:19:29 +0000 (17:19 +0200)]
test_cls_statelog.cc: fix resource leak, delete 'rop' at end of function

CID 1049213 (#3 of 3): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_statelog.cc: fix resource leak, delete op at end of function
Danny Al-Gaaf [Mon, 22 Jul 2013 12:35:03 +0000 (14:35 +0200)]
test_cls_statelog.cc: fix resource leak, delete op at end of function

CID 1049214 (#13 of 13): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "op" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_statelog.cc: fix resource leak, delete rop at end of function
Danny Al-Gaaf [Mon, 22 Jul 2013 10:38:21 +0000 (12:38 +0200)]
test_cls_statelog.cc: fix resource leak, delete rop at end of function

CID 1049215 (#12 of 12): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_version.cc: fix resource leak, delete before new()
Danny Al-Gaaf [Mon, 22 Jul 2013 10:05:43 +0000 (12:05 +0200)]
test_cls_version.cc: fix resource leak, delete before new()

Fix some more cases where resource wasn't deleted/freed before
call new().

CID 1049216 (#1-9 of 9): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "op" in "op = new_op()" leaks
  the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_version.cc: fix resource leak, delete before new()
Danny Al-Gaaf [Mon, 22 Jul 2013 09:39:30 +0000 (11:39 +0200)]
test_cls_version.cc: fix resource leak, delete before new()

CID 1049217 (#1 of 1): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "op" in "op = new_op()" leaks
  the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_version.cc: fix another ressource leak
Danny Al-Gaaf [Mon, 22 Jul 2013 09:27:14 +0000 (11:27 +0200)]
test_cls_version.cc: fix another ressource leak

CID 1049219 (#17 of 17): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "op" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_version.cc: fix ressource leak
Danny Al-Gaaf [Mon, 22 Jul 2013 09:23:57 +0000 (11:23 +0200)]
test_cls_version.cc: fix ressource leak

CID 1049220 (#18 of 18): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agocls/rgw/cls_rgw.cc: init start_key_added with false
Danny Al-Gaaf [Mon, 22 Jul 2013 08:27:41 +0000 (10:27 +0200)]
cls/rgw/cls_rgw.cc: init start_key_added with false

Fix for coverity issue:

CID 1049231 (#1 of 1): Uninitialized scalar variable (UNINIT)
  uninit_use: Using uninitialized value "start_key_added".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agoMerge pull request #453 from dalgaaf/wip-da-SCA-cppcheck-7
Sage Weil [Mon, 22 Jul 2013 04:42:07 +0000 (21:42 -0700)]
Merge pull request #453 from dalgaaf/wip-da-SCA-cppcheck-7

Fix SCA and CID issues

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge pull request #451 from dalgaaf/wip-da-SCA-cppcheck-6-v2
Sage Weil [Mon, 22 Jul 2013 04:40:22 +0000 (21:40 -0700)]
Merge pull request #451 from dalgaaf/wip-da-SCA-cppcheck-6-v2

Fix some issues from SCA - v2 - against ceph:next

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agocls_replica_log_types.h: pass const std::list<> by reference 453/head
Danny Al-Gaaf [Sat, 20 Jul 2013 18:14:20 +0000 (20:14 +0200)]
cls_replica_log_types.h: pass const std::list<> by reference

Pass  const std::list<> parameter by refrence to
cls_replica_log_progress_marker().

From cppcheck:
 [src/cls/replica_log/cls_replica_log_types.h:64]: (performance)
  Function parameter 'b' should be passed by reference.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon/PGMonitor.cc: reduce scope of local 'num_slow_osds' variable
Danny Al-Gaaf [Sat, 20 Jul 2013 18:00:13 +0000 (20:00 +0200)]
mon/PGMonitor.cc: reduce scope of local 'num_slow_osds' variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_bucket.cc: use static_cast<>() instead of C-Style cast
Danny Al-Gaaf [Sat, 20 Jul 2013 17:51:10 +0000 (19:51 +0200)]
rgw/rgw_bucket.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agotest_cls_version.cc: don't free object twice, free the right one
Danny Al-Gaaf [Sat, 20 Jul 2013 17:36:32 +0000 (19:36 +0200)]
test_cls_version.cc: don't free object twice, free the right one

Object 'librados::ObjectWriteOperation *op' is freed twice in the TEST
test_version_inc_read. Free instead 'librados::ObjectReadOperation *rop'

Related cppcheck warning:
 [src/test/cls_version/test_cls_version.cc:79]: (error) Memory
  pointed to by 'op' is freed twice.

This should also fix:

CID 1049247 (#1 of 1): Use after free (USE_AFTER_FREE)
  deref_arg: Calling "librados::ObjectWriteOperation::~ObjectWriteOperation()"
  dereferences freed pointer "op". (The dereference happens because this is
  a virtual function call.)
CID 1049218 (#4 of 4): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the storage it
  points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw/rgw_metadata.cc: use static_cast<>() instead of C-Style cast
Danny Al-Gaaf [Sat, 20 Jul 2013 17:13:15 +0000 (19:13 +0200)]
rgw/rgw_metadata.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agorgw: change RGWOp::name() to return string instead of char*
Danny Al-Gaaf [Sat, 20 Jul 2013 17:00:50 +0000 (19:00 +0200)]
rgw: change RGWOp::name() to return string instead of char*

Return 'const string' instead of 'const char *' from RGWOp::name() to
avoid the usage of std::string:c_str() to return 'const char *' in
some cases in rgw_rest_replica_log.h.

Returning result of c_str() from a function is dangerous since the
result gets (may) invalid after the related string object gets
destroyed or out of scope (which is the case with return). So you
may end up with garbage in this case.

Related warning from cppcheck:
 [src/rgw/rgw_rest_replica_log.h:39]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call.
 [src/rgw/rgw_rest_replica_log.h:59]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call.
 [src/rgw/rgw_rest_replica_log.h:79]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call

This should also fix:

CID 1049250 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.
CID 1049251 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.
CID 1049252 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
12 years agomon, mds, osd: add early SIGTERM injection
Sage Weil [Sat, 20 Jul 2013 15:49:48 +0000 (08:49 -0700)]
mon, mds, osd: add early SIGTERM injection

This makes it easy to identify problems with (early) shutdown with a
loop like

 while [ ! -e core ] ; do ./ceph-mds -i a -c ceph.conf -f ; done

and a vstart cluster.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: put g_ceph_context on shutdown
Sage Weil [Sat, 20 Jul 2013 15:47:51 +0000 (08:47 -0700)]
mds: put g_ceph_context on shutdown

This makes us shut down lots of threads.

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