Commit Graph

22570 Commits

Author SHA1 Message Date
Samuel Just
a928b6dbf6 OSDService: make messengers private
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 11:20:41 -08:00
Samuel Just
47699f39b9 osd/: make OSDService messenger helpers return ConnectionRef
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-11-30 11:08:55 -08:00
Sage Weil
0ffafb3106 Revert "osd: fix leak of heartbeat con on reset"
This reverts commit b31a99abda.
2012-11-29 17:03:30 -08:00
Sage Weil
774d5bf14c osd: move next_osdmap under separate lock
It doesn't actually interfere with publish_lock, and the current osdmap
ref.

Document what is going on.

Always preceed publish_map() with one or more pre_publish_map() calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:31 -08:00
Sage Weil
b31a99abda osd: fix leak of heartbeat con on reset
If we replace our old con, drop the reference.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:31 -08:00
Sage Weil
3ceaec4ced osd: use safe con helpers for scrub
Note that if we don't get a con our behavior largely does not matter, since
we know we are about to get a Reset event anyway.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:31 -08:00
Sage Weil
f865f26067 osd: use safe con helpers from do_{infos,queries,notifies}
Ensure we don't reopen connections to downloads.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:30 -08:00
Sage Weil
30832f5aed osd: make _share_map_outgoing() use a Connection
Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 15:15:30 -08:00
Sage Weil
a87361ef30 osd: fix Connection leaks
Messenger::get_connection() returns a reference.  Put it.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:39:44 -08:00
Sage Weil
e18f9ee844 osd: add Connection-base send_map(), send_incremental_map()
Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:39:44 -08:00
Sage Weil
5bc10ecce3 osd: use OSDService send_message helper from PG context
Use the OSDService helper to send messages to peers.  This ensures that if
we are on an older OSDMap the messages don't actually get sent to down
OSDs that handle_osd_map has done mark_down() on.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:39:44 -08:00
Sage Weil
bd03234c31 osd: simplify active_committed
Way back in 4b3bb5ab37 we changed this to
pass an entity_inst_t down to fix a race. The refactor of the PG map
handling made this unnecessary; remove it.  The PG's OSDMap is not coherent
with respect to the PG when we take the lock, which is all that is
needed here.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:39:43 -08:00
Sage Weil
e16533029e osd: use safe OSDService msgr helpers for heartbeats
Get connections via the OSDService helper.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:38:51 -08:00
Sage Weil
ea65dffff2 osd: helpers to blacklist messages to down osds
There is a race between handle_osd_map -> note_down_osd() and PG threads:

 - handle_osd_map -> note_down_osd marks down an osd for epoch N
 - a pg thread with epoch <N sends a message to the (old) peer, reopening
   the msgr connection
 - nobody cleans up

Introduce a pre_publish_map() OSDService method and helpers for sending
messages to peers.  Pass in the epoch we are working from, and drop the
message on the floor if the target OSD has been since marked down.

See #3548.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-29 12:38:51 -08:00
Alex Elder
dd3a24a647 create qa/workunits/rbd/map-unmap.sh
This adds a bash script that creates an rbd image, then repeatedly
maps and unmaps it for a specified duration (5 minutes by default).

Signed-off-by: Alex Elder <elder@inktank.com>
2012-11-28 17:22:49 -06:00
Sage Weil
78286b1403 log: 10,000 recent log entries
This is what we were (wrongly) doing before, so there are no memory
utilization surprises.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-28 13:00:36 -08:00
Sage Weil
4de7748b72 log: fix log_max_recent config
<facepalm>

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-28 12:59:43 -08:00
Dan Mick
80c506d4b9 rbd: fix import from stdin, add test
Make import work; do I/O in image native block size.
Note: creating sparse images is not currently attempted; could
scan for runs of zeros and write discontiguous chunks to image.

Fixes: #3503
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c99d9c3ae7)
2012-11-28 11:45:31 -08:00
Dan Mick
fcebe04801 rbd: allow export to stdout, add tests
Fixes: #3502
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit a738f44bc4)
2012-11-28 11:45:27 -08:00
Sage Weil
a176800396 mon: fix compiler warning
signed/unsigned comparison

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-28 11:11:53 -08:00
Sage Weil
43ef8c10ba mon: do not crash on invalid 'mon tell N ...' target
Fixes: #3545
Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 20:51:03 -08:00
Sage Weil
cf2a045402 config: make $pid a metavariable
Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 17:29:11 -08:00
Sage Weil
aa37fe769d test_rados_api_misc: fix TMAPPUT sorting test
Several things wrong here.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 16:55:25 -08:00
Sam Lang
a1e08684f5 README: add the libboost-thread-dev dep to the list
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-11-27 17:21:40 -06:00
Sage Weil
533a6d042d Merge branch 'wip-mds-next' into next
OSD bits Reviewed-by: Sam Just <sam.just@inktank.com>
MDS bits Reviewed-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:09 -08:00
Sage Weil
10b68b2e1a osd: detect (some) misordered ondisk tmaps
Detect a misordered ondisk tmap... if we are already decoding it.  We still
leave the trailing bits unchecked.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:00 -08:00
Sage Weil
bc77e528a0 osd: verify TMAPPUT data is sorted
The MDS may try to write unsorted data; make sure it is sorted before
we write it.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:00 -08:00
Sage Weil
29fae494d0 osd: do not ENOENT on missing key on remove
The MDS may include RM ops in a tmap update for items that were already
removed: after restarting and replaying the journal, it doesn't know
which dentries were previously committed and which were not.

