Commit Graph

15985 Commits

Author SHA1 Message Date
Sage Weil
c2e4047a88 Merge branch 'next' 2011-08-24 09:38:01 -07:00
Sage Weil
6c6fa6dffd client: only link directories into hierarchy once
Directories can only link into the hierarchy once.  We assert as much
in readdir_r_cb().  Fix link() so that it unlinked the directory from the
old location when relinking somewhere new.  Be careful to do this after
we take inode refs to avoid any unpleasantness.

Fixes: #1429
Reported-by: Sam Lang <samlang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-24 09:31:22 -07:00
Sage Weil
eaaefece77 mon: fix store_state
We need to bound the range we write to disk by m->last_committed; this got
lost in translation in commit dfab2c91f5.

Fixes paxos crashes in handle_begin

mon/Paxos.cc: In function 'void Paxos::handle_begin(MMonPaxos*)', in thread '0x7fc74d11f700'
mon/Paxos.cc: 393: FAILED assert(begin->last_committed == last_committed)

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-24 09:10:23 -07:00
Sage Weil
ba44cdebcd journaler: fix waiting_for_zero clearing
Clear this flag only if we know no subsequent flushes could be waiting on
a prezero operation.

Fixes MDS journaling hang under heavy journal load.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-24 09:10:23 -07:00
Yehuda Sadeh
2144c7a4f9 add missing include, required for certain environments 2011-08-23 18:52:35 -07:00
Colin Patrick McCabe
1a7eac4d82 parallelize rados export and import
* use workqueues to parallelize rados export and import

* Put export and import into separate files

* Fix RADOS_SYNC_TMP_SUFFIX_LEN bug

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
b76e054bc0 WorkQueue: don't be chatty about finishing workers
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
b20f3622b0 test_rados_tool.sh: fix xattr test
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
32694765f8 librados: fix IoCtx copy constructor
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
d81d458064 rados_sync:don't need to declare CHANGED_XATTRS 2x
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:26 -07:00
Colin Patrick McCabe
31bf064b6e Some fixes to double-dash support, fix warning
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 18:12:06 -07:00
Colin Patrick McCabe
eecf4d6175 ceph_argparse: handle double dashes consistently
Handle double dashes in the ceph_argparse functions, so that any piece
of code doing argument parsing will correctly interpret them.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 16:30:03 -07:00
Colin Patrick McCabe
18ec5655fe injectargs: binary flags only consume 1 token
Never consume more than one token when parsing a binary flag.

Basically, your choices are --foo=false, --foo=true, and just --foo.
However, only 1 token will ever be examined.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 15:46:07 -07:00
Colin Patrick McCabe
42a65b8d69 config: print warning on injectargs parse fail
injectargs should print a warning message when its parser fails.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 15:46:07 -07:00
Colin Patrick McCabe
084fe47f3c injectargs test: test foo=true
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 15:46:07 -07:00
Sage Weil
ddc567429d mon: allow wildcards for mon cap command matching
We need wildcards, actually.  * is any token, ... is 1 or more tokens.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 15:24:44 -07:00
Colin Patrick McCabe
3432729397 common/config: fix get_val for booleans
md_config_t::get_val should return true/false for booleans, not 0/1.
This is for consistency with the setter.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 14:26:49 -07:00
Colin Patrick McCabe
ae9ba2249e pipe.c: #define GNU_SOURCE
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 14:12:15 -07:00
Sage Weil
9c498e0f1e qa: add unit tests for mon cap 'allow command ...' stanzas
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 14:03:47 -07:00
Sage Weil
6c3d8103bf mon: whitelist individual commands in mon cap string
This lets you whitelist a command prefix.  For example,

 'allow command osd foo'

will let you do any command that begins with 'osd foo', including
'osd foo' and 'osd foo bar baz bam'.

