Commit Graph

27986 Commits

Author SHA1 Message Date
Sage Weil
dfabc61c2c mon/MonCap: match param for entity (not name)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
2013-07-25 17:58:47 -07:00
Sage Weil
ca8ac9502b mon: translate caps=[k1,v1,k2,v2] into [caps_k1=v1, caps_k2=v2]
The command matching needs key/value pairs.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
2013-07-25 17:58:35 -07:00
Sage Weil
05b6c7e864 mon/Paxos: share uncommitted value when leader is/was behind
If the leader has and older lc than we do, and we are sharing states to
bring them up to date, we still want to also share our uncommitted value.
This particular case was broken by b26b7f6e, which was only contemplating
the case where the leader was ahead of us or at the same point as us, but
not the case where the leader was behind.  Note that the call to
share_state() a few lines up will bring them fully up to date, so
after they receive and store_state() for this message they will be at the
same lc as we are.

Fixes: #5750
Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-07-25 17:01:20 -07:00
Greg Farnum
063c71f0ff rgw: expose the version of synced items to the poster
To support this, we add an optional out argument to
RGWMetadatManager::put() and fill in the read_version. When the
function returns, that contains whatever the current on-disk version
of the object is (either what already existed or what we just wrote).

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-07-25 16:03:59 -07:00
Greg Farnum
81b62b5c71 rgw: return the update status on sync requests
Add new STATUS_APPLIED, then specify the RGWX_UPDATE_STATUS header
based on that return code when doing metadata puts.
Add a send_response() function to RGWOp_Metadata_Put in order to
support sending back our new headers. Move the translation from
STATUS_NO_APPLY from set_req_state_err() to this function, so we
can turn different sync results into failures if necessary elsewhere.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-07-25 16:03:54 -07:00
Greg Farnum
8ffc4ca914 rgw: add sync state parsing code and REST interface
Specify the param "sync-type" as one of "always", "update-by-version",
"update-by-timestamp". It defaults to always.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-07-25 16:00:17 -07:00
Greg Farnum
18eabd3322 rgw: pass the sync mode into the RGWMetadataManager::put() calls.
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-07-25 16:00:17 -07:00
Greg Farnum
4f9855e470 rgw: add preliminary support for sync update policies on metadata sync
We want to be able to conditionally apply new updates:
1) if we already have a newer version than the sync is applying for some
reason (replay of logs?), we don't want to go back in time.
2) If both zones were active at the same time, then we'd like to be
able to do a merge based on timestamps.

In order to support this, we add a sync_type flag to the implementations of
RGWMetadataHandler::put, and then check the version or the mtime of the
incoming put to what we have on disk, and refuse the update if needed.
We return the 204 NoContent success code when refusing sync; for the
moment the conversion is automatic but we're going to pull it out in
the next couple commits.

This commit does not complete the feature: we don't provide an interface
for specifying a different sync protocol.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-07-25 15:59:24 -07:00
Sage Weil
176aa39466 remove old push_to_kclient.pl
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-25 15:24:52 -07:00
Alfredo Deza
ebb9aceb79 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>
2013-07-25 14:30:00 -07:00
David Zafman
b46fb62df3 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>
2013-07-25 14:01:54 -07:00
Dan Mick
27a0b86615 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>
2013-07-25 11:40:33 -07:00
Sage Weil
c5419785c8 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>
2013-07-25 11:33:18 -07:00
Sage Weil
096af5ed09 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>
2013-07-25 11:31:08 -07:00
Samuel Just
f653aa570e 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>
2013-07-25 11:10:45 -07:00
Samuel Just
870c474c53 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>
2013-07-25 10:33:40 -07:00
Samuel Just
0dc3efdd88 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>
2013-07-25 10:32:59 -07:00
Samuel Just
37a4c4af54 test/filestore/store_test: add test for 5723
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-07-25 10:32:59 -07:00
Danny Al-Gaaf
cb3ee1e421 rgw/rgw_metadata.h: init prefix in initialization list
For performance reasons: init 'prefix' with META_LOG_OBJ_PREFIX
in the initialization list of RGWMetadataLog instead of assigning
the value in the constructor body.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:12:44 +02:00
Danny Al-Gaaf
6bc0d0411c test_rgw_admin_log.cc: remove unused variable 'creds'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:07:58 +02:00
Danny Al-Gaaf
dda1014a1d test_rgw_admin_log.cc: use static_cast<>() instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:06:53 +02:00
Danny Al-Gaaf
8f45a73a34 test_rgw_admin_opstate.cc: remove unused variable 'creds'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:04:34 +02:00
Danny Al-Gaaf
e4dfe8ab20 test_rgw_admin_meta.cc: remove unused variable 'creds'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:03:06 +02:00
Danny Al-Gaaf
9d4c42f603 test_rgw_admin_opstate.cc: use static_cast<>() instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 19:01:52 +02:00
Danny Al-Gaaf
4c778e26fd test_rgw_admin_meta.cc: use static_cast<>() instead of C-Style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-07-25 18:58:37 +02:00
Sage Weil
a164f575c1 v0.67-rc2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJR8GEaAAoJEH6/3V0X7TFtQWcP/2Y1Z+EIZf3a3olq+I60drXD
 lKla+SVNp9tr/i3AZD50HZCfLM/1H94CYdCrF5ZYoidue6KHXGazf/EEoRvwgRUv
 CsVnhHSAI+/4KyCUkYPrbgM7W2PxxdP5yCgZ13qMZAcPvPcqnZRD6pmi9efW11Gz
 C/a4lXDI9yXdcLBcKKcxCC3BCj14bea45Ic+4hMxgEnCBCp/2IDBLTr5RmcCsjIF
 8HtXF/v/8Vf5r4Vutxl93hYWuYSoWNh8vYbM0/zum+Z/5tULJXA/dozc2RtdYsC3
 N+8cND7rw9AmdO2WLaWQIJtshImp44+lkKnzSSBqwD6qhJBC+YBoNUGUPEGkPqG1
 LKn0LinKmbB2XM6uAQt6ccVjeR3bA3RF4T/G6OLjuJwICRRysBLtc0EeSp6NMKFq
 6+3YejwN8FTPhSbQ+K5Pl1VxMy3FT3As4x0bpXGK6qTGN00wmwGtvMFhjjxJpKQh
 3ZKeJiLLEEu5VN+Ro1NfLmCHmsxM8yTcExRBN17eG75v3Yt6bavjpwGIhZ52AeTu
 eTkah0FrVTsakkafuETSFYFw1M+pvoaAnAWnx1KFSg5JUx18nCDhfpEX1S6Ufgzt
 8Hf7xMMDI2gKtxRNYv2vqKPx409yBMG+0yA4StOiKeo7mQSTI/bnKa1FEk3PD4WR
 axO71RlwK8c+G9FnysNj
 =ZhZF
 -----END PGP SIGNATURE-----

