Commit Graph

28445 Commits

Author SHA1 Message Date
Greg Farnum
13aac48f25 workunits: add a test for caching redirects
This may need to change since it exploits some of the loose
consistency we currently have with caching pools, but for now
it checks that the Objecter does what we want.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-30 14:06:33 -07:00
Greg Farnum
dae9a34b4f osd_types: note that write_tier wins if read_tier is different
For pg_pool_t.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-30 14:06:33 -07:00
Greg Farnum
e3fb912131 Objecter: respect read_tier & write_tier for initial op submission
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>
2013-08-30 14:06:33 -07:00
Greg Farnum
b76953c626 Objecter: be careful about precalculated pgids
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>
2013-08-30 14:06:33 -07:00
Greg Farnum
665acc11ac Objecter: add an Op::target_oloc and use it instead of base_oloc in send_op()
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>
2013-08-30 14:06:33 -07:00
Greg Farnum
e2fcad09d9 Objecter: rename Op::oloc -> Op::base_oloc
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>
2013-08-30 14:06:33 -07:00
Greg Farnum
3516996bb3 mon/OSDMonitor: 'osd tier {set,remove}-overlay <pool> [tierpool]'
Also prevent 'osd tier remove ...' if the tierpool is the current overlay.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-30 14:06:33 -07:00
Greg Farnum
efb7ab2ae4 qa/workunits/cephtool/test.sh: test osd tier CLI
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-30 14:06:33 -07:00
Sage Weil
4e439857a6 mon/OSDMonitor: 'osd tier cache-mode <pool> <mode>'
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-30 14:06:33 -07:00
Sage Weil
af0a0cd74a mon/OSDMonitor: 'osd pool tier <add|remove> <pool> <tierpool>'
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-29 15:00:17 -07:00
Sage Weil
5e2c86adb0 osd/OSDMonitor: avoid polluting pending_inc on error for 'osd pool set ...'
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-29 15:00:17 -07:00
Sage Weil
ed62c457b5 osd_types: add pg_pool_t cache-related fields
We add fields sufficient to specify
* many pools have a tiering relationship with pool foo
* pool foo is a tier pool for pool bar
* the tiering relationship between foo and bar is specified
  by cache_mode
* client reads and writes for pool foo should be directed to
  pools bar and baz, respectively (where probably, but not
  necessarily, baz == bar or baz == foo).

This lets us specify very sophisticated caching policies on
the server side that all clients going forward can handle
simply by directing the messages as the read_tier and write_tier
flags, and the (not-yet-implemented) redirect replies
from OSDs, specify.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-29 15:00:17 -07:00
Sage Weil
61b40f481b doc/dev/cache-pool: document cache pool management interface
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-28 09:34:03 -07:00
Sage Weil
b91c1c52c7 add CEPH_FEATURE_OSD_CACHEPOOL
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-28 09:33:59 -07:00
Gregory Farnum
be9a39b766 Merge pull request #549 from ceph/wip-6029
Make user_version a first-class citizen
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
2013-08-28 09:15:36 -07:00
Greg Farnum
9101433a88 Merge remote-tracking branch 'origin/master' into wip-6029
Conflicts:
	src/librados/AioCompletionImpl.h
2013-08-27 17:26:36 -07:00
Greg Farnum
6c432f1932 doc: update to describe new OSD version support as it actually exists
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:51 -07:00
Greg Farnum
c119afa075 ReplicatedPG: add OpContext::user_at_version
Set this up with the existing at_version member, but only increase
it for user_modify ops. Use this when logging the PG's user_version. In
order to maintain compatibility with old clients on classic pools, we
force user_version to follow at_version whenever it's updated.

Now that we have and are maintaining this PG user version, use it
for the user version on ops that get ENOENT back, when short-circuiting
replies as part of reply_op_error()[1], or when replying to repops
in eval_repop; further use it for the cls_current_version() function. This
is a small semantic change for that function, as previously it would
generally return the same value as the user would get sent back via
MOSDOpReply -- but I don't think it was something you could count on.
We now define it as being the user version of the PG at the start of the
op, and as a bonus it is defined even for read ops (the at_version is
only filled in on write operations).

