Commit Graph

43148 Commits

Author SHA1 Message Date
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
Joao Eduardo Luis
7d90cb12b8 mon: Monitor: add admin socket command 'ops'
Dumps currently in-flight ops in the monitor

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:06:02 +01:00
Joao Eduardo Luis
19dac5fbab mon: MonOpRequest: add dump function
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 18:03:39 +01:00
Joao Eduardo Luis
df9486bcc7 mon: Monitor: have reply functions for op requests
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 18:03:39 +01:00
Joao Eduardo Luis
53bd1ba510 mon: MonOpRequest: add 'send_reply()' function
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 18:03:39 +01:00
Joao Eduardo Luis
5420fdbd84 mon: optracker (3): remove unecessary message variables
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 18:03:39 +01:00
Joao Eduardo Luis
2526347515 mon: optracker (2): remove all unecessary message put()
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 18:03:39 +01:00
Joao Eduardo Luis
c713d9a632 mon: optracker (1): support MonOpRequestRef
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 18:03:35 +01:00
Greg Farnum
62dd637617 Client: check dir is still complete after dropping locks in _readdir_cache_cb
We drop the lock when invoking the callback, which means the directory
we're looking at might get dentries trimmed out of memory. Make sure that
hasn't happened after we get the lock back. If it *has* happened, fall back
to requesting the directory contents from the MDS. Update the dirp location
pointers after each entry to facilitate this.
Because this requires we update the dirp->at_cache_name value on every loop,
we rework the updating scheme a bit: to dereference the dn->name before
unlocking, so we know it's filled in; and since we update it on every loop
we don't need to refer to the previous dentry explicitly like we did before.

This should also handle racing file deletes: we get back a trace on
the removed dentry and that will clear the COMPLETE|ORDERED flags.

Fixes #12297

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2015-07-16 09:24:56 -07:00
Loic Dachary
f1e86be589 mon: test the crush ruleset when creating a pool
We want to fix the following scenario:

 * an erasure code plugin (or another part of the code) creates a
   ruleset
 * the ruleset crashes during mapping (for whatever reason)
 * ceph osd pool create uses the bugous ruleset
 * the monitors try to do mapping a crash

Having a bugous ruleset in the crush map is very difficult prevent. The
catastrophic event of using it with a newly created pool can however be
prevented by calling the CrushTester just before creating the pool and
after all implicit or explicit crush ruleset creation happened.

http://tracker.ceph.com/issues/11814 Fixes: #11814

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-07-16 18:16:27 +02:00
Joao Eduardo Luis
203cb6ad45 mon: MonOpRequest: have the monitor dealing with operations
Deal with op requests throughout the monitor state machine, instead of
Messages.  These op requests implement TrackedOp, which will be
trackable by the monitor via a OpTracker.  This will allow us to follow
the operation's life cycle, for the duration of any given operation.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 17:08:39 +01:00
Joao Eduardo Luis
2731b19aec messages: MForward: pack a bufferlist instead of a message
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-07-16 17:08:39 +01:00
Sage Weil
2746f59da4 Merge remote-tracking branch 'gh/next' 2015-07-16 12:03:58 -04:00
Loic Dachary
a44499f7e6 erasure-code: set max_size to chunk_count() instead of 20 for shec
See 8b64fe93b0 for a detailed explanation.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-07-16 18:01:31 +02:00
Joao Eduardo Luis
c2d6e3d666 Merge branch 'wip-mon-scrub'
Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-16 16:46:32 +01:00
Joao Eduardo Luis
f735a9905c Merge branch 'wip-11786'
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-16 16:44:22 +01:00
Joao Eduardo Luis
0ea794c96a Merge branch 'wip-11470'
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-16 16:21:18 +01:00
Joao Eduardo Luis
1551ebb632 mon: PaxosService: call post_refresh() instead of post_paxos_update()
Whenever the monitor finishes committing a proposal, we call
Monitor::refresh_from_paxos() to nudge the services to refresh.  Once
all services have refreshed, we would then call each services
post_paxos_update().

However, due to an unfortunate, non-critical bug, some services (mainly
the LogMonitor) could have messages pending in their
'waiting_for_finished_proposal' callback queue [1], and we need to nudge
those callbacks.

This patch adds a new step during the refresh phase: instead of calling
directly the service's post_paxos_update(), we introduce a
PaxosService::post_refresh() which will call the services
post_paxos_update() function first and then nudge those callbacks when
appropriate.

[1] - Given the monitor will send MLog messages to itself, and given the
service is not readable before its initial state is proposed and
committed, some of the initial MLog's would be stuck waiting for the
proposal to finish.  However, by design, we only nudge those message's
callbacks when an election finishes or, if the leader, when the proposal
finishes.  On peons, however, we would only nudge those callbacks if an
election happened to be triggered, hence the need for an alternate path
to retry any message waiting for the initial proposal to finish.

Fixes: #11470

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 16:20:41 +01:00
Joao Eduardo Luis
b207d87ebf Merge branch 'wip-11545'
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Loic Dachary <ldachary@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-07-16 16:07:11 +01:00
Sage Weil
5d299612e5 Merge pull request #5251 from ceph/wip-12021-next
OSDMonitor: allow addition of cache pool with non-empty snaps with co…

Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-16 11:05:04 -04:00
Sage Weil
edd68e3ade Merge pull request #5188 from athanatos/wip-11687
PG::find_best_info: ignore info.les for incomplete peer

Reviewed-by: Sage Weil <sage@redhat.com>
2015-07-16 11:03:18 -04:00
Joao Eduardo Luis
038452e70f mon: Monitor: use 'ceph mon metadata' instead of 'ceph mon_metadata'
'ceph mon_metadata' was added still during this dev cycle, so there is
no need to deprecate it first.

Fixes: #11545

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
2015-07-16 15:54:03 +01:00
Nathan Cutler
f3f8d3660d ceph.spec.in: remove SUSE-specific apache2-mod_fcgid dependency
This package is no longer required for RGW to work in SUSE.

http://tracker.ceph.com/issues/12358 Fixes: #12358

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-07-16 16:49:42 +02:00