]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
13 years agoMerge branch 'wip-msgr'
Sage Weil [Mon, 13 Aug 2012 20:34:29 +0000 (13:34 -0700)]
Merge branch 'wip-msgr'

13 years agomsg/Accepter: fix nonce initialization
Sage Weil [Mon, 13 Aug 2012 20:15:55 +0000 (13:15 -0700)]
msg/Accepter: fix nonce initialization

This needs to be provided to the Accepter at bind time, not by start().
Otherwise the nonce is effectively always 0, which is useless and breaks
all sorts of things.  Broken by 8453a8198c65712db968ff42be4fd10d2d216582.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoceph-osd: log journal-creation failure with derr
Dan Mick [Mon, 13 Aug 2012 18:46:48 +0000 (11:46 -0700)]
ceph-osd: log journal-creation failure with derr

Fixes: #2938
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Dan Mick <dan.mick@inktank.com>
13 years agoMerge branch 'wip-msgr'
Sage Weil [Mon, 13 Aug 2012 16:58:49 +0000 (09:58 -0700)]
Merge branch 'wip-msgr'

13 years agocephtool: make command wait for osdmap explicit
Sage Weil [Mon, 13 Aug 2012 16:56:59 +0000 (09:56 -0700)]
cephtool: make command wait for osdmap explicit

If we are waiting for an osdmap for a command, track that explicitly so
that we know when to retry send_command().

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge tag 'v0.50'
Sage Weil [Mon, 13 Aug 2012 16:48:49 +0000 (09:48 -0700)]
Merge tag 'v0.50'

v0.50

13 years agov0.50 v0.50
Sage Weil [Mon, 13 Aug 2012 16:49:24 +0000 (09:49 -0700)]
v0.50

13 years agomsg/Pipe: discard_queue() -> discard_out_queue()
Sage Weil [Sat, 11 Aug 2012 15:13:39 +0000 (08:13 -0700)]
msg/Pipe: discard_queue() -> discard_out_queue()

We only discard outgoing messages; incoming messages are handled by the
IncomingQueue.. but this method doesn't touch that.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Pipe: simplify Pipe::tcp_read() return value
Sage Weil [Sat, 11 Aug 2012 15:10:14 +0000 (08:10 -0700)]
msg/Pipe: simplify Pipe::tcp_read() return value

0 for success; no reason to return length (always == len).

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Pipe: document tcp_*()
Sage Weil [Sat, 11 Aug 2012 15:03:52 +0000 (08:03 -0700)]
msg/Pipe: document tcp_*()

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Accepter: use learned_addr() from Accepter::bind()
Sage Weil [Sat, 11 Aug 2012 14:52:28 +0000 (07:52 -0700)]
msg/Accepter: use learned_addr() from Accepter::bind()

Normally we never go from need_addr == false to need_addr == true.
It always starts out as true, so this else is useless on the first
call to Accepter::bind().

The only exception is rebind().  Add an unlearn_addr() that will clear
need_addr.  This is almost unnecessary, but doing so fixes a small bug
where the local_connection->peer_addr doesn't get updated when we do a
rebind().

Drop now-unused set_need_addr().  We keep get_need_addr() only because
it is useful in the debug output and for the assert.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/SimpleMessenger: push need_addr check into learned_addr()
Sage Weil [Sat, 11 Aug 2012 14:45:18 +0000 (07:45 -0700)]
msg/SimpleMessenger: push need_addr check into learned_addr()

This puts all of the do/do not lock logic in one place, and documents
it.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Accepter: pass nonce on start
Sage Weil [Sat, 11 Aug 2012 14:37:45 +0000 (07:37 -0700)]
msg/Accepter: pass nonce on start

This lets us drop the otherwise awkward SimpleMessenger::get_nonce()
accessor.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsgr: protect set_myaddr()
Sage Weil [Sat, 11 Aug 2012 14:31:35 +0000 (07:31 -0700)]
msgr: protect set_myaddr()

This is used by Messenger implementation (and their constituent
components).

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Accepter: make members private
Sage Weil [Sat, 11 Aug 2012 14:29:38 +0000 (07:29 -0700)]
msg/Accepter: make members private

Nobody uses these.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsgr: remove useless SimpleMessenger::msgr
Sage Weil [Sat, 11 Aug 2012 14:28:32 +0000 (07:28 -0700)]
msgr: remove useless SimpleMessenger::msgr

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsgr: some SimpleMessenger docs
Sage Weil [Sat, 11 Aug 2012 14:24:04 +0000 (07:24 -0700)]
msgr: some SimpleMessenger docs

