]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agopybind/rbd.py: remove unused import of 'pointer' 471/head
Danny Al-Gaaf [Sat, 27 Jul 2013 08:59:18 +0000 (10:59 +0200)]
pybind/rbd.py: remove unused import of 'pointer'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocephfs.py: remove unused imports
Danny Al-Gaaf [Sat, 27 Jul 2013 08:56:49 +0000 (10:56 +0200)]
cephfs.py: remove unused imports

Removed ctypes, c_uint64, c_ubyte, pointer, CFUNCTYPE since they
are not used in the code.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorados.py: fix bad indentation
Danny Al-Gaaf [Sat, 27 Jul 2013 09:37:26 +0000 (11:37 +0200)]
rados.py: fix bad indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_argparse.py: add missing spaces after comma
Danny Al-Gaaf [Sat, 27 Jul 2013 09:36:35 +0000 (11:36 +0200)]
ceph_argparse.py: add missing spaces after comma

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_argparse.py: remove unnecessary semicolons
Danny Al-Gaaf [Sat, 27 Jul 2013 09:35:38 +0000 (11:35 +0200)]
ceph_argparse.py: remove unnecessary semicolons

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoceph_rest_api.py: fix bad indentation
Danny Al-Gaaf [Sat, 27 Jul 2013 09:32:34 +0000 (11:32 +0200)]
ceph_rest_api.py: fix bad indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest/admin_socket: fix admin_socket unit tests
Sage Weil [Sat, 27 Jul 2013 05:28:40 +0000 (22:28 -0700)]
test/admin_socket: fix admin_socket unit tests

Command is now JSON!

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorgw: fix RGWFormatter_Plain
Sage Weil [Sat, 27 Jul 2013 05:14:47 +0000 (22:14 -0700)]
rgw: fix RGWFormatter_Plain

Needs dump_format_unqouted.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/admin_socket: do not populate empty help strings
Sage Weil [Sat, 27 Jul 2013 05:08:26 +0000 (22:08 -0700)]
common/admin_socket: do not populate empty help strings

Hidden commands have no help string.  Make this consistent: the m_help
entry is always there, but may be empty.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/perf_counters: fix unit tests
Sage Weil [Sat, 27 Jul 2013 04:42:41 +0000 (21:42 -0700)]
common/perf_counters: fix unit tests

The commands are now in json.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/perf_counters: fix missing decimal in time, quoting
Sage Weil [Sat, 27 Jul 2013 04:42:25 +0000 (21:42 -0700)]
common/perf_counters: fix missing decimal in time, quoting

We shouldn't quote integer or float values.  Also easier to use
dump_unsigned.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agocommon/Formatter: add dump_format_unquoted()
Sage Weil [Sat, 27 Jul 2013 04:41:27 +0000 (21:41 -0700)]
common/Formatter: add dump_format_unquoted()

Sometimes a savvy caller wants to format the output but doesn't want it
quoted.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agorados.py: missing parameter to make_ex()
Dan Mick [Sat, 27 Jul 2013 00:47:49 +0000 (17:47 -0700)]
rados.py: missing parameter to make_ex()

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph-rest-api: clean up options/environment
Dan Mick [Sat, 27 Jul 2013 00:47:32 +0000 (17:47 -0700)]
ceph-rest-api: clean up options/environment

ceph-rest-api:
* create app from wrapper by calling generate_app()
* pass args to generate_app() (early parsed in wrapper)
* parse -i/--id here as well
* set addr:port on returned app object
* handle only EnvironmentError exceptions; let others spew traceback
* turn off debug when running singlethreaded server

ceph_rest_api.py:
* put glob.* on app.ceph_* instead; pass around app in init code
* drop conf parsing (let librados do its job)

