]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
13 years agoosd: only generate missing intervals in generate_past_intervals
Sage Weil [Fri, 27 Apr 2012 23:01:43 +0000 (16:01 -0700)]
osd: only generate missing intervals in generate_past_intervals

We can (currently) get into a situation where we don't have the full
history back to last_epoch_clean because non-primaries record past
intervals but don't initially have the full history, resulting in a partial
recent history.

If this happens, only fill in what's missing; no need to rebuild the recent
parts too.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: include past_intervals in pg debug printout
Sage Weil [Fri, 27 Apr 2012 22:16:23 +0000 (15:16 -0700)]
osd: include past_intervals in pg debug printout

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: fix check for whether to recalculate past_intervals
Sage Weil [Fri, 27 Apr 2012 21:30:17 +0000 (14:30 -0700)]
osd: fix check for whether to recalculate past_intervals

We may not recalculate all the way back to last_interval_clean due to
the oldest_map floor.  Figure out what we want and could calculate before
deciding whether what we have is insufficient.

Also, print something if we discard and recalculate so it is clear what is
happening and why.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: PG::Interval -> pg_interval_t
Sage Weil [Fri, 27 Apr 2012 16:51:30 +0000 (09:51 -0700)]
osd: PG::Interval -> pg_interval_t

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoMerge branch 'next' into t
Sage Weil [Sat, 28 Apr 2012 14:46:23 +0000 (07:46 -0700)]
Merge branch 'next' into t

13 years agoStop rebuild of libcommon.la on "make dist"
Dan Mick [Sat, 28 Apr 2012 01:04:34 +0000 (18:04 -0700)]
Stop rebuild of libcommon.la on "make dist"

Fixes: 2356
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agomon: limit size of MOSDMap message sent as reply
Sage Weil [Fri, 27 Apr 2012 04:29:53 +0000 (21:29 -0700)]
mon: limit size of MOSDMap message sent as reply

We may send an MOSDMap as a reply to various requests, including

 - a failure report
 - a boot message
 - a pg_temp message
 - an up_thru message

In these cases, send a single MOSDMap message, but limit how big it gets.
All recipients here are osds, which are smart enough to request more maps
based on the MOSDMap::newest_map field.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoceph-object-corpus: revert rewind
Sage Weil [Sat, 28 Apr 2012 14:45:24 +0000 (07:45 -0700)]
ceph-object-corpus: revert rewind

From 92becb696bde7f0aa9687b2fe7505ed1ac9f493b

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: fix addr dedup check
Sage Weil [Sat, 28 Apr 2012 03:54:50 +0000 (20:54 -0700)]
osdmap: fix addr dedup check

Compare *every* address for a match, or else note that it is (or might be)
different.  Previously, we falsely took diff==0 to mean that all addrs
were definitely equal, which was not necessarily the case.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoOSD: use map bl cache pinning during handle_osd_map
Samuel Just [Fri, 27 Apr 2012 17:00:36 +0000 (10:00 -0700)]
OSD: use map bl cache pinning during handle_osd_map

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agosimple_cache.hpp: add pinning
Samuel Just [Fri, 27 Apr 2012 17:00:08 +0000 (10:00 -0700)]
simple_cache.hpp: add pinning

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoFileJournal: simply flush by waiting for completions to empty
Samuel Just [Fri, 27 Apr 2012 04:29:45 +0000 (21:29 -0700)]
FileJournal: simply flush by waiting for completions to empty

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoPG: in GetInfo Notify handler, fix peer_info_requested filter
Samuel Just [Fri, 27 Apr 2012 18:25:19 +0000 (11:25 -0700)]
PG: in GetInfo Notify handler, fix peer_info_requested filter

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agolibrados: test get/set of debug levels
Sage Weil [Fri, 27 Apr 2012 04:51:55 +0000 (21:51 -0700)]
librados: test get/set of debug levels

Also do some sanity checks on the subsystem log level settings.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoconfig: allow {get,set}_val on subsystem debug levels
Sage Weil [Fri, 27 Apr 2012 04:51:23 +0000 (21:51 -0700)]
config: allow {get,set}_val on subsystem debug levels