Document basic modules and the lock ordering.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agocephtool: send keepalive to tell target
Sage Weil [Tue, 31 Jul 2012 22:02:55 +0000 (15:02 -0700)]
cephtool: send keepalive to tell target

If we 'ceph tell <foo> ...' to a non-monitor, we need to send keepalives to
ensure we detect a tcp drop.  (Not so for monitors; monclient already does
its own keepalive thing.)

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agocephtool: retry 'ceph tell <who> ...' command if connection fails
Sage Weil [Tue, 31 Jul 2012 21:47:26 +0000 (14:47 -0700)]
cephtool: retry 'ceph tell <who> ...' command if connection fails

It was easy to reproduce a hang with 'ceph osd tell osd.0 foo' and
messenger failure injection.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agocephtool: set messenger policy
Sage Weil [Tue, 31 Jul 2012 21:46:13 +0000 (14:46 -0700)]
cephtool: set messenger policy

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agocephtool: fix deadlock on fault when waiting for osdmap
Sage Weil [Tue, 31 Jul 2012 21:45:51 +0000 (14:45 -0700)]
cephtool: fix deadlock on fault when waiting for osdmap

send_command() was blocking for the osdmap, and also called from the
connect callback.  Instead, re-call it from the handle_osd_map() callback
so that it never blocks.

This was easy to trigger with 'ceph osd tell osd.0 foo' and ms failure
injection.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMonMap: return error on failure in build_initial
Josh Durgin [Wed, 8 Aug 2012 22:24:57 +0000 (15:24 -0700)]
MonMap: return error on failure in build_initial

If mon_host fails to parse, return an error instead of success.
This avoids failing later on an assert monmap.size() > 0 in the
monmap in MonClient.

Fixes: #2913
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agoaddr_parsing: report correct error message
Josh Durgin [Wed, 8 Aug 2012 22:10:27 +0000 (15:10 -0700)]
addr_parsing: report correct error message

getaddrinfo uses its return code to report failures.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agorgw: modify some error messages
Yehuda Sadeh [Thu, 9 Aug 2012 20:54:15 +0000 (13:54 -0700)]
rgw: modify some error messages

Make them more correct, clearer.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agoMerge remote-tracking branch 'origin/wip-rgw-admin'
Yehuda Sadeh [Thu, 9 Aug 2012 20:39:20 +0000 (13:39 -0700)]
Merge remote-tracking branch 'origin/wip-rgw-admin'

13 years agorgw: use multiple notification objects
Yehuda Sadeh [Mon, 18 Jun 2012 20:25:44 +0000 (13:25 -0700)]
rgw: use multiple notification objects

Issue #2504. This makes us listen and notify on more than
a single object, which reduces the contention of cache
notifications.

NOTE: This change requires that any radosgw and radosgw-admin
use the same 'rgw num control oids' config value. A config value
of 0 will maintain old compatibility, and will allow an upgraded
process run in conjuction with an old one. Setting value other
than 0 (or using the non-zero default) will require upgrading
and restarting all the gateways together. Failing to do so
might lead to inconsistent user and buckets metadata (which
will be resolved once gateways are restarted).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agoradosgw-admin.rst: Misc doccumentation update.
caleb miles [Wed, 25 Jul 2012 19:56:59 +0000 (12:56 -0700)]
radosgw-admin.rst: Misc doccumentation update.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
13 years agorgw_admin.cc: Allow removal of a user's buckets during user removal.
caleb miles [Thu, 9 Aug 2012 20:27:21 +0000 (13:27 -0700)]
rgw_admin.cc: Allow removal of a user's buckets during user removal.

Allow the buckets, and any child objects, of a user to be deleted when the
user is deleted through radosgw-admin. In reference to feature request
2499: http://tracker.newdream.net/issues/2499.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
13 years agorgw_admin.cc: Allow for deletion of objects through radosgw-admin.
caleb miles [Thu, 9 Aug 2012 16:55:27 +0000 (09:55 -0700)]
rgw_admin.cc: Allow for deletion of objects through radosgw-admin.

Allow objects to be deleted through radosgw-admin with an optional flag
to delete the tail of that object during the processing of the intent log.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
13 years agodoc: New example usage.
John Wilkins [Thu, 9 Aug 2012 16:21:38 +0000 (09:21 -0700)]
doc: New example usage.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
13 years agorgw: fix usage trim call encoding
Yehuda Sadeh [Wed, 1 Aug 2012 20:22:38 +0000 (13:22 -0700)]
rgw: fix usage trim call encoding

Fixes: #2841.
Usage trim operation was encoding the wrong op structure (usage read).
Since the structures somewhat overlapped it somewhat worked, but user
info wasn't encoded.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agocls_rgw: fix rgw_cls_usage_log_trim_op encode/decode
Yehuda Sadeh [Wed, 8 Aug 2012 22:21:53 +0000 (15:21 -0700)]
cls_rgw: fix rgw_cls_usage_log_trim_op encode/decode

