summaryrefslogtreecommitdiff
path: root/src/osdc
Commit message (Collapse)AuthorAgeFilesLines
* osdc/ObjectCacher: finish contexts after dropping object referenceYan, Zheng2013-09-181-2/+4
| | | | | | | | The context to finish can be class C_Client_PutInode, which may drop inode's last reference. So we should first drop object's reference, then finish contexts. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
* Objecter: rename cancel_op -> cancel_linger_opGreg Farnum2013-09-102-7/+5
| | | | | | | | This makes it possible to converse about op_cancel and cancel_linger_op without getting too confused. Signed-off-by: Greg Farnum <greg@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* Merge pull request #580 from ceph/wip-6033-redirectsGregory Farnum2013-09-102-19/+48
|\ | | | | Reviewed-by: Sage Weil <sage@inktank.com>
| * Objecter: follow redirect replies from the OSDGreg Farnum2013-09-101-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | If we get back a redirect reply, we clean up the Op's external references and re-send using the target_oloc and target_oid. To facilitate this, recalc_op_target() now only fills them in and overrides them with pool cache semantics if they're empty. Keep in mind that this is a pretty simple redirect formula -- the Objecter will keep following redirects forever if that's what the OSDs send back. The client is not providing any synchronization right now. Signed-off-by: Greg Farnum <greg@inktank.com>
| * Objecter: write a helper function to clean up ops that need to be retriedGreg Farnum2013-09-102-4/+11
| | | | | | | | | | | | | | | | We have a little block to clean them up if we get back EAGAIN, but it's actually leaking map references; we will also use this for redirects from the OSDs. Signed-off-by: Greg Farnum <greg@inktank.com>
| * Objecter: add an Op::target_oid, and use it when submitting OpsGreg Farnum2013-09-102-2/+5
| | | | | | | | | | | | | | For now it's just a copy of base_oid, but soon we will allow it to be overwritten for OSD-driven redirects. Signed-off-by: Greg Farnum <greg@inktank.com>
| * Objecter: rename Op::oid -> Op::base_oidGreg Farnum2013-09-102-8/+8
| | | | | | | | | | | | | | | | | | Analagous to the oloc->base_oloc rename we did in e2fcad09d94d965867147627b73e99da9454436f, we may specify a different target name for a redirect. Rename the existing oid to base_oid to avoid any confusion. Signed-off-by: Greg Farnum <greg@inktank.com>
* | automake cleanup: implementing non-recursive makeRoald J. van Loon2013-09-081-0/+17
|/ | | | | | | | - Enabling subdir objects - Created a Makefile-env.am with basic automake init - Created .am files per subdir, included from src/Makefile.am Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
* objecter, librados: add COPY_FROM operationSage Weil2013-09-031-0/+8
| | | | | | | | | | | | | | | | | | | This operation will copy an entire object (data, attrs, omap) atomically. If the src_version does not match the source object, or the source object is updated while the copy is in progress, we will fail with a suitable error code. By atomic we mean that it will either successfully copy the entire object in its entirety or it will fail (and require no cleanup). Add to C++ librados API only for now. Signed-off-by: Sage Weil <sage@inktank.com> Conflicts: src/include/ceph_strings.cc src/include/rados.h src/osd/osd_types.cc
* osdc/Objecter: fix dereference of NULL pg_pool_tSage Weil2013-09-011-4/+7
| | | | | | | | | | | | Make sure we don't dereference a NULL pointer. Note that we check a bit further down if the target pool does not exist and return the proper error. Bug was reliably reproduced by ./ceph_test_rados_api_watch_notify --gtest_filter=LibRadosWatchNotify.WatchNotifyTimeoutTestPP Signed-off-by: Sage Weil <sage@inktank.com>
* osd: COPY_GET operationSage Weil2013-08-301-0/+76
| | | | | | | | Add new rados operation to copy all user-visible content for an object in a simple, safe way. Use a new object_copy_cursor_t to keep track of our position. Signed-off-by: Sage Weil <sage@inktank.com>
* osdc/Objecter: allow ops to be canceledSage Weil2013-08-302-0/+29
| | | | | | | This is useful in general, and specifically will be useful for the rados COPY operation. Signed-off-by: Sage Weil <sage@inktank.com>
* osdc/Objecter: only request map on startup if epoch == 0Sage Weil2013-08-301-1/+2
| | | | | | | Normal clients have no map and need one to get started. If we are the OSD, we will already have one and will get fed maps as they come in. Signed-off-by: Sage Weil <sage@inktank.com>
* osd, objecter: clean up assert_ver()Sage Weil2013-08-301-2/+2
| | | | | | | | Create a separate union in the args and clean up the code a bit so that this doesn't reuse the (unrelated) watch helpers. No change in protocol. Signed-off-by: Sage Weil <sage@inktank.com>
* Objecter: respect read_tier & write_tier for initial op submissionGreg Farnum2013-08-301-1/+10
| | | | | | | | We overwrite target_oloc.pool with the appropriate [read|write]_tier. write_tier wins if it matches both. We don't handle any sort of redirect yet. Signed-off-by: Greg Farnum <greg@inktank.com>
* Objecter: be careful about precalculated pgidsGreg Farnum2013-08-301-0/+1
| | | | | | | | | | The only current user of the precalc_pgid field is list_objects. That's fine, but we don't want new users to inadvertently appear and somehow break the caching/tiering stuff by forcing us to go to the base pool when we should be talking to somebody else. Add an assert to catch these cases. Signed-off-by: Greg Farnum <greg@inktank.com>
* Objecter: add an Op::target_oloc and use it instead of base_oloc in send_op()Greg Farnum2013-08-302-3/+6
| | | | | | | For now we simply set target_oloc = base_oloc in recalc_op_target(), but we will shortly be doing more interesting things with it there. Signed-off-by: Greg Farnum <greg@inktank.com>
* Objecter: rename Op::oloc -> Op::base_olocGreg Farnum2013-08-302-8/+8
| | | | | | | | We want to be able to target other pools for caching and tiering, so we need to take an oloc from the client and translate it into an actual target. Rename oloc to base_oloc to make clear which one it is. Signed-off-by: Greg Farnum <greg@inktank.com>
* Merge remote-tracking branch 'origin/master' into wip-6029Greg Farnum2013-08-273-16/+50
|\ | | | | | | | | Conflicts: src/librados/AioCompletionImpl.h
| * Merge branch 'next'Josh Durgin2013-08-211-4/+13
| |\
| | * objecter: fix keys of dump_linger_opsJosh Durgin2013-08-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The registering flag no longer exists, and registered was using the wrong property due to a copy-paste error. Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Sage Weil <sage.weil@inktank.com>
| | * objecter: resend unfinished lingers when osdmap is no longer pausedJosh Durgin2013-08-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Plain Ops that haven't finished yet need to be resent if the osdmap transitions from full or paused to unpaused. If these Ops are triggered by LingerOps, they will be cancelled instead (since should_resend = false), but the LingerOps that triggered them will not be resent. Fix this by checking the registered flag for all linger ops, and resending any of them that aren't paused anymore. Fixes: #6070 Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Sage Weil <sage.weil@inktank.com>
| * | Merge remote-tracking branch 'gh/next'Sage Weil2013-08-202-12/+37
| |\ \ | | |/
| | * Merge remote-tracking branch 'gh/wip-6004' into nextSage Weil2013-08-202-12/+37
| | |\ | | | | | | | | | | | | | | | | Reviewed-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
| | | * osdc/ObjectCacher: do not merge rx buffersSage Weil2013-08-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not try to merge rx buffers currently. Make that explicit and documented in the code that it is not supported. (Otherwise the last_read_tid values will get lost and read results won't get applied to the cache properly.) Signed-off-by: Sage Weil <sage@inktank.com>
| | | * osdc/ObjectCacher: match reads with their original rx buffersSage Weil2013-08-152-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a sequence like: 1- start read on 100~200 100~200 state rx 2- truncate to 200 100~100 state rx 3- start read on 200~200 100~100 state rx 200~200 state rx 4- get 100~200 read result Currently this makes us crash on osdc/ObjectCacher.cc: 738: FAILED assert(bh->length() <= start+(loff_t)length-opos) when processing the second 200~200 bufferhead (it is too big). The larger issue, though, is that we should not be looking at this data at all; it has been truncated away. Fix this by marking each rx buffer with the read request that is sent to fill it, and only fill it from that read request. Then the first reply will fill the first 100~100 extend but not touch the other extent; the second read will do that. Signed-off-by: Sage Weil <sage@inktank.com>
* | | | Objecter: expose MOSDOp's new user_version instead of the replay_versionGreg Farnum2013-08-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want users to ever see the replay_version, which is about to become private RADOS data. Signed-off-by: Greg Farnum <greg@inktank.com>
* | | | Objecter: librados: mass switch from eversion_t to version_tGreg Farnum2013-08-272-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a lot of pointers throughout our request infrastructure used solely for exporting the version to users. The interfaces we actually expose only provide a uint64_t (leaving off eversion_t's epoch), and that's all we're going to maintain in our new user_version scheme, so don't pretend we'll have more in our internal interfaces. I audited this pretty carefully; in particular: Op::objver is only used for passing data back to users via the calling functions IoCtxImpl::last_objver, etc IoCtxImpl::last_objver is used only for the set_sync_op_version() call, which provides data only for the uint64_t get_last_version() and rados_get_last_version() calls. AioCompletionImpl::objver is used only for the uint64_t get_version() call. LingerOp::pobjver is used only for referencing things that are now version_t. Signed-off-by: Greg Farnum <greg@inktank.com>
* | | | Objecter: rename Op::version to Op::replay_versionGreg Farnum2013-08-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is used for replay, so let's be more precise! Signed-off-by: Greg Farnum <greg@inktank.com>
* | | | MOSDOpReply: rename *_version() -> *_replay_version()Greg Farnum2013-08-271-3/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | We have been returning the object's "user version" and using that for replay, but that is in fact incorrect. In preparation for fixing up the user version semantics, rename get_version to get_replay_version and set_version to set_replay_version. Signed-off-by: Greg Farnum <greg@inktank.com>
* | | Ceph-fuse: Fallocate and punch hole supportLi Wang2013-08-191-2/+21
|/ / | | | | | | | | | | | | | | This patch implements fallocate and punch hole support for Ceph fuse client. Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com> Signed-off-by: Li Wang <liwang@ubuntukylin.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | Fix compilation -Wmismatched-tags warningsChristophe Courtaut2013-08-094-5/+5
|/ | | | | | Keep consistency in the code to not generate warnings of this type. Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
* Merge remote-tracking branch 'gh/next'Sage Weil2013-08-081-2/+1
|\
| * mon, osd: Clean up "flush(stringstream); bl.append(stringstream.str())Dan Mick2013-08-061-2/+1
| | | | | | | | | | | | | | | | Also: One redundant flush in AuthMonitor, two in PGMonitor, and a ds << that should have been conditional in Monitor. Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | Merge remote-tracking branch 'gh/next'Sage Weil2013-08-022-2/+7
|\ \ | |/
| * Verify that deleting op never in check_latest_map_ops mapDavid Zafman2013-07-311-0/+1
| | | | | | | | Signed-off-by: David Zafman <david.zafman@inktank.com>
| * osdc: op left in check_lastest_map_opsDavid Zafman2013-07-311-0/+1
| | | | | | | | | | | | | | | | Call op_cancel_map_check before cancel_op() in send_linger() Fixes: #5784 Signed-off-by: David Zafman <david.zafman@inktank.com>
| * osdc: Add asserts that client_lock is heldDavid Zafman2013-07-311-0/+3
| | | | | | | | | | | | Clarify locking by indicating that client_lock is held Signed-off-by: David Zafman <david.zafman@inktank.com>
| * Make all AdminSocket commands use argparse/cmdmap.Dan Mick2013-07-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fixes regression in daemon commands with arguments; also resolves reported bug with existing daemon code for arguments with embedded spaces. Fixes: #5503 Fixes: #5800 Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | Merge remote-tracking branch 'gh/next'Sage Weil2013-07-301-0/+1
|\ \ | |/
| * Objecter: set c->session to NULL if acting is emptySamuel Just2013-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, we might leave a session attached to the CommandOp for an down OSD. handle_osd_map will then delete the session for the down OSD. tick() will then attempt to follow the invalid pointer to find a connection over which to send a MPing. Fixes: #5798 Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
* | Merge remote-tracking branch 'gh/next'Sage Weil2013-07-282-89/+92
|\ \ | |/
| * AdminSocket users: use generic formattingDan Mick2013-07-252-89/+92
| | | | | | | | | | | | | | | | | | 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>
* | src/*: make Context::finish private and switch all users to use completeSamuel Just2013-07-224-56/+28
|/ | | | | Signed-off-by: Samuel Just <sam.just@inktank.com> Fixes: Sage Weil <sage@inktank.com>
* mon: do not populate MMonCommand paxos version fieldSage Weil2013-07-101-1/+1
| | | | | | | | The field is not used or useful since the monitor does not even look at it (in Monitor::handle_command()). Avoid populating it and the subsequent confusion for poor developers. Signed-off-by: Sage Weil <sage@inktank.com>
* Merge branch 'wip-4982-4983-oloc-rebase'David Zafman2013-07-094-1/+4
|\ | | | | | | | | | | | | | | | | fixes: #4982 fixes: #4983 Reviewed-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com> Reviewed-by: David Zafman <david.zafman@inktank.com>
| * librados, os, osd, osdc, test: Add support for client specified namespacesDavid Zafman2013-07-094-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add rados_ioctx_namespace_set_key() and librados::IoCtx::namespace_set_key() Add namespace to admin-daemon operations Support namespace in osd map command Add namespace to object_locator_t and hobject_t Add random namespaces to psim program Feature: #4982 (OSD: namespaces pt 1 (librados/osd, not caps)) Signed-off-by: David Zafman <david.zafman@inktank.com>
* | Merge remote-tracking branch 'origin/master' into wip-rgw-geoYehuda Sadeh2013-07-038-90/+546
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/Makefile.am src/include/rados/librados.hpp src/rgw/rgw_admin.cc src/rgw/rgw_bucket.cc src/rgw/rgw_common.cc src/rgw/rgw_common.h src/rgw/rgw_json_enc.cc src/rgw/rgw_main.cc src/rgw/rgw_op.h src/rgw/rgw_rados.cc src/rgw/rgw_tools.cc src/rgw/rgw_user.cc src/rgw/rgw_user.h Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
| * osdc/Objecter: resend command map version checks on reconnectSage Weil2013-07-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We already do this for Ops and LingerOps, but missed this when we added CommandOps to the mix. The result is that an ill-timed mon disconnect will leave a command map check (and thus the command) hanging. This misbehavior was introduced when CommandOp was introduced, back in commit 2e172225b01561bb7988b6d86d96ff4b9c1c5762, and we failed to fix it in 8808ca57c652502d9cf803b0dc53673ca9dd62af. Fixes: #5493 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
| * osdc/Objecter.cc: use static_cast instead of C-Style castDanny Al-Gaaf2013-06-241-1/+1
| | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>