This mimics the allows you to get and set subsystem debug levels via the
normal config access methods.  Among other things, this allows librados
users to set debug levels.

Fixes: #2350
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoOSD.cc: track osdmap refs using an LRU
Samuel Just [Fri, 27 Apr 2012 00:58:59 +0000 (17:58 -0700)]
OSD.cc: track osdmap refs using an LRU

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agocommon/: added templated simple lru implementations
Samuel Just [Wed, 25 Apr 2012 23:58:33 +0000 (16:58 -0700)]
common/: added templated simple lru implementations

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoosdmap: dedup pg_temp
Sage Weil [Thu, 26 Apr 2012 18:12:11 +0000 (11:12 -0700)]
osdmap: dedup pg_temp

We only deal with the case where the entire map is identical, since the
individual items are too small to make the pointer overhead worthwhile.
Too bad.  A in-memory btree-like structure would work better for this.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: use shared_ptr<> for pg_temp
Sage Weil [Thu, 26 Apr 2012 18:01:06 +0000 (11:01 -0700)]
osdmap: use shared_ptr<> for pg_temp

This will let us dedup later.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: make map dedup optional
Sage Weil [Thu, 26 Apr 2012 22:50:27 +0000 (15:50 -0700)]
osd: make map dedup optional

On by default.  This trades CPU for memory.  Some might have unlimited RAM
and not care.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: dedup osdmaps when added to the in-memory cache
Sage Weil [Wed, 25 Apr 2012 23:40:11 +0000 (16:40 -0700)]
osd: dedup osdmaps when added to the in-memory cache

When we add an OSDMap to our in-memory cache, dedup against an existing map
at a nearby epoch.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: drop obsolete PG_ROLE_* constants
Sage Weil [Wed, 25 Apr 2012 23:22:14 +0000 (16:22 -0700)]
osdmap: drop obsolete PG_ROLE_* constants

There are cruft from the old primary/chain/splay replication code.  All
current code says <0 is stray, 0 is primary, and >0 is replica.  That is,
the role is the acting vector position, or -1 if not in the vector.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agobuffer: make contents_equal() more efficient
Sage Weil [Wed, 25 Apr 2012 23:10:30 +0000 (16:10 -0700)]
buffer: make contents_equal() more efficient

Iterate both lists in parallel in terms of buffers, and use memcmp() to
do the comparison.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: dedup crush map
Sage Weil [Wed, 25 Apr 2012 23:01:32 +0000 (16:01 -0700)]
osdmap: dedup crush map

If the encoded crush map is identical between two versions, share the
reference.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: use shared_ptr for CrushWrapper
Sage Weil [Wed, 25 Apr 2012 22:59:24 +0000 (15:59 -0700)]
osdmap: use shared_ptr for CrushWrapper

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmaptool: kludge to load a range of maps into memory
Sage Weil [Wed, 25 Apr 2012 22:44:24 +0000 (15:44 -0700)]
osdmaptool: kludge to load a range of maps into memory

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: dedup addrs and addr vectors between maps
Sage Weil [Wed, 25 Apr 2012 22:44:06 +0000 (15:44 -0700)]
osdmap: dedup addrs and addr vectors between maps

Compare two maps.  If an addrs matches, share the reference.  If all
addrs match, share the entire vector.

This leads to roughly 70% drop in memory utilization for the set of
thrashed maps I'm working with.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agolibrbd: the length argument of aio_discard should be uint64_t
Josh Durgin [Fri, 27 Apr 2012 00:41:27 +0000 (17:41 -0700)]
librbd: the length argument of aio_discard should be uint64_t

size_t was accidentally copy-pasted.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agofilestore: interprect any fiemap error as EOPNOTSUPP
Sage Weil [Fri, 27 Apr 2012 00:17:32 +0000 (17:17 -0700)]
filestore: interprect any fiemap error as EOPNOTSUPP

On 2.6.32-5-amd64 (debian) and XFS I'm getting EINVAL.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: use shared_ptr for addrs, addr vectors
Sage Weil [Wed, 25 Apr 2012 22:10:34 +0000 (15:10 -0700)]
osdmap: use shared_ptr for addrs, addr vectors