No other (known) users care about the error code.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:00 -08:00
Sage Weil
8e91d00b52 osd: tolerate misordered TMAP updates
The previous tmap implementation requires that the update stream be
sorted or else it will behave erratically (by placing new keys in the
map out of order).  This can cause very strange failures: reads may
appear to return the correct result initially, but once intervening
keys are remove they will not... depending on how read is implemented
on the client side.

Fix this by doing the optimized updates initially, but falling back to
a slow implementation if an unsorted update is detected.  It is slow,
but such updates are rare.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:00 -08:00
Sage Weil
a4439f0fcc osd: move tmapup into a helper
Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-27 14:13:00 -08:00
Dan Mick
919db19426 rbd workunit: Add tests for clones across pools
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit ece11b0ed9)
2012-11-27 14:06:33 -08:00
Dan Mick
5164075040 rbd workunit: Make "remove_images" silent
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 0be9b15b79)
2012-11-27 14:06:30 -08:00
Dan Mick
ca5549e8c9 rbd workunit: Add tests for cross-pool rename
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit a96ede944f)
2012-11-27 14:06:27 -08:00
Dan Mick
bbd343a1d1 rbd: tests for copy with explicit/implicit pool names
Validate change to not assume dest pool == src pool

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 39180430b9)
2012-11-27 14:06:23 -08:00
Dan Mick
e612afc2c0 rbd: fix import pool assumptions
import allows specifying one image, implicitly or explicitly the
"source" image, even though it's really the destination.  Fix up
the reassignment of 'source' to 'dest', and check for and complain
about specifying two different pools or images for import.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit c219698149)
2012-11-27 14:06:21 -08:00
Dan Mick
81d3830738 rbd: change destpool assumptions.
Don't default destpool to srcpool; it's surprising, and
not useful/helpful enough to violate the convention that
"default pool is rbd"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 3b0c360528)
2012-11-27 14:06:18 -08:00
Dan Mick
724cfd1b41 rbd: --size fixes
* require --size/-s for both create *and* resize
* explicitly permit create with size 0.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 08f47a42b5dcf77c40e3c1472739554452993412)
2012-11-27 14:06:15 -08:00
Dan Mick
66b148e3ab rbd: allow parsing image@snap even if --pool given
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit e452df6dadd443d135527b49784a47ad21429cc1)
2012-11-27 14:06:12 -08:00
Sage Weil
8e9554e175 Merge remote-tracking branch 'gh/wip-mon-workloadgen' into next 2012-11-27 12:54:40 -08:00
Joao Eduardo Luis
3112cd8fbe test: mon: run_test.sh: helper script for the mon's workloadgen
Takes advantage of qa/workunits/mon/workloadgen.sh to avoid duplicating
code.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
2a681052b2 qa: workunits: mon: add workloadgen's workunit
Uses test/mon/test_osd_workloadgen to generate a bunch of map
changes

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
e1820d870e test: mon: workload generator
User-space tool that interacts with the monitor, with the objective of
generating a workload mimicking a set of OSDs and clients.

As it is, the tool will mimic any number of OSDs, by keeping in-memory
stubs that will act as independent OSDs, generating random operations
that will induce map updates; the client stub, on the other hand,
performs no operations besides connecting to the monitor and whatever
happens between the Objecter class and the monitor (mainly keeping
updated with map updates).

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
f5029074da messages: MLog: make ctor's uuid argument a const
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
317777436a mon: Monitor: use existing strict_strtol() on parse_pos_long()
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
f7276deaff crush: relax the order by which rules and buckets must be defined
Before we only allowed buckets (say, 'root') to be defined *before*
rules.

With this patch, we allow buckets and rules to be defined by any order,
although some care should be taken when creating the plain-text crush
map, or the crushtool will error out when a rule uses a bucket only
defined later on in the file.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Joao Eduardo Luis
1fcccd3ea4 crushtool: rework how verbosity works
'verbose' was a bool that would either be passed as one or zero to class
CrushCompile. However, most messages would only be outputted with a
verbose level > 1.

This patch makes it so that multiple '-v' increase the verbosity level;
i.e., -v mean verbose = 1; -v -v means verbose = 2; and so forth.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-11-27 20:00:44 +00:00
Sage Weil
15b4ac58b2 Merge remote-tracking branch 'gh/wip-perf' into next
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
2012-11-27 09:29:03 -08:00
Sage Weil
60d8206286 Merge remote-tracking branch 'gh/wip-crush' into next 2012-11-27 09:28:18 -08:00
Danny Al-Gaaf
d4bc3729fd fix syncfs handling in error case
If the call to syncfs() fails, don't try to call syncfs again via
syscall(). If HAVE_SYS_SYNCFS is defined, don't fall through to try
syscall() with SYS_syncfs or __NR_syncfs.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2012-11-27 08:52:52 -08:00
Yan, Zheng
854a78669f mds: don't add not issued caps when confirming cap receipt
There is message ordering race in cephfs kernel client. We compose
cap messages when i_ceph_lock is hold. But when adding messages
to the output queue, the kernel releases i_ceph_lock and acquires
a mutex. So it is possible that cap messages are send out of order.
If the kernel client send a cap update, then send a cap release,
but the two messages reach MDS out of order. The update message
will re-add the released caps. This patch adds code to check if
caps were actually issued when confirming cap receipt.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2012-11-26 21:14:45 -08:00