Commit Graph

42931 Commits

Author SHA1 Message Date
Kefu Chai
9d8b6d8532 test: add a test to exercise ceph-monstore-update-crush.sh
Fixes: #11815
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:15:44 +08:00
Kefu Chai
39e25b9779 tools: add ceph-monstore-update-crush.sh
Fixes: #11815
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:15:44 +08:00
Kefu Chai
1bb0cf4327 PendingReleaseNotes: add the notes about osdmaptool
* its '--dump-json' option is replaced by '--dump json'

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:15:44 +08:00
Kefu Chai
ad6e6a1b43 tool/osdmaptool: replace --dump-json with --dump
* --dump will accept a formatter argument.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:14:58 +08:00
Kefu Chai
3063734278 tools/ceph-monstore-tools: add rewrite command
"rewrite" command will
 - add a new osdmap version to update current osdmap held by OSDMonitor
 - add a new paxos version, as a proposal it will
   * rewrite all osdmap epochs from specified epoch to  the last_committed
     one with the specified crush map.
   * add the new osdmap which is added just now
so the leader monitor can trigger a recovery process to apply the transaction
to all monitors in quorum, and hence bring them back to normal after being
injected with a faulty crushmap.

Fixes: #11815
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:14:58 +08:00
Kefu Chai
ab4fa2a3e6 Merge pull request #4807 from dachary/wip-11814-erasure-code-ruleset
mon: validate implicit erasure code crush ruleset

Reviewed-by: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-07-17 18:25:42 +08:00
Yan, Zheng
160053c1e3 Merge pull request #5260 from ceph/wip-12297-readdir
DNM Client: check dir is still complete after dropping locks in _readdir_cache_cb
2015-07-17 09:14:36 +08:00
Sage Weil
69dad39952 doc/release-notes: v9.0.2
Signed-off-by: Sage Weil <sage@redhat.com>
2015-07-16 15:17:51 -04:00
David Zafman
f1157fa4a3 Merge pull request #5268 from dachary/wip-ceph-port
tests: test/cephtool-test-mon.sh uses 7202 7203 and 7204

Reviewed-by: David Zafman <dzafman@redhat.com>
2015-07-16 12:17:34 -07:00
Loic Dachary
921afb61bc Merge pull request #5266 from ceph/wip-ftbfs-cls-cephfs
cls: fix the build on i386

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-07-16 21:02:54 +02:00
Loic Dachary
d23cd132a3 tests: test/cephtool-test-mon.sh uses 7202 7203 and 7204
When running 3 mons, vstart uses ports starting from CEPH_PORT=7202 and
increments to 7203 for the second mon and 7204 for the third. Add a
comment showing the port number. The method for a test to figure out
which port is free is to grep for the port and if nothing matches, use
it. The grep will match 7204 and 7203 and 7202 from the comment and
reduce the chances of someone using 7203 because it was nowhere to be
found in the sources.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-07-16 20:58:29 +02:00
Joao Eduardo Luis
94d40ca996 Merge branch 'wip-10507'
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-07-16 18:40:57 +01:00
Joao Eduardo Luis
f2e240ab8e messages: MForward: get() message reference
Don't simply put() a reference if it has gone unclaimed without
get()'ing it first. This can cause nefarious consequences for those
users of MForward that do not expect this to happen.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:23 +01:00
Joao Eduardo Luis
7e543601e6 mon: MonOpRequest: dump function as private
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:23 +01:00
Joao Eduardo Luis
c45e0cfba9 mon: services: assert on unexpected op request type
Ensures some type safety by asserting on the request type.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:23 +01:00
Joao Eduardo Luis
9cee74bcdb mon: Monitor: set op request type during dispatch
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:23 +01:00
Joao Eduardo Luis
b5701553fc mon: MonOpRequest: allow setting the op type
When we introduced the MonOpRequest in the monitor and moved pretty much
every single function receiving messages in their arguments to take op
requests, we basically lost the type safety that was guaranteed from
Monitor::dispatch().