We share a lot of identical addresses between map versions because they
don't tend to change very often.  Instead of having a separate copy for
every map, use shared_ptr and share references.  Also use a reference for
the entire addr vector(s) in case no addrs differ at all.

Create new encode/decode macros for vector< shared_ptr<T> >.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosdmap: uninline a bunch of stuff
Sage Weil [Wed, 25 Apr 2012 21:55:18 +0000 (14:55 -0700)]
osdmap: uninline a bunch of stuff

This will conflict with wip-lpg, yay.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: consider pending_inc in {up,in}_ratio for can_mark_{out,down}()
Sage Weil [Thu, 26 Apr 2012 23:45:56 +0000 (16:45 -0700)]
mon: consider pending_inc in {up,in}_ratio for can_mark_{out,down}()

Consider pending changes when calculating the current up/in ratios.  Among
other things, this will make the marking of osds down->out stop once it
hits the min in ratio.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: thrash pg_temp mapping, too
Sage Weil [Wed, 25 Apr 2012 20:25:30 +0000 (13:25 -0700)]
mon: thrash pg_temp mapping, too

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agofilestore: fix a journal replay issue with collection_add()
Joao Eduardo Luis [Thu, 26 Apr 2012 23:31:55 +0000 (00:31 +0100)]
filestore: fix a journal replay issue with collection_add()

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
13 years agoosd: filter osds removed from probe set from peer_info_requested
Sage Weil [Wed, 25 Apr 2012 20:07:34 +0000 (13:07 -0700)]
osd: filter osds removed from probe set from peer_info_requested

Peef_info_requested should be a strict subset of the probe set.  Filter
osds that are dropped from probe from peer_info_requested.  We could also
restart peering from scratch here, but this is less expensive, because we
don't have to re-probe everyone.

Once we adjust the probe and peer_info_requested sets, (re)check if we're
done: we may have been blocedk on a previous peer_info_requested entry.

The situation I saw was:

  "recovery_state": [
        { "name": "Started\/Primary\/Peering\/GetInfo",
          "enter_time": "2012-04-25 14:39:56.905748",
          "requested_info_from": [
                { "osd": 193}]},
        { "name": "Started\/Primary\/Peering",
          "enter_time": "2012-04-25 14:39:56.905748",
          "probing_osds": [
                79,
                191,
                195],
          "down_osds_we_would_probe": [],
          "peering_blocked_by": []},
        { "name": "Started",
          "enter_time": "2012-04-25 14:39:56.905742"}]}

Once in this state, cycling osd.193 doesn't help, because the prior_set
is not affected.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoPG: get_infos() should not post GotInfo
Samuel Just [Thu, 26 Apr 2012 22:44:21 +0000 (15:44 -0700)]
PG: get_infos() should not post GotInfo

The MNotifyRec handler also posts GotInfo under the same conditions
after calling get_infos().

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoRevert "PG: whitelist MNotifyRec in started"
Samuel Just [Thu, 26 Apr 2012 22:38:42 +0000 (15:38 -0700)]
Revert "PG: whitelist MNotifyRec in started"

This reverts commit 9579365720818125a4b15741ae65e58948b9c69f.

13 years agoPG: whitelist MNotifyRec in started
Samuel Just [Thu, 26 Apr 2012 17:39:04 +0000 (10:39 -0700)]
PG: whitelist MNotifyRec in started

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agomon: 'osd thrash <num epochs>'
Sage Weil [Wed, 25 Apr 2012 16:23:49 +0000 (09:23 -0700)]
mon: 'osd thrash <num epochs>'

Thrash the osdmap for N iterations.  Randomly mark OSDs up, down, in, out,
and up_thru in order to generate a difficult osdmap history for peering
to chew through.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: add 'mon osd min up ratio' and 'mon osd min in ratio'
Sage Weil [Wed, 25 Apr 2012 00:21:27 +0000 (17:21 -0700)]
mon: add 'mon osd min up ratio' and 'mon osd min in ratio'

Prevent the monitor from marking osds down or out when too many are already
in that state.  At this point the cluster is already broken and there is
little point in continuing to mark things down/out.