It was not encoding user, adding that and reset version
compatibility.
This changes affects command interface, makes use of
radosgw-admin usage trim incompatible. Use of old
radosgw-admin usage trim should be avoided, as it may
remove more data than requested. In any case, upgraded
server code will not handle old client's trim requests.

backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agorgw: expand date format support
Yehuda Sadeh [Tue, 31 Jul 2012 23:17:22 +0000 (16:17 -0700)]
rgw: expand date format support

Relaxing the date format parsing function to allow UTC
instead of GMT.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agorgw: complete multipart upload can handle chunked encoding
Yehuda Sadeh [Thu, 2 Aug 2012 18:13:05 +0000 (11:13 -0700)]
rgw: complete multipart upload can handle chunked encoding

Fixes: #2878
We now allow complete multipart upload to use chunked encoding
when sending request data. With chunked encoding the HTTP_LENGTH
header is not required.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agorgw_xml: xml_handle_data() appends data string
Yehuda Sadeh [Wed, 1 Aug 2012 18:19:32 +0000 (11:19 -0700)]
rgw_xml: xml_handle_data() appends data string

Fixes: #2879.
xml_handle_data() appends data to the object instead of just
replacing it. Parsed data can arrive in pieces, specifically
when data is escaped.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agorgw: ETag is unquoted in multipart upload complete
Yehuda Sadeh [Wed, 1 Aug 2012 20:09:41 +0000 (13:09 -0700)]
rgw: ETag is unquoted in multipart upload complete

Fixes #2877.
Removing quotes from ETag before comparing it to what we
have when completing a multipart upload.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agodoc: Added debug and logging reference.
John Wilkins [Wed, 8 Aug 2012 22:06:57 +0000 (15:06 -0700)]
doc: Added debug and logging reference.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
13 years agomkcephfs: use default osd_data, _journal values
Sage Weil [Wed, 8 Aug 2012 21:01:53 +0000 (14:01 -0700)]
mkcephfs: use default osd_data, _journal values

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
13 years agomkcephfs: use new default keyring locations
Sage Weil [Wed, 8 Aug 2012 21:01:35 +0000 (14:01 -0700)]
mkcephfs: use new default keyring locations

The ceph-conf command only parses the conf; it does not apply default
config values.  This breaks mkcephfs if values are not specified in the
config.

Let ceph-osd create its own key, fix copying, and fix creation/copying for
the mds.

Fixes: #2845
Reported-by: Florian Haas <florian@hastexo.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
13 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Wed, 8 Aug 2012 20:05:12 +0000 (13:05 -0700)]
Merge remote-tracking branch 'gh/next'

13 years agobuffer: make release() private
Sage Weil [Wed, 8 Aug 2012 15:09:59 +0000 (08:09 -0700)]
buffer: make release() private

This should only be called by ~ptr or when we are replacing the current
target with something new.  It is not suitable for external consumption
Because it doesn't reset length and offset.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agorados.py: add binding for rados_trunc
Evan Felix [Sat, 4 Aug 2012 00:56:25 +0000 (17:56 -0700)]
rados.py: add binding for rados_trunc

Fixes: #2909
Signed-off-by: Evan Felix <evan.felix@pnnl.gov>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agodoc: Explicitly state mount.ceph two first arguments are fixed.
Tommi Virtanen [Thu, 2 Aug 2012 23:03:19 +0000 (16:03 -0700)]
doc: Explicitly state mount.ceph two first arguments are fixed.

I've hurt myself too many times with this.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agodoc: mount.ceph is also needed for cephx.
Tommi Virtanen [Thu, 2 Aug 2012 23:00:15 +0000 (16:00 -0700)]
doc: mount.ceph is also needed for cephx.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agodoc: Fix toctree structure for man obsync(1).
Tommi Virtanen [Thu, 2 Aug 2012 22:56:57 +0000 (15:56 -0700)]
doc: Fix toctree structure for man obsync(1).

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agorgw_admin.cc: Disallow addition of S3 keys with subuser creation
caleb miles [Fri, 27 Jul 2012 18:26:21 +0000 (11:26 -0700)]
rgw_admin.cc: Disallow addition of S3 keys with subuser creation