This patch adds an op_type field to the op request, as an easy fix for
this now lacking safety.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:23 +01:00
Joao Eduardo Luis
1b39f7d263 mon: Monitor: drop PaxoServiceMessage reply functions
The services are now fully using MonOpRequest and should stay that way.
Drop PaxosService-specific reply functions as we want nothing to do with
them :)

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
dce78ee124 mon: MDSMonitor: use op-related no_reply()
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
4c880a5d5f mon: OSDMonitor: use op requests when sending out full/incrementals
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
7ed9fbf285 mon: OSDMonitor: move failure code to support op requests
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
cb6c913159 mon: Monitor: have op-related no_reply()
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
7797fcadda mon: MonOpRequest: send_reply() belongs in the Monitor class
Op Requests should have no business replying to messages. Besides,
given the Monitor is currently the place to do this, because it is the
one with access to all things that may be required to validate state
(e.g., quorum features), permanently moving this code to the Monitor
class also avoid having duplicate/very similar code in two distinct
places.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
0633354049 mon: Monitor: routed requests handling op requests
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
39851dfe8a mon: Monitor: forward_request_leader() taking ops instead
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
2ebbab9e75 mon: Monitor: drop reply_command(MMonCommand *m,...)
Monitor commands are now op requests; always use ops when replying to
commands.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
b3bce04169 mon: use op's get_session() instead of getting from connection
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Joao Eduardo Luis
9ba818f98d mon: services: use op-based reply_command()
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:31:22 +01:00
Kefu Chai
1213dde3d2 cls: fix the build on i386
this is a leftover of 0dae022

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 01:12:04 +08:00
Joao Eduardo Luis
65b5144ad7 mon: Monitor: reply_command() wrapper for ops
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
1564b6ccc5 mon: Paxos: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
98e470a178 mon: Monitor: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
427cef86f7 mon: PaxosService: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
696c2ec5c8 mon: MonOpRequest: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
4e76d59e89 mon: services: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
2179b4d34c mon: services: use mon->send_reply(op,...) instead
We are replying to operations, not messages, so use the appropriate
function to do so (and mark events).

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
677372d8d8 mon: PaxosService: use wait_for_.*_ctx() in absence of an op
The vast majority of cases use PaxosService's wait_for_{state}()
functions to wait on given {state} before waking up a given op-related
callback.  E.g., to reply to a command once a proposal finishes.

However, there are a few cases[1] in which the callback waiting for the
state change does not map to an op.

To maintain compatibility, we were keeping the functions just taking a
callback and no op with the same name as those taking ops (because c++
is amazing that way), but we realized that developers could keep on
using these functions just as before, disregarding the fact that they
likely want to use the version taking the op.  As such, this patch
changes the name of the function taking only the callback, such that it
is used solely when the developer really wants to take just the
callback.

[1] at time of this patch, only three calls were being made that would
use only a callback.  Out of over one hundred calls using ops.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:08 +01:00
Joao Eduardo Luis
d240a76d44 mon: services: use op-based wait_for_* functions
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
b9e6696c09 mon: PaxosService: have wait_for_* functions requiring an op
Basically, so we can mark the op accordinly; we'll leave context-only
functions to maintain compatibility with other users of these functions
that do not use them for op-related callbacks.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
2c83e1e2b0 mon: Paxos: have wait_for_* functions requiring ops
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
5ca13692bb mon: PGMonitor: implement C_MonOp on op-related callback contexts
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
903e219ece mon: OSDMonitor: implement C_MonOp on op-related callback contexts
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
fff540d40c mon: LogMonitor: implements C_MonOp on op-related callback contexts
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
ed7e89a096 mon: PaxosService: implement C_MonOp on op-related callback contexts
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
61f7dcaf76 mon: Monitor: implement C_MonOp on op-related callback contexts
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for some
reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
7e1c8c9f72 mon/mon_types.h: add C_MonOp abstract class
To be used by monitor contexts relying on MonOpRequest, so that we can
easily track the lifespan of an event.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
c80bb614c6 mon: Monitor: mark events
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
91457df745 mon: MonOpRequest: change service names in mark_*_event()
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
176d7969bc mon: MonOpRequest: add service-specific 'mark event' functions
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00
Joao Eduardo Luis
e28e5ec363 mon: MonOpRequest: add mark event functions
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:07 +01:00