[1]: We tweak PGLog to make it easier to retrieve both user and PG versions.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
7db71fc270 MOSDOpReply: stop filling in replay_version from the MOSDOp to begin with
It's just asking for trouble.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
2c05b4fea2 MOSDOpReply: switch to comprehensive instead of individual version setters
There's little point to updating versions individually when we can
do so en masse and avoid mistakes in duplication.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
de20997445 MOSDOpReply: add enough fields to be backwards compatible.
The system we've been building up works out very nicely for new clients,
but they could not have interoperated with old clients that were only
referring to our replay_version. In order to deal with this, we add
a bad_replay_version to MOSDOpReply which is encoded where we used
to encode replay_version. bad_replay_version will follow the same semantics
as reassert_version used to (except that it is filled in on reads), but
is not accessible to new clients, who can see only our properly-controlled
replay_version and user_version. This will let old and new clients
interoperate correctly when communicating about watches, etc.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
dc9d3fc357 osd: actually fill in user_version in pg_log_entry_t
We now require it when creating a pg_log_entry_t. The user_version
is the version which info.last_user_version should be set to
after the transaction is applied, which for everything except for
a user-modify op is going to be the version it was already at.
For now we are filling in the user-modify op's changing user_version
to be ctx->at_version.version

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
cc1c4a752f osd: add last_user_version to pg_info_t
We add a corresponding user_version to pg_log_entry_t, and the logic
to assign from one to the other and to recover last_user_version from
a master's log. We aren't yet setting it to anything, though.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
69280e2aeb ReplicatedPG: remove OpContext::reply_user_version
ctx->new_obs.oi.user_version is initialized to ctx->obs.oi.user_version,
and for read ops it won't be changed. That means
reply_user_version == ctx->new_obs.oi.user_version in all cases, which
means we don't want it.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
2e764a8183 osd: switch object_info_t::user_version to be a version_t
We never expose the full eversion_t data to users, and do not want to.
However, we pull some tricks in the encode/decode functions to avoid
having to change the object_info_t disk format for this change.
When we can break compatibility, we should simplify this.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
57e346b169 ReplicatedPG: Fill in the MOSDOpReply's user_version
As part of this, rename OpContext::reply_version->reply_user_version.
The semantics that necessitate the reply_version are only for user versions,
so rename it for clarity. Then use the reply_user_version in
set_user_version() (if the op succeeded).
For now we use the PG version for ENOENT (preserving the previous
semantics), but that will get changed to the pg's user_version soon
as well.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:50 -07:00
Greg Farnum
9b998a960a ReplicatedPG: set the replay version based on the at_version
The replay version is not for users to consume, so we don't want
to use the user_version for it.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:49 -07:00
Greg Farnum
e42ef0c079 Objecter: expose MOSDOp's new user_version instead of the replay_version
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>
2013-08-27 17:24:49 -07:00
Greg Farnum
ff1a573025 Objecter: librados: mass switch from eversion_t to version_t
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>
2013-08-27 17:24:49 -07:00
Greg Farnum
931bf7e8a8 Objecter: rename Op::version to Op::replay_version
This is used for replay, so let's be more precise!

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:49 -07:00
Greg Farnum
17e32f9506 MOSDOpReply: add user_version field
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:24:49 -07:00
Greg Farnum
295a84b9d9 doc: include plan for new user_version support
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:00:44 -07:00
Greg Farnum
1f608bd967 ReplicatedPG: do not do a redundant set of ctx->new_obs.oi.version
We set this in the if below for writes, and for reads it doesn't need to
be updated (and isn't). Remove the confusing double-set so future code
inspectors don't get concerned there's a bug like I did.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:00:44 -07:00
Greg Farnum
37bba41be6 ReplicatedPG: remove long-dead branch
This was confusing the heck out of me when trying to figure out
why I was hitting an assert. So replace the if-else block with
a more appropriate assert and don't include any misleading calls
to prepare_transaction() from sub_op_modify().

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 17:00:44 -07:00
Greg Farnum
f400816471 MOSDOpReply: rename *_version() -> *_replay_version()
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>
2013-08-27 17:00:38 -07:00
Greg Farnum
7a7ae60851 MOSDOpReply: rename reassert_version -> replay_version
Because that's what it's for. reassert_version is a bit ambiguous.

Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 16:56:40 -07:00
Greg Farnum
b5ea74cec4 docs: document how the current OSD PG/object versions work
Signed-off-by: Greg Farnum <greg@inktank.com>
2013-08-27 15:08:28 -07:00
athanatos
7cc2eb246d Merge pull request #545 from dachary/wip-6117
SharedPtrRegistry: get_next must not delete while holding the lock

Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-08-27 10:56:49 -07:00
John Wilkins
3266862491 doc: Updated to accurately reflect that upstart applies to a single node.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-08-27 10:25:50 -07:00
Gary Lowell
8df504c157 ceph.spec.in: radosgw package doesn't require mod_fcgi
Fixes #5702

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
2013-08-27 09:53:12 -07:00
Sage Weil
a10ca4b5e0 librbd: fix debug print in aio_write
Reported-by: James Harper <james.harper@bendigoit.com.au>
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-27 08:30:50 -07:00
Roald J. van Loon
228510ff17 cleanup: removed last references to g_conf from auth
Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer.
Replaced them in favor of cct->_conf.

Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
2013-08-27 08:17:19 -07:00
Loic Dachary
ea2fc85e09 SharedPtrRegistry: get_next must not delete while holding the lock
bool get_next(const K &key, pair<K, VPtr> *next)

may indirectly delete the object pointed by next->second when
doing :

    *next = make_pair(i->first, next_val);

and it will deadlock (EDEADLK) when

    void operator()(V *to_remove) {
      {
	Mutex::Locker l(parent->lock);

tries to acquire the lock because it is already held. The
Mutex::Locker is isolated in a block and the *next* parameter is set
outside of the block.

A test case demonstrating the problem is added to test_sharedptr_registry.cc

http://tracker.ceph.com/issues/6117 fixes #6117

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-08-27 16:09:17 +02:00
Loic Dachary
af5281e0f6 common: move SharedPtrRegistry test after t.join
The thread created to test SharedPtrRegistry race conditions updates a
value ( ptr ) that is tested by the main gtest thread but is not
protected by a lock. Instead of adding a lock, the main thread tests
the value after pthread_join() on the child thread.

http://tracker.ceph.com/issues/6130 fixes #6130

Signed-off-by: Loic Dachary <loic@dachary.org>
2013-08-27 13:59:57 +02:00
Sage Weil
a6fe776c3a Merge remote-tracking branch 'gh/next' 2013-08-26 18:11:32 -07:00
Sage Weil
c5b5ce120a osd: install admin socket commands after signals
This lets us tell by the presence of the admin socket commands whether
a signal will make us shut down cleanly.  See #5924.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
2013-08-26 13:20:51 -07:00
Sage Weil
76a38c3bc6 mon/DataHealthService: preserve compat of data stats dump
See 96621bdb00.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-26 13:19:27 -07:00
Sage Weil
e8df142441 Merge pull request #526 from ceph/wip-5909
mon: Early warning system for monitor stores growing over predefined threshold

Reviewed-by: Sage Weil <sage@inktank.com>
2013-08-26 13:17:20 -07:00
Sage Weil
b74fa14afc Merge pull request #540 from ceph/wip-doc-update
List packages needed for RPM-based distros
2013-08-26 10:42:34 -07:00
Samuel Just
d571825080 WBThrottle: use fdatasync instead of fsync
Backport: dumpling
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-08-26 10:32:33 -07:00