summaryrefslogtreecommitdiff
path: root/src/mon
Commit message (Collapse)AuthorAgeFilesLines
* mon: Monitor: resolve keyring option to a file before loading keyringJoao Eduardo Luis2012-12-111-1/+7
| | | | | | | | | | | | Otherwise our keyring default location, or any other similarly formatted location, will be taken as the actual location for the keyring and fail. Reported-by: tziOm (at) #ceph Fixes: 3276 Backport: argonaut Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com> (cherry picked from commit 7ef0df25e001bfae303feb3ae36514608767b1f2)
* mon: drop command replies on paxos resetSage Weil2012-10-101-1/+6
| | | | | | | | | | If paxos resets, do not send the reply for the commit we were waiting for; let the command be reprocessed and re-proposed. Among other things, this could lead to nondeterministic results for 'ceph osd create <uuid>'. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: simplify logmonitor check_subs; less noiseSage Weil2012-08-143-27/+34
| | | | | | | | | | | | | * simple helper to translate name to id * verify sub type is valid in caller * assert sub type is valid in method * simplify iterator usage Among other things, this gets rid of this noise in the logs: 2012-07-10 20:51:42.617152 7facb23f1700 1 mon.a@1(peon).log v310 check_sub sub monmap not log type Signed-off-by: Sage Weil <sage@inktank.com>
* MonMap: return error on failure in build_initialJosh Durgin2012-08-101-2/+5
| | | | | | | | | 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>
* mon: make 'ceph osd rm ...' wipe out all state bits, not just EXISTSSage Weil2012-07-261-1/+1
| | | | | | | | This ensures that when a new osd reclaims that id it behaves as if it were really new. Backport: argonaut Signed-off-by: Sage Weil <sage@inktank.com>
* mon: ignore pgtemp messages from down osdsSage Weil2012-07-241-0/+7
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* mon: ignore osd_alive messages from down osdsSage Weil2012-07-241-4/+8
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* mon/MonitorStore: always O_TRUNC when writing statesSage Weil2012-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | It is possible for a .new file to already exist, potentially with a larger size. This would happen if: - we were proposing a different value - we crashed (or were stopped) before it got renamed into place - after restarting, a different value was proposed and accepted. This isn't so unlikely for the log state machine, where we're aggregating random messages. O_TRUNC ensure we avoid getting the tail end of some previous junk. I observed #2593 and found that a logm state value had a larger size on one mon (after slurping) than the others, pointing to put_bl_sn_map(). While we are at it, O_TRUNC put_int() too; the same type of bug is possible there, too. Fixes: #2593 Signed-off-by: Sage Weil <sage@inktank.com>
* mon: initialize quorum_featuresSage Weil2012-07-021-0/+2
| | | | | | | | | | This could cause us to incorrectly encode new features into the monstore that an old mon won't understand. This is overly conservative; we probably need to persist the set of quorum features that are supported and use those. Signed-off-by: Sage Weil <sage@inktank.com>
* osdmap: check new pool name on renameSage Weil2012-06-291-3/+16
| | | | | | | Ensure the new pool name doesn't already exist, both in the current and project map. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: 'osd pool rename <oldname> <newname>'Sage Weil2012-06-292-0/+27
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* mon: MonmapMonitor: Use default port when the specified on 'add' is zeroJoao Eduardo Luis2012-06-271-0/+8
| | | | | | | | | | Fixes a bug triggered by using the ceph tool to 'mon add' with a port set to zero. We now default to the monitor's default port (6789) instead, and we will fail if that port is already assigned to some other monitor. Fixes: bug #2661 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
* mon: don't tick the PaxosServices if we are currently slurping.Greg Farnum2012-06-251-2/+5
| | | | | | They aren't prepared to deal with the on-disk state being inconsistent. Signed-off-by: Greg Farnum <greg@inktank.com>
* mon: encoding new monmap using quorum feature setSage Weil2012-06-211-1/+1
| | | | | | | | It is probably unlikely that someone will expand the mon cluster with a mixed feature set, but we know the quorum features here, so we should use them. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: conditionally encode mon features for remote monSage Weil2012-06-212-3/+17
| | | | | | | The only time we encode these is when forwarding messages. Encoding using the destination's feature set. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: conditionally encode PGMap[::Incremental] with quorum featuresSage Weil2012-06-213-8/+37
| | | | | | | This allows a mon cluster to transition to the new encoding during a rolling upgrade. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: conditionally encode auth incremental with quorum feature bitsSage Weil2012-06-212-3/+17
| | | | | | | | | | | If the quorum does not yet all have the MONENC feature, stick to the old encoding. It might be more polite to require a super-quorum before switching over, and take note so that thereafter we can stick to the new encoding, but that has more moving parts and I'm not sure it's worth the complexity. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: track intersection of quorum member featuresSage Weil2012-06-214-10/+25
| | | | | | | | | | | | When we form a quorum, also note the intersection of the quorum members' feature bits. This will inform decisions about what encodings we use. This is an imperfect strategy because the quorum may change, and we may have a mon with old code join in and not understand what is going on. However, it does ensure that a majority of the members run new code, so in the absence of other failures we can make progress. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: include quorum in ceph statusSage Weil2012-06-181-1/+2
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* mon: gracefully handle slow 'ceph -w' clientsSage Weil2012-06-182-22/+25
| | | | | | | | | | | If we are sending log updates to a client (ceph -w), and they are far enough behind to drop behind first_committed, include a friendly message in their stream but continue. Drop useless return value from _create_sub_incremental(). Assert that we can read the state file. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: allow keys to be cleared in ceph osd crush set ... loc key/valuesSage Weil2012-06-111-1/+4
| | | | | | | | | | | | | | If we encounter a 'key=' with no value, clear any previous value for that key, so that 'a=foo b=bar a=' is equivalent to 'b=bar' Fixes: #2540 Signed-off-by: Sage Weil <sage@inktank.com>
* mon: fix pg state loggingYan, Zheng2012-06-111-6/+6
| | | | | | | | PGMap->num_pg_by_state is a PG state to number of PG in the state mapping. PGMonitor::update_logger wrongly interprets the mapping. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sage@inktank.com>
* mon: add 'auth get-or-create' variant that outputs a keyringSage Weil2012-06-081-4/+20
| | | | | | | | This is more convenient when you're creating daemons, since you want to write out a keyring file for them. This lets you do it in a single command. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: require force argument for 'mds newfs ...'Sage Weil2012-06-081-9/+14
| | | | | | | This is dangerous, make sure they know what they're doing. I bet <someone> $1 that Greg asked me to do this originally. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: use mode 0600 throughoutSage Weil2012-06-071-4/+4
| | | | | Fixes: #2526 Signed-off-by: Sage Weil <sage@inktank.com>
* Merge remote-tracking branch 'gh/mon-auth'Sage Weil2012-06-071-1/+1
|\ | | | | | | Reviewed-by: Greg Farnum <greg@inktank.com>
| * mon: share mon keyring with KeyServerSage Weil2012-06-061-1/+1
| | | | | | | | | | | | | | This will let us authenticate against items in the mon keyring, like the mon. key itself. Signed-off-by: Sage Weil <sage@inktank.com>
* | make everyone use our assert #include and macroSage Weil2012-06-069-9/+17
| | | | | | | | | | | | ...as detected by the previous patch. Signed-off-by: Sage Weil <sage@inktank.com>
* | mon: put cluster log at /var/log/ceph/$cluster.log and/or send to syslogSage Weil2012-06-061-35/+21
|/ | | | | | | | | | | Also, stop breaking it down by event severity on disk. If you want that, use syslog. Fixes: #2497 Backport: dho Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
* monclient: be paranoid/defensive about send_log vs log_client==NULLSage Weil2012-06-061-6/+7
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* mon: include pg acting in health detailSage Weil2012-06-051-0/+1
| | | | | Backport: dho Signed-off-by: Sage Weil <sage@inktank.com>
* mon: include all types of stuck pgs in health detailSage Weil2012-06-051-11/+19
| | | | | | | We were just including the last one, which isn't as helpful. Backport: dho Signed-off-by: Sage Weil <sage@inktank.com>
* monclient: send more log entries when first set is ackedSage Weil2012-06-052-2/+7
| | | | | | | | Immediately send more log messages if we had more when the first set was sent. Otherwise, wait until the next tick to check. This semi-throttles logging based on how much the monitor can handle. Signed-off-by: Sage Weil <sage@inktank.com>
* logclient: not a dispatcherSage Weil2012-06-053-8/+24
| | | | | | | | Let MonClient and Monitor handle delivery of messages. This puts them in control and lets them trigger sending of more messages when we have a bunch queued. Signed-off-by: Sage Weil <sage@inktank.com>
* mon: limit size of each logm paxos eventSage Weil2012-06-052-0/+12
| | | | | | | | | Limit the number of log events we cram into a single paxos event. Fixes: #2518 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com> Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
* mon: clear osd_stat on osd creation/destructionSage Weil2012-06-051-0/+8
| | | | | Reported-by: Vladimir Bashkirtsev <vladimir@bashkirtsev.com> Signed-off-by: Sage Weil <sage@inktank.com>
* paxos: warn on extreme clock skewSage Weil2012-06-021-1/+6
| | | | | | This would have helped us diagnose #2480. Signed-off-by: Sage Weil <sage@inktank.com>
* Merge remote-tracking branch 'gh/wip-admin'Sage Weil2012-06-012-20/+18
|\
| * mon: fix admin socket lock dependencySage Weil2012-05-301-11/+10
| | | | | | | | Signed-off-by: Sage Weil <sage@inktank.com>
| * admin_socket: pass args separatelySage Weil2012-05-302-12/+11
| | | | | | | | | | | | | | | | This avoids making the callback parse off the command portion on their own. It also lets them assert that the command portion is in the set of registered commands. Signed-off-by: Sage Weil <sage@inktank.com>
* | mon: fix slurp latest raceSage Weil2012-06-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible for the latest version to get out in front of the last_committed version: a- start slurping a- slurp a bunch of states, through X a- get them back, write them out b- monitor commits many new states a- slurp latest, X+100 say, but only get some of those states due to the slurp per-message byte limit a- write latest + some (but not all) prior states a- call back into slurp(), update_from_paxos(), trigger assert This fix ensures that we make note of the source's new latest, so that on the next pass through slurp() we will grab any missing states. We *also* explicitly require that we get everything up through what we have stashed, in defense against some future kludging that might only require we nearly (but not completely) in sync before finishing the slurp. Fixes: #2379 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
* | Merge remote-tracking branch 'gh/wip-mon-doc'Sage Weil2012-05-318-148/+1460
|\ \ | |/ |/|
| * mon: add some info on can_mark_out functionJoao Eduardo Luis2012-05-291-0/+10
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: Do some aesthetic reformatting on the Elector class.Joao Eduardo Luis2012-05-291-4/+6
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: add doxygen-format comments to the Elector class.Joao Eduardo Luis2012-05-291-13/+315
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: Do some aesthetic reformatting on the Paxos class.Joao Eduardo Luis2012-05-291-43/+50
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: add doxygen-format comments to the Monitor class.Joao Eduardo Luis2012-05-291-2/+17
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: add doxygen-format comments to the PaxosService class.Joao Eduardo Luis2012-05-292-46/+223
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
| * mon: add doxygen-format comments to the Paxos class.Joao Eduardo Luis2012-05-292-40/+839
| | | | | | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
* | mon: fix reweight_by_utilization waitingSage Weil2012-05-301-4/+11
| | | | | | | | | | | | Propose if we changed something, but not if we don't. Signed-off-by: Sage Weil <sage@newdream.net>