Setting these to 0 obviously disables the feature (by setting a minimum
of 0).

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: use can_mark_*() helpers
Sage Weil [Wed, 25 Apr 2012 18:15:34 +0000 (11:15 -0700)]
mon: use can_mark_*() helpers

So we can generalize beyond NO* flags.  We'll soon be adding other reasons
to not mark things up/down/in/out.  This lets us keep all though checks in
one place.

The helper methods will tell us why we can't do the thing (e.g., "NODOWN
flag is set").  The callers will generally tell us exactly what didn't
happen (e.g., "failure report of X ignored").

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: decode old PGMap Incrementals differently from new ones
Greg Farnum [Tue, 24 Apr 2012 22:13:02 +0000 (15:13 -0700)]
mon: decode old PGMap Incrementals differently from new ones

We need to distinguish between the old 0 (meaning undefined) and
the new 0 (meaning switch to 0 and disable the flags). So rev the
encoding version on PGMap::Incremental, and if you decode an old
version with [near]full_ratio == 0, set the ratio to -1 instead. Then
when applying the Incremental interpret -1 as no change.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Reviewed-by: Sage Weil <sage@newdream.net>
13 years agomon: do not mark osds out if NOOUT flag is set
Sage Weil [Tue, 24 Apr 2012 22:46:49 +0000 (15:46 -0700)]
mon: do not mark osds out if NOOUT flag is set

Do not mark down osds out when NOOUT flag is set.  This is more or less
equivalent to setting a very long 'mon osd down out interval', but
reversible and less annoying.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: do not mark booting osds in if NOIN flag is set
Sage Weil [Tue, 24 Apr 2012 22:45:58 +0000 (15:45 -0700)]
mon: do not mark booting osds in if NOIN flag is set

If the NOIN osdmap flag is set, do not mark booting osds in.  Normally
we would for a range of reasons (always, new, auto-marked-out), but block
them all.

Do not limit manual 'ceph osd in N' commands.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: always remove booting osds from down_pending_out
Sage Weil [Tue, 24 Apr 2012 22:28:36 +0000 (15:28 -0700)]
mon: always remove booting osds from down_pending_out

The down_pending_out tracks OSDs that are down that we may want to
auto-mark out.  If an osd boots, it should be removed from this list
because it is no longer down; it doesn't matter whether it is marked in
or not.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: prevent osd mark-down with NODOWN flag
Sage Weil [Tue, 24 Apr 2012 21:28:18 +0000 (14:28 -0700)]
mon: prevent osd mark-down with NODOWN flag

If the NODOWN osdmap flag is set,

 - ignore osd failure reports
 - do not mark osds down due to lack of osd/pg stats

We *do* still allow explicit admin 'ceph osd down N' commands, and a
booting OSD to mark the previous instance of itself down.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoosd: do not attempt to boot if NOUP
Sage Weil [Tue, 24 Apr 2012 21:22:10 +0000 (14:22 -0700)]
osd: do not attempt to boot if NOUP

If NOUP is set, do not send the boot message.

We already send onetime subscriptions to the osdmap, so we will find out
about osdmap flag changes.  If it is cleared later, we'll pass into
start_boot() and _got_boot_version() again and send it then.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: prevent osd from booting if NOUP
Sage Weil [Tue, 24 Apr 2012 21:16:42 +0000 (14:16 -0700)]
mon: prevent osd from booting if NOUP

Do not add an osd attempting to boot to the map if NOUP is sent.  Instead,
send it the latest osdmap so it knows that it's not allowed to boot.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: 'osd {set,unset} {noin,noout,noup,nodown}'
Sage Weil [Tue, 24 Apr 2012 03:33:48 +0000 (20:33 -0700)]
mon: 'osd {set,unset} {noin,noout,noup,nodown}'

Move the set/unset flag code into a helper, and also use that for the
pause/unpause commands.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoosdmap: add NOUP, NODOWN, NOIN, NOOUT flags
Sage Weil [Tue, 24 Apr 2012 03:30:14 +0000 (20:30 -0700)]
osdmap: add NOUP, NODOWN, NOIN, NOOUT flags