No deny, and no pattern matching.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 13:56:46 -07:00
Sage Weil
ea0f2f301e mon: adjust max_devices when adding to crush map
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:59:02 -07:00
Sage Weil
58f98e7afc crush: refuse to add item >= max_devices
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:58:46 -07:00
Sage Weil
dc2be1d87e mon: 'osd gstcrushmap' or 'osd crush set' both work
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:47:17 -07:00
Sage Weil
a4f32ba73f mon: fix arg count checks
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:47:04 -07:00
Sage Weil
d896d401ca mon: 'osd crush reweight <name> <weight>'
Reweight a node in the crush map.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:40:14 -07:00
Sage Weil
def8382e11 mon: 'osd crush rm <name>'
This is similar to crushtool --remove-item.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:33:46 -07:00
Sage Weil
db8ad462df mon: 'osd crush add <id> <name> <weight> [<loc1=foo> [<loc2=bar> ...]]'
This is identical to the crushtool --add-item functionality, but does not
require a racy and tedious

 - get crush map
 - update crush map
 - set new crush map

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:31:35 -07:00
Sage Weil
051c4a3657 mon: return error message string when no other output string specified
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 12:26:32 -07:00
Colin Patrick McCabe
29cf7333a7 common/config: honor --
Argument parsing should stop after --

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-23 11:56:13 -07:00
Sage Weil
6d292397aa mon: remove dead 'setmap' code
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 11:23:31 -07:00
Sage Weil
deb25e00f2 mon: make auto-marking of booting osds 'in' optional
By default we mark a booting OSD 'in' so that it immediately gets data.
Make this optional.

Eventually we may want to make this default to off...

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 11:21:44 -07:00
Sage Weil
09f4c46411 client: kill dentry_of() macro
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 11:20:53 -07:00
Sage Weil
5e97a1cbfe Merge branch 'next' 2011-08-23 09:25:21 -07:00
Sage Weil
7ef44b7353 osd_types: fix category encoding in object_info_t
This was mis-merged in f6ff0f14e9.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-23 09:24:25 -07:00
Sage Weil
d5a9301f2c qa: define _GNU_SOURCE for qa helpers; add btrfs dir makefile
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-22 21:18:00 -07:00
Sage Weil
ba4551d104 librados: whitespace
Don't do

some::class::
method(int foo)
{

}

...because then I can't '^S::method'. :)

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-08-22 17:21:35 -07:00
Sage Weil
3205441d3f librbd: reimplement copy using read_iterate
Ah, so much simpler!

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 16:53:55 -07:00
Sage Weil
f19e6131c3 rbd: fix check_io for snap
Need to look at image size for snapshot, not the head version.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 16:53:55 -07:00
Sage Weil
76e18e3d57 librbd: fix copy
This was croaking on sparse images.

Use an image ctx for the dest.

We should probably use read_iterate instead.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 16:53:55 -07:00
Sage Weil
39b6a9c495 qa: add rbd copy workunit
Test copying an image and snapshot.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 16:53:55 -07:00
Greg Farnum
b03a1841b4 mdcache: documentation for path_traverse
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-22 16:00:35 -07:00
Greg Farnum
e898fe7df8 mdcache: Reduce the gratuitous references to onfail
We've been setting flags at the beginning of path_traverse
for a while; use those instead of ongoing comparisons.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-22 16:00:35 -07:00
Greg Farnum
a1433a1df3 mds: remove the unused MDS_TRAVERSE_FAIL flag.
This isn't used, and judging by the comments was a horrible lie.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-22 16:00:35 -07:00
Greg Farnum
4a17d71c8e mdcache: handle unreadable null dentries
Previously, we were asserting (farther down) if the dentry was
null but blocked by a lock. Instead, we should here be waiting
until it's readable instead of just continuing on.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-08-22 16:00:35 -07:00
Sage Weil
a585c4d4fe librbd: specify copy src image as image handle
By specifying via an image handle we can set the snapshot on the src
image.  This also makes the API cleaner.

Fixes: #1416
Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 16:02:56 -07:00
Colin Patrick McCabe
3ce41446a6 Define _GNU_SOURCE in src/Makefile.am
We end up needing _GNU_SOURCE in a bunch of places-- to get direct i/o,
pipe2, and some other Linux-specific interfaces.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 15:35:13 -07:00
Colin Patrick McCabe
4e9a0b6d30 pipe.c: #define GNU_SOURCE
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-08-22 15:06:16 -07:00
Sage Weil
4b7b5ec7dc Merge branch 'next' 2011-08-22 13:59:02 -07:00
Sage Weil
3d85872a0f mds: open+pin stray dirfrags on startup
This ensures that the stray dirfrags are always open, which in turn ensures
that whenever we add straydn items the rstats/fragstats will get updated
properly.  This is a better solution than d3d767a.

Now we can assert the stray dirfrag is open in
get_or_create_stray_dentry() instead of calling get_or_open_dirfrag().

Signed-off-by: Sage Weil <sage@newdream.net>
2011-08-22 13:58:39 -07:00
Sage Weil
3f134257e2 Revert "mds: do not complain/assert about stray inode rstat/fragstat consistency"
This reverts commit d3d767a2a3.

A better solution is to keep the stray frags loaded+pinned.
2011-08-22 13:19:04 -07:00