Fixes: #1855
It is no longer possible to create a subuser and new S3 key associated
with that user through the radosgw-admin utility. In reference to Bug 1855
http://tracker.newdream.net/issues/1855.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: caleb miles <caleb.miles@inktank.com>
13 years agoceph-authtool: Fix usage, it's --print-key not --print.
Tommi Virtanen [Thu, 2 Aug 2012 20:02:04 +0000 (13:02 -0700)]
ceph-authtool: Fix usage, it's --print-key not --print.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agoRevert "osd: peering: detect when log source osd goes down"
Samuel Just [Thu, 2 Aug 2012 17:58:31 +0000 (10:58 -0700)]
Revert "osd: peering: detect when log source osd goes down"

This reverts commit 0d3d75ec0d17e2f6bc5d42058f51eb2ff19ffb71.

Accidental double push.

13 years agodoc: cd to repository before running git status.
Tommi Virtanen [Thu, 2 Aug 2012 15:31:26 +0000 (08:31 -0700)]
doc: cd to repository before running git status.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agodoc: Say what to do if submodules are out of date.
Tommi Virtanen [Thu, 2 Aug 2012 15:29:50 +0000 (08:29 -0700)]
doc: Say what to do if submodules are out of date.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agodoc: Simplify submodules explanation.
Tommi Virtanen [Thu, 2 Aug 2012 15:27:55 +0000 (08:27 -0700)]
doc: Simplify submodules explanation.

``git clone --recursive`` does ``init`` & ``update`` for us. Also
avoids incorrect language; there never were submodules called ``init``
and ``update``.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agodoc: Correct Git URL for clone
Wido den Hollander [Thu, 2 Aug 2012 10:48:26 +0000 (12:48 +0200)]
doc: Correct Git URL for clone

Using git@github.com would mean SSHing in, and your average open
source consumer probably won't have a Github account.

Using HTTPS offers the best combination of resisting man-in-the-middle
attacks and passing through corporate firewalls.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Tommi Virtanen <tv@inktank.com>
13 years agoosd: peering: detect when log source osd goes down
Sage Weil [Tue, 31 Jul 2012 21:01:57 +0000 (14:01 -0700)]
osd: peering: detect when log source osd goes down

The Peering state has a generic check based on the prior set osds that
will restart peering if one of them goes down (or one of the interesting
down ones comes up).  The GetLog state, however, can pull the log from
a peer that is not in the prior set if it got a notify from them (e.g., an
osd in an old interval that was down when the prior set was calculated).
If that osd goes down, we don't detect it and will block forward.

Fix by adding a simple check in GetLog for the newest_update_osd going
down.

(BTW GetMissing does not suffer from this problem because
peer_missing_requested is a subset of the prior set, so the Peering check
is sufficient.)

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
13 years agoosd: peering: detect when log source osd goes down
Sage Weil [Tue, 31 Jul 2012 21:01:57 +0000 (14:01 -0700)]
osd: peering: detect when log source osd goes down

The Peering state has a generic check based on the prior set osds that
will restart peering if one of them goes down (or one of the interesting
down ones comes up).  The GetLog state, however, can pull the log from
a peer that is not in the prior set if it got a notify from them (e.g., an
osd in an old interval that was down when the prior set was calculated).
If that osd goes down, we don't detect it and will block forward.

Fix by adding a simple check in GetLog for the newest_update_osd going
down.

(BTW GetMissing does not suffer from this problem because
peer_missing_requested is a subset of the prior set, so the Peering check
is sufficient.)

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
13 years agowireshark: update patch
Yehuda Sadeh [Tue, 17 Jul 2012 18:37:30 +0000 (11:37 -0700)]
wireshark: update patch

Update to latest source tree (svn 43768).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agoReplicatedPG: clear waiting_for_ack when we send the commit
Samuel Just [Mon, 30 Jul 2012 23:58:56 +0000 (16:58 -0700)]
ReplicatedPG: clear waiting_for_ack when we send the commit

Otherwise, we might send the ack anyway later, after a subsequent
commit is sent resulting in an out-of-order op.

This resulted in a a crash when the client encountered out of
order ops.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoMerge remote-tracking branch 'upstream/wip-leveldb-iterators'
Samuel Just [Tue, 31 Jul 2012 20:51:49 +0000 (13:51 -0700)]
Merge remote-tracking branch 'upstream/wip-leveldb-iterators'

13 years agorbd: fix off-by-one error in key name
Sylvain Munaut [Tue, 31 Jul 2012 18:55:56 +0000 (11:55 -0700)]
rbd: fix off-by-one error in key name

Fixes: #2846
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agosecret: return error on empty secret
Sylvain Munaut [Tue, 31 Jul 2012 18:54:29 +0000 (11:54 -0700)]
secret: return error on empty secret

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agoPG,ReplicatedPG: clarify scrub state clearing
Samuel Just [Mon, 30 Jul 2012 20:43:51 +0000 (13:43 -0700)]
PG,ReplicatedPG: clarify scrub state clearing