These prevent OSDs from being marked up, down, in, or out, respectively.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge remote branch 'origin/wip-rbd-snapid' into next
Josh Durgin [Tue, 24 Apr 2012 20:58:56 +0000 (13:58 -0700)]
Merge remote branch 'origin/wip-rbd-snapid' into next

Reviewed-by: Sage Weil <sage.weil@dreamhost.com>
13 years agolibrbd: pass errors removing head back to user
Sage Weil [Tue, 24 Apr 2012 16:43:44 +0000 (09:43 -0700)]
librbd: pass errors removing head back to user

In particular, the OSD may return EBUSY if there are still watchers.
Ignore ENOENT, as that may indicate we are cleaning up a previously
aborted removal.

Fixes: #2311
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomon: clean up handle_osd_timeouts a bit
Sage Weil [Tue, 24 Apr 2012 16:59:34 +0000 (09:59 -0700)]
mon: clean up handle_osd_timeouts a bit

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agomon: fix pg stats timeout
Sage Weil [Tue, 24 Apr 2012 17:55:18 +0000 (10:55 -0700)]
mon: fix pg stats timeout

We clear out the osd entry when an osd goes up or down.  Thus, if we find
it missing from an up osd, we should start the timer.  Otherwise we get
behavior like this

2012-04-24 13:22:47.888291 7fa5bc587700 mon.peon5752@0(leader).osd e21633 OSDMonitor::handle_osd_timeouts: never got MOSDPGStat info from osd 521. Marking down!
2012-04-24 13:22:50.076394 7fa5bcd88700 log [INF] : osd.521 [2607:f298:4:2243::7088]:6806/53217 boot
2012-04-24 13:22:52.903558 7fa5bc587700 mon.peon5752@0(leader).osd e21638 OSDMonitor::handle_osd_timeouts: never got MOSDPGStat info from osd 521. Marking down!
2012-04-24 13:23:15.144532 7fa5bcd88700 log [INF] : osd.521 [2607:f298:4:2243::7088]:6806/53217 boot
2012-04-24 13:23:17.967118 7fa5bc587700 mon.peon5752@0(leader).osd e21663 OSDMonitor::handle_osd_timeouts: never got MOSDPGStat info from osd 521. Marking down!
2012-04-24 13:23:22.173778 7fa5bcd88700 log [INF] : osd.521 [2607:f298:4:2243::7088]:6806/53217 boot
2012-04-24 13:23:22.981556 7fa5bc587700 mon.peon5752@0(leader).osd e21668 OSDMonitor::handle_osd_timeouts: never got MOSDPGStat info from osd 521. Marking down!
2012-04-24 13:23:45.245380 7fa5bcd88700 log [INF] : osd.521 [2607:f298:4:2243::7088]:6806/53217 boot

when the pg stats message doesn't arrive quickly enough.

Fixes: #2341
Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Greg Farnum <gregory.farnum@dreamhost.com>
13 years agomon: fix whitespace
Sage Weil [Tue, 24 Apr 2012 17:49:30 +0000 (10:49 -0700)]
mon: fix whitespace

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agomon: fix pgmonitor ratio commands
Greg Farnum [Tue, 24 Apr 2012 17:30:43 +0000 (10:30 -0700)]
mon: fix pgmonitor ratio commands

The indices were set incorrectly when I whipped thi sup. That's what
you get for not testing nor being careful enough in review.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
13 years agotest_rbd: add tests for snap_set and more complicated resizing
Josh Durgin [Tue, 24 Apr 2012 15:35:43 +0000 (08:35 -0700)]
test_rbd: add tests for snap_set and more complicated resizing

* snap_set to a deleted (and recreated) snapshot
* resizing down (truncating) and back up
* resizing to non-object-aligned sizes

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agolibrbd: reset needs_refresh flag before re-reading header
Josh Durgin [Tue, 24 Apr 2012 06:46:51 +0000 (23:46 -0700)]
librbd: reset needs_refresh flag before re-reading header

This way we can't miss an update if we get a notify during ictx_refresh.
Specifically, a race like this:

Thread 1               Thread 2              Process 2

ictx_refresh()
read_header()
                                             snap_create()
                       notify()
                       need_refresh = true
process header...
need_refresh = false

If this happened, we would not re-read the header with the new
snapshot, so the snapshot would not happen at the intended point
in time, but only after we re-read the header again.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agolibrbd: clean up snapshot handling a bit
Josh Durgin [Tue, 24 Apr 2012 01:04:27 +0000 (18:04 -0700)]
librbd: clean up snapshot handling a bit

* snapid should determine whether our mapped snapshot is gone, not snapname
* snap_set(<nonexistent_snap>) shouldn't reset us to CEPH_NOSNAP
* snapname should be set before using the it in the perfcounter name
* snapname and image name don't need to be passed as arguments since an
  ImageCtx already contains that info
* ictx_check() doesn't need to check for non-existent snaps - only I/Os care,
  so check in check_io() instead

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agolibrbd: clarify handle_sparse_read condition
Josh Durgin [Mon, 23 Apr 2012 18:58:57 +0000 (11:58 -0700)]
librbd: clarify handle_sparse_read condition

The earlier condition is >. != means < at this point, and the nesting
is unnecessary.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
13 years agorun_seed_to.sh: rework the script, make it more flexible and broaden the tests.
Sage Weil [Mon, 23 Apr 2012 20:57:25 +0000 (13:57 -0700)]
run_seed_to.sh: rework the script, make it more flexible and broaden the tests.

Allow for '-h' and other options such as disabling the journal sync tests,
defining it is to be run on a btrfs FS, enabling exit on error (default is
now 'off'), and allow certain env variables to specify additional options
to each store.

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
13 years agolibrbd: rev version for discard addition
Sage Weil [Tue, 24 Apr 2012 02:43:25 +0000 (19:43 -0700)]
librbd: rev version for discard addition

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge remote-tracking branch 'gh/wip-discard'
Sage Weil [Mon, 23 Apr 2012 20:58:34 +0000 (13:58 -0700)]
Merge remote-tracking branch 'gh/wip-discard'

13 years agorun_seed_to.sh: remove stray arg
Sage Weil [Mon, 23 Apr 2012 16:30:50 +0000 (09:30 -0700)]
run_seed_to.sh: remove stray arg

This crept in in commit d1740bd586db80068fc0292223cf21911de66428.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoperfcounters: tolerate multiple loggers with the same name
Sage Weil [Sun, 22 Apr 2012 21:23:52 +0000 (14:23 -0700)]
perfcounters: tolerate multiple loggers with the same name

Make them unique by appending -<ptr>, so that the json we dump will remain
valid.

We may also want to allow people to share counters of the same type.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge branch 'master' into wip-discard
Sage Weil [Sun, 22 Apr 2012 04:01:49 +0000 (21:01 -0700)]
Merge branch 'master' into wip-discard

13 years agoMakefile: disable format-security warning
Sage Weil [Sun, 22 Apr 2012 03:28:45 +0000 (20:28 -0700)]
Makefile: disable format-security warning

The prt() varargs function generates this warning

test/rbd/fsx.c: In function ‘prt’:
warning: test/rbd/fsx.c:203:2: format not a string literal and no format arguments [-Wformat-security]
warning: test/rbd/fsx.c:205:3: format not a string literal and no format arguments [-Wformat-security]

Disable that check for the fsx build only.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agofilestore: verify that fiemap works
Sage Weil [Sat, 21 Apr 2012 21:31:42 +0000 (14:31 -0700)]
filestore: verify that fiemap works

Check for a bug present in older versions of ext4.  If present, disable
FIEMAP.  See #2328.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agorados: fix error printout for mapext
Sage Weil [Sat, 21 Apr 2012 20:32:46 +0000 (13:32 -0700)]
rados: fix error printout for mapext

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agolibrbd: instrument with perfcounters
Sage Weil [Sat, 21 Apr 2012 19:50:05 +0000 (12:50 -0700)]
librbd: instrument with perfcounters

Track IO operations on a per-image basis.