Documentation updated to match.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoqa/fs/.gitignore
Sage Weil [Sat, 27 Jul 2013 04:06:14 +0000 (21:06 -0700)]
qa/fs/.gitignore

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph_test_admin_socket: fix unit test
Sage Weil [Sat, 27 Jul 2013 04:06:06 +0000 (21:06 -0700)]
ceph_test_admin_socket: fix unit test

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomessage: Fix asserts that dont' trigger
David Zafman [Fri, 26 Jul 2013 21:00:06 +0000 (14:00 -0700)]
message: Fix asserts that dont' trigger

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agolibrados: EINVAL on a negative osd id
Sage Weil [Sat, 27 Jul 2013 00:26:48 +0000 (17:26 -0700)]
librados: EINVAL on a negative osd id

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph.in: make osdids() (and mon, mds) work on old mons
Dan Mick [Fri, 26 Jul 2013 23:25:26 +0000 (16:25 -0700)]
ceph.in: make osdids() (and mon, mds) work on old mons

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoosd: humor coverity
Sage Weil [Sat, 27 Jul 2013 00:14:44 +0000 (17:14 -0700)]
osd: humor coverity

CID 1058392: Out-of-bounds access (OVERRUN_DYNAMIC) [select issue]

CID 1058391 (#1 of 1): Out-of-bounds access (OVERRUN)
32. alloc_strlen: Allocating insufficient memory for the terminating null of the string.

CID 1058390 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
13. check_return: Calling function "this->class_handler->open_all_classes()" without checking return value. It wraps a library function that may fail and return an error code. [show details]
     14. unchecked_value: No check of the return value of "this->class_handler->open_all_classes()".

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon/MonCap: mds needs to subscribe to the osdmap
Sage Weil [Fri, 26 Jul 2013 22:46:51 +0000 (15:46 -0700)]
mon/MonCap: mds needs to subscribe to the osdmap

Usually it can get it from the OSD, but it assumes the mon will also share
and doesn't behave when it does not.

Fixes: #5767
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoremove unused fiemap code
Sage Weil [Fri, 26 Jul 2013 23:42:41 +0000 (16:42 -0700)]
remove unused fiemap code

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPendingReleaseNotes: note on 'ceph tell <pgid> ...'
Sage Weil [Fri, 26 Jul 2013 23:21:09 +0000 (16:21 -0700)]
PendingReleaseNotes: note on 'ceph tell <pgid> ...'

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/wip-tell-unified' into next
Sage Weil [Fri, 26 Jul 2013 23:12:19 +0000 (16:12 -0700)]
Merge remote-tracking branch 'gh/wip-tell-unified' into next

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph_rest_api.py: cleanup, more docstrings, unused vars
Dan Mick [Fri, 26 Jul 2013 22:23:57 +0000 (15:23 -0700)]
ceph_rest_api.py: cleanup, more docstrings, unused vars

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_argparse.py: make find_cmd_target handle tell <pgid>
Dan Mick [Thu, 25 Jul 2013 04:56:15 +0000 (21:56 -0700)]
ceph_argparse.py: make find_cmd_target handle tell <pgid>

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_argparse, mon: make "tell <pgid>" work (duplicating "pg <pgid>")
Dan Mick [Wed, 24 Jul 2013 05:13:14 +0000 (22:13 -0700)]
ceph_argparse, mon: make "tell <pgid>" work (duplicating "pg <pgid>")

It's a wad of special cases, but it implements "tell <pgid>" such that
it has the same effect as "pg <pgid>".

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_rest_api.py: obtain and handle tell <osd-or-pgid> commands
Dan Mick [Tue, 23 Jul 2013 07:50:15 +0000 (00:50 -0700)]
ceph_rest_api.py: obtain and handle tell <osd-or-pgid> commands

Contact an OSD that's up to get a list of the commands, and use
them to add to the URL map.

Special treatment throughout for these commands:

* hack the help signature dump
* keep a 'flavor' per command to allow special handler() processing
* strip off 'tell/<target>' when constructing command
* allow multiple dicts with the same url
  (the parameters and get/put methods can change)
* because of above, method must be validated in handler()
* validate the given OSD
* calculate target for command (mon, osd, pg)

Unrelated: make method_dict into global METHOD_DICT

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agomon/PGMonitor: reset in-core PGMap if on-disk format changes
Sage Weil [Fri, 26 Jul 2013 22:25:12 +0000 (15:25 -0700)]
mon/PGMonitor: reset in-core PGMap if on-disk format changes

We might have a sequence like:

- start mon, load pgmap 100
- sync
 - including a format upgrade at say v 150
- refresh
 - see format_version==1, and try read pgmap:101 as new format

This simply clears our in-memory state if we see that the format has
changed.  That will make update_from_paxos reload the latest and prevent
it from walking through the old and useless inc updates.

Note: this does not affect the auth monitor because we unconditionally
load the latest map in update_from_paxos on upgrade.  Also, the upgrade
there wasn't a format change--just a translation of cap strings from the
old to new style.

Fixes: #5764
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #470 from dalgaaf/wip-da-CID-3.v2
Sage Weil [Fri, 26 Jul 2013 22:08:56 +0000 (15:08 -0700)]
Merge pull request #470 from dalgaaf/wip-da-CID-3.v2

Fix several CID issues - v2

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorgw/rgw_metadata.cc: delete md_log (RGWMetadataLog) in destructor 470/head
Danny Al-Gaaf [Fri, 26 Jul 2013 21:28:44 +0000 (23:28 +0200)]
rgw/rgw_metadata.cc: delete md_log (RGWMetadataLog) in destructor

Call delete on md_log in the destructor.

CID 1054826 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
 1. alloc_new: Allocating memory by calling "new RGWMetadataLog(_cct, _store)".
 2. var_assign: Assigning: "this->md_log" = "new RGWMetadataLog(_cct, _store)".
 3. ctor_dtor_leak: The constructor allocates field "md_log" of
    "RGWMetadataManager" but the destructor and whatever functions it calls
    do not free it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw/rgw_rest_log.cc: free 'handle' to prevent memory leak
Danny Al-Gaaf [Fri, 26 Jul 2013 19:13:54 +0000 (21:13 +0200)]
rgw/rgw_rest_log.cc: free 'handle' to prevent memory leak

Call complete_list_entries() at end of RGWOp_MDLog_List::execute()
to free the 'handle'.

CID 1054834 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "handle" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_log.cc: fix resource leak, delete 'rop'
Danny Al-Gaaf [Thu, 25 Jul 2013 22:44:26 +0000 (00:44 +0200)]
test_cls_log.cc: fix resource leak, delete 'rop'

Fixes for:

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

CID 1054836 (#5 of 5): 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>
11 years agotest_cls_log.cc: remove empty lines
Danny Al-Gaaf [Thu, 25 Jul 2013 22:39:29 +0000 (00:39 +0200)]
test_cls_log.cc: remove empty lines

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_statelog.cc: fix memory leak, delete 'rop'
Danny Al-Gaaf [Thu, 25 Jul 2013 22:27:50 +0000 (00:27 +0200)]
test_cls_statelog.cc: fix memory leak, delete 'rop'

CID 1054840 (#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>
11 years agotest_cls_version.cc: close some memory leaks
Danny Al-Gaaf [Thu, 25 Jul 2013 22:14:59 +0000 (00:14 +0200)]
test_cls_version.cc: close some memory leaks

Close some memory leaks caused by calling new() without
freeing the memory already assigned to 'rop'.

CID 1054848 (#1-6 of 6): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "rop" in "rop = new_rop()"
  leaks the storage that "rop" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #467 from dalgaaf/wip-da-next-SCA-cppcheck-1
Sage Weil [Fri, 26 Jul 2013 21:54:50 +0000 (14:54 -0700)]
Merge pull request #467 from dalgaaf/wip-da-next-SCA-cppcheck-1

Fix typical smaller issues from SCA

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoupstart: stop ceph-create-keys when the monitor stops
Sage Weil [Fri, 26 Jul 2013 21:07:02 +0000 (14:07 -0700)]
upstart: stop ceph-create-keys when the monitor stops

This avoids lingering ceph-create-keys tasks.

Backport: cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: make open classes on start optional
Sage Weil [Fri, 26 Jul 2013 21:02:07 +0000 (14:02 -0700)]
osd: make open classes on start optional

Some might want the old behavior.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: load all classes on startup
Sage Weil [Fri, 26 Jul 2013 20:58:46 +0000 (13:58 -0700)]
osd: load all classes on startup

This avoid creating a wide window between when ceph-osd is started and
when a request arrives needing a class and it is loaded.  In particular,
upgrading the packages in that window may cause linkage errors (if the
class API has changed, for example).

Fixes: #5752
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoPG: add formatted output to pg <pgid> query, list_missing
Dan Mick [Sat, 20 Jul 2013 01:04:29 +0000 (18:04 -0700)]
PG: add formatted output to pg <pgid> query, list_missing

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoOSD: "tell <osd.n>" version, bench, dump_pg_recovery_stats: formatted
Dan Mick [Sat, 20 Jul 2013 01:03:24 +0000 (18:03 -0700)]
OSD: "tell <osd.n>" version, bench, dump_pg_recovery_stats: formatted

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoOSD: provide newer command descs with module/perm/avail
Dan Mick [Thu, 18 Jul 2013 23:34:23 +0000 (16:34 -0700)]
OSD: provide newer command descs with module/perm/avail

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph.in: clean up help, fix partial matching on all help
Dan Mick [Thu, 18 Jul 2013 21:44:17 +0000 (14:44 -0700)]
ceph.in: clean up help, fix partial matching on all help

Remove --help-all; too much effort for low benefit

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph.in: admin_socket() now validates command and passes format
Dan Mick [Thu, 18 Jul 2013 21:43:37 +0000 (14:43 -0700)]
ceph.in: admin_socket() now validates command and passes format

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_argparse.py, ceph.in: validate_command: stop handling format
Dan Mick [Thu, 18 Jul 2013 21:39:51 +0000 (14:39 -0700)]
ceph_argparse.py, ceph.in: validate_command: stop handling format

We were passing the entire parsed_args Namespace just to look at
and tack on 'format', and that's kinda silly; do it in the callers
instead.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoIn general, flush in caller of dump worker rather than worker
Dan Mick [Wed, 24 Jul 2013 00:24:52 +0000 (17:24 -0700)]
In general, flush in caller of dump worker rather than worker

This allows easier refactoring of workers (no dual flushes when code
changes).

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoFileStore: fix fd leak in _check_global_replay_guard
Samuel Just [Fri, 26 Jul 2013 20:42:27 +0000 (13:42 -0700)]
FileStore: fix fd leak in _check_global_replay_guard

Bug introduced in f3f92fe21061e21c8b259df5ef283a61782a44db.

Fixes: #5766
Backport: cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge branch 'wip-rgw-versionchecks' into next
Greg Farnum [Fri, 26 Jul 2013 20:03:01 +0000 (13:03 -0700)]
Merge branch 'wip-rgw-versionchecks' into next

Conflicts:
src/rgw/rgw_rest_metadata.h

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com
11 years agoFormatter, admin_socket: make default formatter be json-pretty
Dan Mick [Wed, 24 Jul 2013 00:23:50 +0000 (17:23 -0700)]
Formatter, admin_socket: make default formatter be json-pretty

If not given, default to json-pretty; if given but not equal to one
of the formatter choices, return NULL as before.  Remove defaulting
code in admin_socket.cc in favor of this.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoAdminSocket users: use generic formatting
Dan Mick [Thu, 18 Jul 2013 21:38:33 +0000 (14:38 -0700)]
AdminSocket users: use generic formatting

All call() routines get a format parameter; all places where
JSONFormatter was created get a new_formatter() instead.
'plain' formatting is unsupported, and help is forced to be
'json-pretty' as it was.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_rest_api.py: reversed test for failed request
Dan Mick [Fri, 26 Jul 2013 04:42:19 +0000 (21:42 -0700)]
ceph_rest_api.py: reversed test for failed request

A failed request has a response code *outside* the range (200, 300],
not within it.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agorest/test.py: earlier versions of requests.py don't quote ' ' in params
Dan Mick [Fri, 26 Jul 2013 04:41:32 +0000 (21:41 -0700)]
rest/test.py: earlier versions of requests.py don't quote ' ' in params

requests 0.12.1 handles queryparams in the URL with embedded
spaces; requests 0.8.2 does not.  Avoid the issue by quoting the
URL into expect().

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoOSD: tolerate holes in stored maps
Samuel Just [Mon, 22 Jul 2013 23:00:07 +0000 (16:00 -0700)]
OSD: tolerate holes in stored maps

We may have holes in stored maps during init_splits_between
and advance_pg.  In either case, we should simply skip the
missing maps.

Fixes: #5677
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph_rest_api.py: return error in nonformatted mode
Dan Mick [Fri, 26 Jul 2013 02:40:26 +0000 (19:40 -0700)]
ceph_rest_api.py: return error in nonformatted mode

When a nonformatted request is made, currently the only text in the
response is the (probably empty) response buffer.  Add the statusmsg
as well, where the error is likely to be explained.  This lets
the http client get a clue what happened.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
11 years agoceph_rest_api.py: actually remove the trailing / on baseurl
Dan Mick [Fri, 26 Jul 2013 00:29:22 +0000 (17:29 -0700)]
ceph_rest_api.py: actually remove the trailing / on baseurl

Lurking bug since version 1...

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
11 years agomon/MonCap: match param for entity (not name)
Sage Weil [Fri, 26 Jul 2013 00:58:47 +0000 (17:58 -0700)]
mon/MonCap: match param for entity (not name)

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
11 years agomon: translate caps=[k1,v1,k2,v2] into [caps_k1=v1, caps_k2=v2]
Sage Weil [Fri, 26 Jul 2013 00:58:12 +0000 (17:58 -0700)]
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>
11 years agomon/Paxos: share uncommitted value when leader is/was behind
Sage Weil [Thu, 25 Jul 2013 18:10:53 +0000 (11:10 -0700)]
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>
11 years agorgw: expose the version of synced items to the poster
Greg Farnum [Thu, 25 Jul 2013 22:07:39 +0000 (15:07 -0700)]
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>
11 years agorgw: return the update status on sync requests
Greg Farnum [Thu, 25 Jul 2013 23:03:54 +0000 (16:03 -0700)]
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>
11 years agorgw: add sync state parsing code and REST interface
Greg Farnum [Wed, 17 Jul 2013 19:51:04 +0000 (12:51 -0700)]
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>
11 years agorgw: pass the sync mode into the RGWMetadataManager::put() calls.
Greg Farnum [Wed, 17 Jul 2013 19:50:14 +0000 (12:50 -0700)]
rgw: pass the sync mode into the RGWMetadataManager::put() calls.

Signed-off-by: Greg Farnum <greg@inktank.com>
11 years agorgw: add preliminary support for sync update policies on metadata sync
Greg Farnum [Tue, 16 Jul 2013 19:23:13 +0000 (12:23 -0700)]
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>
11 years agoremove old push_to_kclient.pl
Sage Weil [Thu, 25 Jul 2013 22:24:52 +0000 (15:24 -0700)]
remove old push_to_kclient.pl

Signed-off-by: Sage Weil <sage@inktank.com>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agorgw/rgw_metadata.h: init prefix in initialization list 467/head
Danny Al-Gaaf [Thu, 25 Jul 2013 17:12:44 +0000 (19:12 +0200)]
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>
11 years agotest_rgw_admin_log.cc: remove unused variable 'creds'
Danny Al-Gaaf [Thu, 25 Jul 2013 17:07:58 +0000 (19:07 +0200)]
test_rgw_admin_log.cc: remove unused variable 'creds'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_log.cc: use static_cast<>() instead of C-Style cast
Danny Al-Gaaf [Thu, 25 Jul 2013 17:06:53 +0000 (19:06 +0200)]
test_rgw_admin_log.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_opstate.cc: remove unused variable 'creds'
Danny Al-Gaaf [Thu, 25 Jul 2013 17:04:34 +0000 (19:04 +0200)]
test_rgw_admin_opstate.cc: remove unused variable 'creds'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_meta.cc: remove unused variable 'creds'
Danny Al-Gaaf [Thu, 25 Jul 2013 17:03:06 +0000 (19:03 +0200)]
test_rgw_admin_meta.cc: remove unused variable 'creds'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_opstate.cc: use static_cast<>() instead of C-Style cast
Danny Al-Gaaf [Thu, 25 Jul 2013 17:01:52 +0000 (19:01 +0200)]
test_rgw_admin_opstate.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_meta.cc: use static_cast<>() instead of C-Style cast
Danny Al-Gaaf [Thu, 25 Jul 2013 16:58:37 +0000 (18:58 +0200)]
test_rgw_admin_meta.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 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

11 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>
11 years agov0.67-rc2 v0.67-rc2
Gary Lowell [Wed, 24 Jul 2013 23:18:56 +0000 (16:18 -0700)]
v0.67-rc2

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>