scrub_clear_state takes care of clearing the SCRUB and REPAIR
flags.  Thus, PG::scrub() needn't clear them again since
any change that would have caused that if block to occur
would have triggered ReplicatedPG::on_change(), which also
clears the scrub reservations.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoPG::mark_clean(): queue_snap_trim if snap_trimq is not empty
Samuel Just [Mon, 30 Jul 2012 20:38:08 +0000 (13:38 -0700)]
PG::mark_clean(): queue_snap_trim if snap_trimq is not empty

Currently, we won't queue for snap trim until the next map
update.

Noticed while reviewing another patch, this would result in
snaps not being trimmed until the next map update.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoReplicatedPG::snap_trimmer: requeue if scrub_block_writes
Samuel Just [Mon, 30 Jul 2012 20:36:39 +0000 (13:36 -0700)]
ReplicatedPG::snap_trimmer: requeue if scrub_block_writes

Otherwise, we do not continue snap_trimming once scrub is
complete.

Noticed while revewing another patch.  This would result
in snaps not being trimmed again until the next map
update.

Signed-off-by: Samuel Just <sam.just@inktank.com>
13 years agoMerge branch 'wip-osd'
Sage Weil [Mon, 30 Jul 2012 17:49:44 +0000 (10:49 -0700)]
Merge branch 'wip-osd'

Reviewed-by: Samuel Just <sam.just@inktank.com>
13 years agoosd: initialize send_notify on pg load
Sage Weil [Sat, 28 Jul 2012 16:19:03 +0000 (09:19 -0700)]
osd: initialize send_notify on pg load

When the PG is loaded, we need to set send_notify if we are not the
primary.  Otherwise, if the PG does not go through
start_peering_interval() or experience a role change, we will not set
the flag and tell the primary that we exist.  This can cause problems
for example if we have unfound objects that the primary needs, although
I'm sure there are other bad implications as well.

Fixes: #2866
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosd: replace STRAY bit with bool
Sage Weil [Sat, 28 Jul 2012 16:17:34 +0000 (09:17 -0700)]
osd: replace STRAY bit with bool

We were setting a bit in pg->state that is private to the non-primary
PG.  The other bits get shared with the mon etc, but this one didn't.

Replace it with a simple bool.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agotest: test_keyvaluedb_iterators: Test KeyValueDB implementations iterators
Joao Eduardo Luis [Wed, 18 Jul 2012 21:26:29 +0000 (22:26 +0100)]
test: test_keyvaluedb_iterators: Test KeyValueDB implementations iterators

This set of tests focus on testing the expected behavior of LevelDBStore's
and KeyValueDBMemory's iterators.

We test a grand total of six use cases, each one with several test
units, being tested for both the LevelDBStore and the in-memory mock
(totalling 48 test units, plus two disabled by default):

 * Removing keys:
  - Using both the whole-space iterator and the whole-space snapshot
    iterator
  - Tests key removal while iterating the store, either by prefix or by
    removing specific (prefix,key) pairs

 * Setting keys:
  - Using both the whole-space iterator and the whole-space snapshot
    iterator
  - Tests key insertion while iterating the store
  - Tests value update while iterating the store
  - This use case has two disabled tests: one when setting keys, other
    when updating values, both on LevelDBStore and using the whole-space
    iterator; this is because they will fail, unlike when using the
    in-memory mock implementation, because leveldb implicitely creates
    an iterator that will read from a snapshot instead of directly from
    the underlying store.

 * Using Upper/Lower Bounds:
  - Using the whole-space iterator (we don't modify the store's state,
    so there is no need to also test the whole-space snapshot iterator)
  - Tests upper/lower bounds when the key, the prefix or both are empty
  - Tests upper/lower bounds when both the key and the prefix are set

 * Seeking:
  - Using the whole-space iterator (we don't modify the store's state,
    so there is no need to also test the whole-space snapshot iterator)
  - Tests seeking to first and to last
  - Tests seeking to first and to last using a prefix

 * Key-Space Iteration:
  - Using the whole-space iterator (we don't modify the store's state,
    so there is no need to also test the whole-space snapshot iterator)
  - Tests forward and backward iteration over the key-space

 * Empty Store:
  - Using the whole-space iterator (we don't modify the store's state,
    so there is no need to also test the whole-space snapshot iterator)
  - Tests seeking and using bounds functions when the store is empty

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
13 years agoos: KeyValueDB: implement snapshot iterators
Joao Eduardo Luis [Mon, 23 Jul 2012 10:56:50 +0000 (11:56 +0100)]
os: KeyValueDB: implement snapshot iterators