Implements: #1451
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agolibrbd: fix ictx_check pointer weirdness by using std::string
Sage Weil [Sat, 21 Apr 2012 00:13:08 +0000 (17:13 -0700)]
librbd: fix ictx_check pointer weirdness by using std::string

I was seeing failures of LibRBD.TestIOToSnapshot where we would fail to
refresh after rollback, even though the snap existed.  I assume it is
because the std::string whose c_str() we were pointing to was reallocated.

Use a std::string here instead.

This code is weird.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoFileJournal: don't wait flusher until completions are queued
Samuel Just [Fri, 20 Apr 2012 23:57:48 +0000 (16:57 -0700)]
FileJournal: don't wait flusher until completions are queued

Fixes: #2324
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agofilestore: fix collection_add journal replay problem
Sage Weil [Fri, 20 Apr 2012 23:56:57 +0000 (16:56 -0700)]
filestore: fix collection_add journal replay problem

In collection_add we have a two-phase guard set on the linked object via
the old name.  During replay, we might see that the dest name is missing
and replay the operation, and in the process overwrite a newer guard with
an older one.

Avoid this by checking the source name too, and skipping the operation
entirely if a new guard exists.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoFileStoreDiff: flip sense of diff*() methods around
Sage Weil [Thu, 19 Apr 2012 22:31:51 +0000 (15:31 -0700)]
FileStoreDiff: flip sense of diff*() methods around

true means diff, false means same.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agotest_idempotent_sequence: Use FileStoreDiff class instead.
Sage Weil [Fri, 20 Apr 2012 23:55:55 +0000 (16:55 -0700)]
test_idempotent_sequence: Use FileStoreDiff class instead.

Use FileStoreDiff instead of having the diff code embedded in the test,
allowing for more tests and people to use the code in case it comes in
hand.

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
13 years agotest_idempotent_sequence: Output missing options on "usage".
Joao Eduardo Luis [Sun, 15 Apr 2012 19:46:39 +0000 (20:46 +0100)]
test_idempotent_sequence: Output missing options on "usage".

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
13 years agoFileStoreDiff: check if two FileStores match.
Joao Eduardo Luis [Mon, 16 Apr 2012 01:50:44 +0000 (02:50 +0100)]
FileStoreDiff: check if two FileStores match.

This code should be on a stand-alone class, instead of being embedded on
a single test, in case someone or something find it useful somewhere down
the line.

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
13 years agolibrbd: allow image resize to non-block boundaries
Sage Weil [Thu, 19 Apr 2012 23:18:55 +0000 (16:18 -0700)]
librbd: allow image resize to non-block boundaries

The caller is still invalidating the entire cache, so we don't need to
deal with discard at this level.  That might be worth cleaning up
later, though.

Fixes: #2296
Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoobjectcacher: rename truncate_set -> discard_set, and use discard
Sage Weil [Thu, 19 Apr 2012 23:17:48 +0000 (16:17 -0700)]
objectcacher: rename truncate_set -> discard_set, and use discard

Do not assume the object extents are at the trailing edge of objects.
Instead, discard arbitrary extents.  Fix callers.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoobjectcacher: implement Object::discard()
Sage Weil [Thu, 19 Apr 2012 23:15:17 +0000 (16:15 -0700)]
objectcacher: implement Object::discard()

Discard a range of bytes from an object.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agolibrbd: fix debug output
Sage Weil [Thu, 19 Apr 2012 23:14:15 +0000 (16:14 -0700)]
librbd: fix debug output

objects is misleading here, these are byte offsets

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agolibrbd: make discard invalidate the range in cache
Sage Weil [Thu, 19 Apr 2012 20:26:32 +0000 (13:26 -0700)]
librbd: make discard invalidate the range in cache

Fed this to test_librbd_fsx and it was happy.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agolibrbd: fix zeroing of trailing bits on short reads that span objects
Sage Weil [Thu, 19 Apr 2012 18:00:20 +0000 (11:00 -0700)]
librbd: fix zeroing of trailing bits on short reads that span objects

handle_sparse_read() was taking buf_ofs and buf_len, but buf_len was being
interpreted as the total size of the buffer, not the length of the extent
in the buffer start at buf_ofs.  Both callers pass in an extent length, so
fix the zero code to do the right thing.