Merge tag 'v0.67-rc2' into next

v0.67-rc2
2013-07-25 09:49:32 -07:00
Dan Mick
41930b5e8f ceph.spec.in, debian/control: python-ceph depends on python-flask
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-07-24 16:31:46 -07:00
Gary Lowell
0018b45f3c v0.67-rc2 2013-07-24 16:18:56 -07:00
Dan Mick
fe2019cc97 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>
2013-07-24 16:09:13 -07:00
Sage Weil
fd1fd664d6 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>
2013-07-24 14:46:24 -07:00
Dan Mick
0b8cad1805 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>
2013-07-24 14:38:15 -07:00
Sage Weil
d7df620b57 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>
2013-07-24 13:56:17 -07:00
Dan Mick
26d0f04b75 Merge branch 'wip-cephtool-cleanup' into next
Reviewed-by: Sage Weil <sage@inktank.com>
2013-07-24 13:53:11 -07:00
Dan Mick
085f129a6f ceph.in: remove dead code
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-07-24 11:56:21 -07:00
Dan Mick
1579c344fe rest/test.py: osd lspools should be a 'GET'
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-07-24 11:56:20 -07:00
Dan Mick
e83942086c MonCommands.h: osd pool delete "rw" perms, osd pool set no longer exp
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-07-24 11:56:20 -07:00
Dan Mick
92855064b8 ceph.in/ceph_argparse.py: move find_cmd_target() to ceph_argparse.py
Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-07-24 11:56:03 -07:00
Sage Weil
c2131d4047 mon/OSDMonitor: search for latest full osdmap if record version is missing
In 97462a3213 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>
2013-07-24 11:55:42 -07:00
Danny Al-Gaaf
a0559880bd 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>
2013-07-24 18:48:14 +02:00
Danny Al-Gaaf
ebff1ebd10 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>
2013-07-24 18:43:00 +02:00
Danny Al-Gaaf
6e6ef01591 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>
2013-07-24 18:30:16 +02:00
Danny Al-Gaaf
27e38e4068 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>
2013-07-24 18:22:00 +02:00
Joao Eduardo Luis
a7a7d3fc8a 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>
2013-07-24 08:59:25 -07:00
Joao Eduardo Luis
76cd7ac1c2 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>
2013-07-24 08:58:26 -07:00
Gary Lowell
1cdb3ecffc 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>
2013-07-23 22:43:59 -07:00
Sage Weil
8e4a78f169 global/signal_handler: use poll(2) instead of select(2)
Starting with commit 61a298c39c 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>
2013-07-23 21:27:50 -07:00
Sage Weil
4183b74b00 mon/MonmapMonitor: make 'mon remove ...' idempotent
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-23 17:14:02 -07:00
Sage Weil
2338a329f5 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>
2013-07-23 16:39:02 -07:00
Sage Weil
3207542055 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>
2013-07-23 16:38:51 -07:00
Sage Weil
612a9b35c0 mon: add quorum_names to quorum_status command output
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-23 14:42:55 -07:00