Create a set of functions, to be implemented by derivative classes of
KeyValueDB, responsible for returning an iterator with strong
read-consistency guarantees. How this iterator is implemented, or by what
is it backed up, is implementation specific, but it must guarantee that
all reads made using this iterator are as if there were no subsequent
writes to the store since we created the iterator.

For instance, LevelDBStore will back this iterator with a leveldb Snapshot,
while KeyValueDBMemory will perform a copy of its in-memory map.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
13 years agoos: KeyValueDB: re-implement (prefix) iter in terms of whole-space iter
Joao Eduardo Luis [Mon, 23 Jul 2012 10:47:00 +0000 (11:47 +0100)]
os: KeyValueDB: re-implement (prefix) iter in terms of whole-space iter

In-a-nutshell-version: Create a whole-space iterator interface, and
implement the already existing, prefix-based iterator in terms of the
new whole-space iterator;

This patch introduces a significant change on the architecture of
KeyValueDB's iterator, although its interface remains the same.

Before this patch, KeyValueDB simply defined an interface for a
prefix-based interface, to be implemented by derivative classes. Being
constrained by a prefix-based approach to iterate over the store only makes
sense when we know which prefixes we want to iterate over, but for that we
must know about the prefixes beforehand. This approach didn't work when one
wanted to iterate over the whole key space, without any previous awareness
about the keys and their prefixes.

This patch introduces a new interface for a whole-space iterator, to be
implemented by derivative classes, which is prefix-independent. We also
define an abstract function to obtain this iterator, which must also be
implemented by the derivative class. With this interface in place, we are
then able to implement a prefix-dependent iterator in terms of the
whole-space iterator, which will be offered by the KeyValueDB class itself.

Furthermore, we implement these changes on LevelDBStore and KeyValueDBMemory,
the in-memory mock store, which leads to significant changes on both:

  * LevelDBStore
    - Substitute the previously existing LevelDBIteratorImpl, which
      followed a prefix-based iteration, for
      LevelDBWholeSpaceIteratorImpl, which now iterates over the whole
      key space of the store;

  * KeyValueDBMemory:
    - Substitute the previously existing MemIterator, which followed a
      prefix-based iteration, for WholeSpaceMemIterator, which now
      iterates over the whole key space of the in-memory mock store;
    - Change the in-memory mock store data structure. Previously, we
      used a map-of-maps, mapping prefixes to a key/value map; now we
      keep a single map, mapping (prefix,key) pairs to values.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
13 years agotest: workloadgen: Don't linearly iterate over a map to obtain a collection
Joao Eduardo Luis [Tue, 24 Jul 2012 20:53:20 +0000 (21:53 +0100)]
test: workloadgen: Don't linearly iterate over a map to obtain a collection

We were iterating over the collections map a certain amount of times, in
order to obtain the collection in that position. To avoid this kind of
behavior in a function that may be called a large amount of times, and
that may iterate over a rather large map, we now keep the collection ids
in a vector. In order to obtain a given collection on position X, we will
simply look for the collection id on position X of the vector, and then
obtain the collection from the map using its collection id.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
13 years agoosd: peering: make Incomplete a Peering substate
Sage Weil [Fri, 27 Jul 2012 23:03:26 +0000 (16:03 -0700)]
osd: peering: make Incomplete a Peering substate

This allows us to still catch changes in the prior set that would affect
our conclusions (that we are incomplete) and, when they happen, restart
peering.

Consider:
 - calc prior set, osd A is down
 - query everyone else, no good info
 - set down, go to Incomplete (previously WaitActingChange) state.
 - osd A comes back up (we do nothing)
 - osd A sends notify message with good info (we ignore)

By making this a Peering substate, we catch the Peering AdvMap reaction,
which will notice a prior set down osd is now up and move to Reset.

Fixes: #2860
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosd: peering: move to Incomplete when.. incomplete
Sage Weil [Fri, 27 Jul 2012 22:39:40 +0000 (15:39 -0700)]
osd: peering: move to Incomplete when.. incomplete

PG::choose_acting() may return false and *not* request an acting set change
if it can't find any suitable peers with enough info to recover.  In that
case, we should move to Incomplete, not WaitActingChange, just like we do
a bit lower in GetLog() if we have non-contiguous logs.  The state name is
more accurate, and this is also needed to fix bug #2860.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoMerge remote-tracking branch 'gh/wip-msgr-masterbits'
Sage Weil [Sat, 28 Jul 2012 14:21:05 +0000 (07:21 -0700)]
Merge remote-tracking branch 'gh/wip-msgr-masterbits'