Specifically, the behavior I saw was:

 - read range spanning 2 objects, trailing 20k and leading 50k
 - first object didn't exist, zeroed first 20k of buffer
 - second object didn't exist, zeroed next 30k (50k-20k) of buffer
   - the last 20k of buffer was unzeroed.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agolibrbd: fix debug output for image resize
Sage Weil [Thu, 19 Apr 2012 17:57:30 +0000 (10:57 -0700)]
librbd: fix debug output for image resize

Print old -> new, not new -> old.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agotest_librbd_fsx: port newer xfsprogs version
Sage Weil [Thu, 19 Apr 2012 17:04:52 +0000 (10:04 -0700)]
test_librbd_fsx: port newer xfsprogs version

Builds and runs... for a few ops at least.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agorevert to xfstests' fsx, which has discard support
Sage Weil [Thu, 19 Apr 2012 16:27:34 +0000 (09:27 -0700)]
revert to xfstests' fsx, which has discard support

13 years agoadmin_socket: add a separate debug subsys/level
Sage Weil [Fri, 20 Apr 2012 04:04:56 +0000 (21:04 -0700)]
admin_socket: add a separate debug subsys/level

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agolog: prefix dump with line numbers
Sage Weil [Fri, 20 Apr 2012 23:36:54 +0000 (16:36 -0700)]
log: prefix dump with line numbers

This makes it easier to interpret the dump, and makes it obvious what is
dump (and potentially a dup of something that was already logged) and what
is not.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agotest_filestore_workloadgen: track pg log size in memory
Sage Weil [Fri, 20 Apr 2012 22:35:44 +0000 (15:35 -0700)]
test_filestore_workloadgen: track pg log size in memory

Avoid a stat!

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agotest_filestore_workloadgen: whitespace
Sage Weil [Fri, 20 Apr 2012 22:30:45 +0000 (15:30 -0700)]
test_filestore_workloadgen: whitespace

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoorganize test_filestore_idempotent*
Sage Weil [Fri, 20 Apr 2012 22:25:32 +0000 (15:25 -0700)]
organize test_filestore_idempotent*

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoremove hopelessly flawed test_filestore_idempotent
Sage Weil [Fri, 20 Apr 2012 22:23:17 +0000 (15:23 -0700)]
remove hopelessly flawed test_filestore_idempotent

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agotest_store -> test_filestore
Sage Weil [Fri, 20 Apr 2012 22:22:36 +0000 (15:22 -0700)]
test_store -> test_filestore

and organize source

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agotest_wrkldgen -> test_filestore_workloadgen
Sage Weil [Fri, 20 Apr 2012 22:20:16 +0000 (15:20 -0700)]
test_wrkldgen -> test_filestore_workloadgen

Also put the code in src/test/filestore/.

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoceph-authtool: rename cli test dir
Sage Weil [Fri, 20 Apr 2012 20:28:23 +0000 (13:28 -0700)]
ceph-authtool: rename cli test dir

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoceph-conf: rename cli test dir
Sage Weil [Fri, 20 Apr 2012 20:28:03 +0000 (13:28 -0700)]
ceph-conf: rename cli test dir

Signed-off-by: Sage Weil <sage@newdream.net>
13 years agoMerge branch 'stable'
Sage Weil [Fri, 20 Apr 2012 20:22:22 +0000 (13:22 -0700)]
Merge branch 'stable'

Conflicts:
src/osd/OpRequest.cc

13 years agoOpRequest: mark_event output is now at debug 5
Sage Weil [Fri, 20 Apr 2012 20:21:14 +0000 (13:21 -0700)]
OpRequest: mark_event output is now at debug 5

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
13 years agoconfig: dump subsys log levels with --show-config
Sage Weil [Fri, 20 Apr 2012 05:24:43 +0000 (22:24 -0700)]
config: dump subsys log levels with --show-config

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
13 years agoMerge branch 'wip-2313'
Yehuda Sadeh [Thu, 19 Apr 2012 23:43:36 +0000 (16:43 -0700)]
Merge branch 'wip-2313'