When a given log level L was specified, we would reply with all the
messages of "level L and below"; for instance, for a 'log-error' we would
present all the messages of level 'error', 'warn', 'sec', 'info' and
'debug'.
We shouldn't be doing it that way, so we just inverted the filter
condition. Now we show only 'L and above'; i.e., for a log level of
'log-warn', show only 'log-warn' and 'log-error'.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src: get rid of the Observers throughout the code base.
This is a big patch that will remove all references to the observers
throughout the code, including a complete removal of the Observer-related
messages' source files.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
We reworked the code a bit to accommodate the introduction for the log
monitor's publish/subscribe mechanisms. With this patch we no longer
depend on the observer's, and use instead the much broader approach of
subscribing to events. In our case, we will subscribe to log levels.
If the '-w'/'--watch' flag is defined, the tool will be subscribed to the
'log-info' level by default, unless one of the following flags are defined
(in which case the level will be changed accordingly): '--watch-debug',
'--watch-info', '--watch-sec', '--watch-warn' and '--watch-error'.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Add publish/subscribe capabilities to the log monitor and status cmd.
This patch allows us to stir away from the monitor's observer mechanism,
by using instead the already existing publish/subscribe mechanism.
We follow the log levels used by the log monitor, and will recognize any
one of the following subscriptions: 'log-error' (higher priority),
'log-warn', 'log-sec', 'log-info' and 'log-debug' (lowest priority).
Also, add a new 'status' command to the monitor, which may be invoked by
any client (such as the ceph tool), and which shall return the status of
the various cluster components (osdmap, pgmap, ...).
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Josh Durgin [Wed, 16 May 2012 19:41:27 +0000 (12:41 -0700)]
librbd: check for cache flush errors
Return errors from flushing to the caller. Warn
if an error occurs during invalidation, but don't retry,
since the higher level handles these cases, namely:
* rollback (doing this with an image open is asking for trouble)
* shrink (doing this with writes in flight may create extra objects anyway)
* shutdown (qemu flushes before closing the device)
Josh Durgin [Tue, 15 May 2012 22:21:50 +0000 (15:21 -0700)]
ObjectCacher: handle write errors
If a write error occurs, mark the BufferHead dirty again, and
pass the return value to the completion. This makes flushing
return the write error, if one occurs, since the flush callback
is passed as the write callback.
Josh Durgin [Tue, 15 May 2012 17:58:59 +0000 (10:58 -0700)]
ObjectCacher: propagate read errors to the caller
Previously the return value of a read operation was ignored. Now a
read error sets the error field, and changes the BufferHead to a new
error state. Error state BufferHeads are treated as misses so they can
be retried when requested by a user of the ObjectCacher. When _readx
is called again internally, they're treated as hits so the error can
be returned to the user.
The error value is ignored if the BufferHead is not in the error
state.
Sage Weil [Wed, 16 May 2012 22:37:34 +0000 (15:37 -0700)]
mon: fix mon removal check
Only take our absence from the monmap to mean that we were removed if we
were ever a member in the first places.
This fixes the bootstrap case:
- create temp_monmap with existing member(s) plus new guy
- ceph-mon --mkfs --monmap temp_monmap --fsid ...
- start ceph-mon
Basically, this is just using the seed monmap as a way to tell the new
daemon which ip:port to use. Specifying mon addr, public network, or
public addr would also work.
Fixes: #2436 Signed-off-by: Sage Weil <sage@inktank.com>
Josh Durgin [Wed, 16 May 2012 20:40:43 +0000 (13:40 -0700)]
ObjectCacher: only perfcount reads requested by the client
_readx is called again after each bh is read by C_RetryRead. This
resulted in the read being counted many times for the internal
caller that was just checking whether it was done yet.
Sage Weil [Tue, 15 May 2012 04:01:58 +0000 (21:01 -0700)]
monmap: use feature bits and single encode() method
Instead of selecting an encode method in the caller, use a normal features
argument to encode() and branch there.
Leave behavior of all callers untouched. We continue to assume, for
example, that all monitors have the same features, and that
'ceph mon getmap' should return the fully-featured encoding.
Josh Durgin [Mon, 14 May 2012 18:49:49 +0000 (11:49 -0700)]
Objecter: don't throttle resent linger ops
Throttling is intended to stop the caller from submitting too many
requests, not blocking requests that are being resent internally. This
prevents a deadlock when handling an osdmap - previously
handle_osd_map could block when resending linger ops due to the
throttling. This would stop the messenger's dispatch thread from
delivering any subsequest messages, so the throttle budget would never
be replenished.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Sage Weil [Tue, 8 May 2012 23:30:26 +0000 (16:30 -0700)]
mon: use external keyring for mon->mon auth
- Feed our keyring into the auth methods.
- Do not fail to build a ticket for type MON when we don't have a cap; it
won't be in the auth database. Also, we don't have caps on the monitors
that are enfoced between each other.
Sage Weil [Tue, 15 May 2012 03:13:40 +0000 (20:13 -0700)]
mon: keep mon. secret in an external keyring
- Keep the mon. key in a separate keyring files, "keyring", in the mon
data dir.
- During init, if we don't find that file, copy the key from the keyserver
database.
- During mkfs, put the mon. key in that file, and remove it from the seed
file that primes the auth database.
This will allow admins to change the mon. key without bringing the cluster
online and doing something wonky.
Sage Weil [Sat, 12 May 2012 21:59:55 +0000 (14:59 -0700)]
crush: pass weight vector size to map function
Pass the size of the weight vector into crush_do_rule() to ensure that we
don't access values past the end. This can happen if the caller misbehaves
and passes a weight vector that is smaller than max_devices.
Currently the monitor tries to prevent that from happening, but this will
gracefully tolerate previous bad osdmaps that got into this state. It's
also a bit more defensive.
Sage Weil [Tue, 8 May 2012 23:24:12 +0000 (16:24 -0700)]
keyring: make child of KeyStore
This lets us pass a keyring to the auth methods as a source for keys for
doing the authentication handshaking. Normally we pass a RotatatingKeyring
or the KeyServer, but for mon->mon we don't use a service key. This will
let us use a simple KeyRing for that.
workloadgen: forcing the user to specify a data and journal.
These default arguments, although handy when we just want to run the test,
just mess things up when we don't actually need them. If we don't specify
them on the CLI, we'll end up using the default ones, and that is just
annoying.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
workloadgen: Allow finer control over what the generator does.
Allow the user to have more control on:
- the sizes of the data being written by the operations;
- which operations are suppressed from execution;
- view the throughput;
- specify the periodicity of throughput output.
For the CLI options, '--help' should suffice.
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
Sage Weil [Sun, 6 May 2012 21:18:22 +0000 (14:18 -0700)]
osd: reset last_peering_interval on replica activate
There was a silent bug in the activate 'acks' that go from the replica back
to the primary. Prior to 86aa07d7a91ac23074e76551c3a6db3a5736cffa, we
were passing same_interval_since to the callback, which mean that
sometimes _activate_committed() would ignore it and we wouldn't update
last_epoch_started. This was mosty invisible; the next peering event would
just, in some cases, look at more past intervals than it needed to.
In 86aa07d7a91ac23074e76551c3a6db3a5736cffa we fixed this so that the check
is correct. (We noticed because now we aren't setting the pg CLEAN flag
until after last_epoch_started is updated.) That, in turn, revealed a
similar bug that we're fixing here: the replica's last_peering_reset could
be lower than the primary's, such that the activate 'ack' info is ignored.
To fix this, simply set last_peering_reset to the current epoch when the
replica activates; this will always be greater than the primary's.