summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* rgw: keep a region connection mapwip-5793Yehuda Sadeh2013-07-292-1/+23
| | | | | | | | | Fixes: #5793 Beforehand all remote copies were going to the master region which was awfully wrong. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
* mon/PGMonitor: reset in-core PGMap if on-disk format changesSage Weil2013-07-264-1/+19
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge pull request #470 from dalgaaf/wip-da-CID-3.v2Sage Weil2013-07-265-15/+12
|\ | | | | | | | | Fix several CID issues - v2 Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
| * rgw/rgw_metadata.cc: delete md_log (RGWMetadataLog) in destructorDanny Al-Gaaf2013-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * rgw/rgw_rest_log.cc: free 'handle' to prevent memory leakDanny Al-Gaaf2013-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * test_cls_log.cc: fix resource leak, delete 'rop'Danny Al-Gaaf2013-07-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * test_cls_log.cc: remove empty linesDanny Al-Gaaf2013-07-261-14/+0
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_cls_statelog.cc: fix memory leak, delete 'rop'Danny Al-Gaaf2013-07-261-0/+1
| | | | | | | | | | | | | | | | 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>
| * test_cls_version.cc: close some memory leaksDanny Al-Gaaf2013-07-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #467 from dalgaaf/wip-da-next-SCA-cppcheck-1Sage Weil2013-07-264-15/+7
|\ \ | |/ |/| | | | | Fix typical smaller issues from SCA Reviewed-by: Sage Weil <sage@inktank.com>
| * rgw/rgw_metadata.h: init prefix in initialization listDanny Al-Gaaf2013-07-251-3/+1
| | | | | | | | | | | | | | | | 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>
| * test_rgw_admin_log.cc: remove unused variable 'creds'Danny Al-Gaaf2013-07-251-2/+0
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_rgw_admin_log.cc: use static_cast<>() instead of C-Style castDanny Al-Gaaf2013-07-251-2/+2
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_rgw_admin_opstate.cc: remove unused variable 'creds'Danny Al-Gaaf2013-07-251-2/+0
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_rgw_admin_meta.cc: remove unused variable 'creds'Danny Al-Gaaf2013-07-251-2/+0
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_rgw_admin_opstate.cc: use static_cast<>() instead of C-Style castDanny Al-Gaaf2013-07-251-2/+2
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * test_rgw_admin_meta.cc: use static_cast<>() instead of C-Style castDanny Al-Gaaf2013-07-251-2/+2
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* | upstart: stop ceph-create-keys when the monitor stopsSage Weil2013-07-261-0/+1
| | | | | | | | | | | | | | This avoids lingering ceph-create-keys tasks. Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com>
* | osd: make open classes on start optionalSage Weil2013-07-262-1/+4
| | | | | | | | | | | | Some might want the old behavior. Signed-off-by: Sage Weil <sage@inktank.com>
* | osd: load all classes on startupSage Weil2013-07-263-1/+41
| | | | | | | | | | | | | | | | | | | | | | 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>
* | FileStore: fix fd leak in _check_global_replay_guardSamuel Just2013-07-261-0/+1
| | | | | | | | | | | | | | | | | | Bug introduced in f3f92fe21061e21c8b259df5ef283a61782a44db. Fixes: #5766 Backport: cuttlefish Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | Merge branch 'wip-rgw-versionchecks' into nextGreg Farnum2013-07-269-62/+170
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: src/rgw/rgw_rest_metadata.h Reviewed-by: Yehuda Sadeh <yehuda@inktank.com
| * | rgw: expose the version of synced items to the posterGreg Farnum2013-07-255-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | rgw: return the update status on sync requestsGreg Farnum2013-07-256-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | rgw: add sync state parsing code and REST interfaceGreg Farnum2013-07-252-0/+23
| | | | | | | | | | | | | | | | | | | | | 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>
| * | rgw: pass the sync mode into the RGWMetadataManager::put() calls.Greg Farnum2013-07-254-7/+8
| | | | | | | | | | | | Signed-off-by: Greg Farnum <greg@inktank.com>
| * | rgw: add preliminary support for sync update policies on metadata syncGreg Farnum2013-07-256-8/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | rgw: grab the old mtime when doing a user metadata putGreg Farnum2013-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | We're about to use this to enable (ick) a timestamp-based update decision tree, to help in resolving disastrous double-active conflicts. Signed-off-by: Greg Farnum <greg@inktank.com>
| * | test: switch the cls_replica_log tests to use a test fixtureGreg Farnum2013-07-191-46/+44
| | | | | | | | | | | | | | | | | | Instead of the silly macros. Signed-off-by: Greg Farnum <greg@inktank.com>
* | | ceph_rest_api.py: reversed test for failed requestDan Mick2013-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | A failed request has a response code *outside* the range (200, 300], not within it. Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | rest/test.py: earlier versions of requests.py don't quote ' ' in paramsDan Mick2013-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | OSD: tolerate holes in stored mapsSamuel Just2013-07-254-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ceph_rest_api.py: return error in nonformatted modeDan Mick2013-07-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ceph_rest_api.py: actually remove the trailing / on baseurlDan Mick2013-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | Lurking bug since version 1... Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | | mon/MonCap: match param for entity (not name)Sage Weil2013-07-251-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Dan Mick <dan.mick@inktank.com>
* | | mon: translate caps=[k1,v1,k2,v2] into [caps_k1=v1, caps_k2=v2]Sage Weil2013-07-251-2/+14
| | | | | | | | | | | | | | | | | | | | | The command matching needs key/value pairs. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Dan Mick <dan.mick@inktank.com>
* | | mon/Paxos: share uncommitted value when leader is/was behindSage Weil2013-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | remove old push_to_kclient.plSage Weil2013-07-251-32/+0
| | | | | | | | | | | | Signed-off-by: Sage Weil <sage@inktank.com>
* | | ceph-disk: use new dumpling-style osd caps if we can, or fall back to ↵Alfredo Deza2013-07-251-17/+36
| | | | | | | | | | | | | | | | | | | | | old-style ones Signed-off-by: Alfredo Deza <alfredo@deza.pe> Reviewed-by: Sage Weil <sage@inktank.com>
* | | osd: Don't put functional code inside of an assertDavid Zafman2013-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | Fix assert in OSDService::get_map() Signed-off-by: David Zafman <david.zafman@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | | ceph_argparse.py: wrong variable used if valid() fails for Ceph{Osd}NameDan Mick2013-07-251-2/+2
| | | | | | | | | | | | | | | | | | self.t isn't valid in the failure case; use t Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | Merge pull request #456 from dalgaaf/wip-da-CID-1Sage Weil2013-07-253-2/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | Fix CID issues Reviewed-by: Sage Weil <sage@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
| * | | test_cls_statelog.cc: fix resource leak, delete 'rop' at end of functionDanny Al-Gaaf2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_statelog.cc: fix resource leak, delete op at end of functionDanny Al-Gaaf2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_statelog.cc: fix resource leak, delete rop at end of functionDanny Al-Gaaf2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_version.cc: fix resource leak, delete before new()Danny Al-Gaaf2013-07-221-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_version.cc: fix resource leak, delete before new()Danny Al-Gaaf2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_version.cc: fix another ressource leakDanny Al-Gaaf2013-07-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | test_cls_version.cc: fix ressource leakDanny Al-Gaaf2013-07-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | cls/rgw/cls_rgw.cc: init start_key_added with falseDanny Al-Gaaf2013-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>