Reviewed-by: Greg Farnum <greg@inktank.com>
13 years agoconfig: send warnings to a ostream* argument
Sage Weil [Sat, 28 Jul 2012 14:39:27 +0000 (07:39 -0700)]
config: send warnings to a ostream* argument

We shouldn't always send these to stderr.  (Among other things, the
warning: prefix breaks the gitbuilder error detection.)

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agovstart.sh: apply extra conf after the defaults
Sage Weil [Fri, 27 Jul 2012 21:28:04 +0000 (14:28 -0700)]
vstart.sh: apply extra conf after the defaults

This let's you do e.g., -o 'debug ms = 100' and it will apply after
the default logging levels.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Pipe: if we send a wait, make sure we follow through
Sage Weil [Thu, 26 Jul 2012 23:50:30 +0000 (16:50 -0700)]
msg/Pipe: if we send a wait, make sure we follow through

Mark our outgoing connection attempt if we send a WAIT in accept().  This
ensures we don't go to standby or closed in fault() on the outgoing
connection for any reason.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoclient: handle fault during session teardown
Sage Weil [Wed, 25 Jul 2012 05:34:17 +0000 (22:34 -0700)]
client: handle fault during session teardown

We may have a sequence like:

 - client does REQUEST_CLOSE
 - mds sends reply
 - connection faults, client does get reply
 - mds closes out its connection
 - client tries to reconnect/resend, gets RESET_SESSION
   -> continues lamely waiting

If we get a session reset and we were asking to close the connection,
we are happy--it was closed.

This was exposed with ceph-fuse start/stop tests with socket failure
injection.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomsg/Pipe: make STANDBY behavior optional
Sage Weil [Wed, 25 Jul 2012 00:12:02 +0000 (17:12 -0700)]
msg/Pipe: make STANDBY behavior optional

In particular, lossless_peers should use STANDBY, but lossless_clients
should reconnect immediately since they are already doing their own session
management.

Specifically, this fixes the problem where the Client tries to open a
connection to the MDS and faults after delivering its OPEN_SESSION message
but before it gets the reply: the session isn't open yet, so it isn't
pinging.  It could, but it is simpler and faster to make the msgr layer
keep the connection open instead of waiting for a periodic keepalive.

Fixes: #2824
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoconf: make dup lines override previous value
Sage Weil [Fri, 20 Jul 2012 15:55:21 +0000 (08:55 -0700)]
conf: make dup lines override previous value

If you put

[some section]
 foo = 1
 ...
 foo = 2

in a .conf file, make the second key override the first.

Generate a warning if a value is overridden to sidestep some user hangbanging.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: remove superfluous "can't delete except on master" comments
Sage Weil [Mon, 23 Jul 2012 21:39:10 +0000 (14:39 -0700)]
mon: remove superfluous "can't delete except on master" comments

That's what 'return false' means for preprocess_*().

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: make pool snap creation ops idempotent
Sage Weil [Mon, 23 Jul 2012 23:04:00 +0000 (16:04 -0700)]
mon: make pool snap creation ops idempotent

Return 0 if the snap already exists, or is already deleted.

Also, avoid updating the pg_pool if we are just waiting for the current
round to commit.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoobjecter: return ENOENT/EEXIST on pool snap delete/create
Sage Weil [Mon, 23 Jul 2012 23:01:14 +0000 (16:01 -0700)]
objecter: return ENOENT/EEXIST on pool snap delete/create

Do these checks on the client to mask monitor idempotency from the user.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agolibrados: make snap create/destroy handle client-side errors
Sage Weil [Mon, 23 Jul 2012 23:29:07 +0000 (16:29 -0700)]
librados: make snap create/destroy handle client-side errors

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: check for invalid pool snap creates in preprocess_op, too
Sage Weil [Fri, 20 Jul 2012 00:35:57 +0000 (17:35 -0700)]
mon: check for invalid pool snap creates in preprocess_op, too

This avoids waiting for a paxos commit just to return an error.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoqa: simple tests for 'ceph osd create|rm' commands
Sage Weil [Fri, 20 Jul 2012 05:04:29 +0000 (22:04 -0700)]
qa: simple tests for 'ceph osd create|rm' commands

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: make 'osd rm ...' idempotent
Sage Weil [Fri, 20 Jul 2012 00:10:57 +0000 (17:10 -0700)]
mon: make 'osd rm ...' idempotent

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoqa: simple test for pool create/delete commands
Sage Weil [Fri, 20 Jul 2012 04:56:56 +0000 (21:56 -0700)]
qa: simple test for pool create/delete commands

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: make pool creation idempotent
Sage Weil [Mon, 23 Jul 2012 23:03:46 +0000 (16:03 -0700)]
mon: make pool creation idempotent

Return success if the pool already exists.  Part of #2638.

Also, fix this so we wait until a creating pool is created before we reply.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomon: make pool removal idempotent
Sage Weil [Mon, 23 Jul 2012 23:03:36 +0000 (16:03 -0700)]
mon: make pool removal idempotent

Return success if pool does not exist.  Part of #2638.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoobjecter: make pool create/delete return EEXIST/ENOENT
Sage Weil [Mon, 23 Jul 2012 22:37:06 +0000 (15:37 -0700)]
objecter: make pool create/delete return EEXIST/ENOENT

Do these checks on the client side to mask monitor idempotency from
the user.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agolibrados: make pool create/destroy handle client-side errors
Sage Weil [Mon, 23 Jul 2012 23:23:20 +0000 (16:23 -0700)]
librados: make pool create/destroy handle client-side errors

Add tests!

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoobjecter: fix mon command resends
Sage Weil [Mon, 23 Jul 2012 21:41:17 +0000 (14:41 -0700)]
objecter: fix mon command resends

The monitor session is lossy.  Send these when the op is initiated, or
when we reconnect.  The timeout/cutoff was preventing ops from getting
resent if there was an ill-timed mon reset.

Backport: testing, stable/argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
13 years agomutex: assert we are unlocked by the same thread that locked
Sage Weil [Tue, 17 Jul 2012 20:52:57 +0000 (13:52 -0700)]
mutex: assert we are unlocked by the same thread that locked

This only works for non-recursive locks.  (Which is probably all of them?)

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agocond: reorder asserts
Sage Weil [Tue, 17 Jul 2012 20:52:00 +0000 (13:52 -0700)]
cond: reorder asserts

Make the more specific checks assert before the less specific ones, so we
are more likely to crash with useful information.

Signed-off-by: Sage Weil <sage@inktank.com>
13 years agoosd: fixing sharing of past_intervals on backfill restart
Sage Weil [Thu, 26 Jul 2012 23:35:00 +0000 (16:35 -0700)]
osd: fixing sharing of past_intervals on backfill restart

We need to share past_intervals whenever we instantiate the PG on a peer.
In the PG activation case, this is based on whether our peer_info[] value
for that peer is dne().  However, the backfill code was updating the
peer info (history) in the block preceeding the dne() check, which meant
we never shared past_intervals in this case and the peer would have to
chew through a potentially large number of maps if the PG has not been
clean recently.

Fix by checking dne() prior to the backfill block.  We still need to fill
in the message later because it isn't yet instantiated.

Fixes: #2849
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agofilestore: check for EIO in read path
Sage Weil [Fri, 27 Jul 2012 04:55:00 +0000 (21:55 -0700)]
filestore: check for EIO in read path

Check for EIO in read methods and helpers.  Try to do checks in low-level
methods (e.g., lfn_*()) to avoid duplication in higher-level methods.

The transaction apply function already checks for EIO on writes, and will
generate a nicer error message, so we can largely ignore the write path,
as long as errors get passed up correctly.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agofilestore: add 'filestore fail eio' option, default true
Sage Weil [Thu, 26 Jul 2012 16:07:46 +0000 (09:07 -0700)]
filestore: add 'filestore fail eio' option, default true

By default we will assert/fail/crash on EIO from the underlying fs.  We
already do this in the write path, but not the read path, or in various
internal infrastructure.

Signed-off-by: Sage Weil <sage@inktank.com>
Conflicts:

src/os/FileStore.cc

13 years agolibrbd: fix id initialization in new format
Josh Durgin [Thu, 26 Jul 2012 22:27:49 +0000 (15:27 -0700)]
librbd: fix id initialization in new format

48bd839b1e25b063c675416a8f6233463f1af115 should have included this.
I misread it due to the use of bid instead of id when generating
the object prefix.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agolibrbd: fix id initialization in new format
Josh Durgin [Thu, 26 Jul 2012 22:27:49 +0000 (15:27 -0700)]
librbd: fix id initialization in new format

48bd839b1e25b063c675416a8f6233463f1af115 should have included this.
I misread it due to the use of bid instead of id when generating
the object prefix.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
13 years agomon: set a configurable max osd cap
Yehuda Sadeh [Thu, 26 Jul 2012 20:14:40 +0000 (13:14 -0700)]
mon: set a configurable max osd cap

Don't allow setting a higher osd num through the
ceph control util.

Fixes: #2752
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
13 years agodoc: updates to fix problem with ceph-cookbooks appearing in chef-server.
John Wilkins [Wed, 25 Jul 2012 22:57:58 +0000 (15:57 -0700)]
doc: updates to fix problem with ceph-cookbooks appearing in chef-server.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>