Yan, Zheng [Sun, 16 Feb 2014 14:14:50 +0000 (22:14 +0800)]
ReplicatedPG: return no data if read size is trimmed to zero
OSD should return no data if the read size is trimmed to zero by the
truncate_seq/truncate_size check. We can't rely on ObjectStore::read()
to do that because it reads the entire object when the 'len' parameter
is zero.
By default, disallow adjustment of primary affinity unless the user has
opted in by adjusting their monitor config. This will avoid some user
pain because inadvertantly setting the affinity will prevent older clients
from connecting to and using the cluster.
Sage Weil [Tue, 11 Feb 2014 17:25:04 +0000 (09:25 -0800)]
osd/OSDMap: apply primary_affinity to mapping
The behavior is a bit different for replicated and indep/erasure mode.
In the first case, we are rearranging the result. In the second case,
we can just set the primary argument to the right value.
Greg Farnum [Tue, 11 Feb 2014 21:34:39 +0000 (13:34 -0800)]
OSD: create a helper for handling OSDMap subscriptions, and clean them up
We've had some trouble with not clearing out subscription requests and
overloading the monitors (though only because of other bugs). Write a
helper for handling subscription requests that we can use to centralize
safety logic. Clear out the subscription whenever we get a map that covers
it; if there are more maps available than we received, we will issue another
subscription request based on "m->newest_map" at the end of handle_osd_map().
Notice that the helper will no longer request old maps which we already have,
and that unless forced it will not dispatch multiple subscribe requests
to a single monitor.
Skipping old maps is safe:
1) we only trim old maps when the monitor tells us to,
2) we do not send messages to our peers until we have updated our maps
from the monitor.
That means only old and broken OSDs will send us messages based on maps
in our past, and we can (and should) ignore any directives from them anyway.
Ilya Dryomov [Thu, 13 Feb 2014 17:38:10 +0000 (19:38 +0200)]
osdmaptool: fix --pool option for --test-map-object mode
Commit 7f1b12f2ef97 ("osdmaptool: add --test-map-pgs mode") broke
--pool for --test-map-object mode. Fix it, and improve --pool option
handling for both modes while at it (report strict_strtol() errors,
check if specified pool exists).
Loic Dachary [Thu, 13 Feb 2014 15:20:51 +0000 (16:20 +0100)]
mon: remove format argument from osd crush dump
The --format argument of the ceph cli is used to send the desired format
argument. The format argument is always part of the command sent to the
server. Adding it to the command description in MonCommand is not
necessary.
Loic Dachary [Thu, 13 Feb 2014 14:40:30 +0000 (15:40 +0100)]
mon: do not goto reply if a ruleset exists in pending
If the crush ruleset is found in pending, do not goto reply because it
does not exist yet. Wait for the pending proposal (and the ruleset) to
be accepted and then only return that it exists.
Basic tests and a test that create the conditions where an OSDMap
is pending with a ruleset that is not yet in the OSDMap. An attempt to
create a rule by the same name will return success and not create it again.
Loic Dachary [Sun, 9 Feb 2014 17:26:57 +0000 (18:26 +0100)]
mon: minor improvement to test-helpers.sh
* kill -9 daemons to better cope with stuck daemons
* reduce paxos propose interval to speedup tests
* look for erasure code plugins from the sources directory
Loic Dachary [Sun, 9 Feb 2014 20:18:45 +0000 (21:18 +0100)]
crush: add the dump_rule(int ruleset) method
And implement dump_rules() using dump_rule(). The indentiation and
variable names are intentionaly left as is to not confuse code being
moved around and the code changes.
Loic Dachary [Wed, 12 Feb 2014 15:58:23 +0000 (16:58 +0100)]
mon: remove racy tests from osd-pool-create.sh
Use the admin socket to create the conditions by which a pool creation
is made to wait for the next paxos proposal because the required crush
ruleset is pending.
It replaces a fragile time sensitive workaround that could fail because
of race conditions. It also has the benefit of increase the speed of the
test because there is no need to wait for a long time just to accomodate
the slowest machines.
and feed it to OSDMonitor::prepare_command_impl(). The pending OSDMap won't
be proposed because it short circuit PaxosService::dispatch. It will,
however, be proposed next time PaxosService::dispatch() gets a chance.
Loic Dachary [Wed, 12 Feb 2014 17:49:50 +0000 (18:49 +0100)]
mon: add --mon-advanced-debug-mode
When this flag is true, the mon is expected to provide functionalities
that are for developer oriented debug purposes only. It is meant to
be used by the developer and not the system administrator, because it
would allow a non-developer to break things in ways that would be very
difficult to diagnose. It should probably not be documented.
Yan, Zheng [Tue, 11 Feb 2014 05:32:23 +0000 (13:32 +0800)]
mds: remove xattr when null value is given to setxattr()
setxattr() should remove xattr if parameter 'value' is NULL. To
distinguish it from the zero-length value case, introduce a new
flag CEPH_XATTR_REMOVE for the setxattr request.
Sage Weil [Tue, 11 Feb 2014 17:24:29 +0000 (09:24 -0800)]
osd/OSDMap: fix _raw_to_up_osds for EC pools
When filtering down OSDs out of the result set (i.e., raw -> up), we can
shift positions for replicated pools but need to preserve position for
EC pools.
Sage Weil [Wed, 12 Feb 2014 21:18:04 +0000 (13:18 -0800)]
mon/OSDMonitor: fix legacy tunables warning
Warn on legacy tunables, not on non-optimal tunables. Optimal is a moving
target, but it is really the legacy defaults that we want to push people
off of.
Fixes: #7399 Signed-off-by: Sage Weil <sage@inktank.com>
Yan, Zheng [Tue, 4 Feb 2014 13:53:31 +0000 (21:53 +0800)]
mds: force update backtraces for previously created FS
Update inode format version to 10, treat any previously created
inode as no backtrace. When inode with no backtrace is modified,
force update its backtrace.
Josh Durgin [Tue, 11 Feb 2014 18:14:36 +0000 (10:14 -0800)]
librbd: remove limit on number of objects in the cache
The number of objects is not a significant indicated of when data
should be written out for rbd. Use the highest possible value for
number of objects and just rely on the dirty data limits to trigger
flushing. When the number of objects is low, and many start being
flushed before they accumulate many requests, it hurts average request
size and performance for many concurrent sequential writes.
Josh Durgin [Tue, 11 Feb 2014 19:53:00 +0000 (11:53 -0800)]
ObjectCacher: use uint64_t for target and max values
All the options are uint64_t, but the ObjectCacher was converting them
to int64_t. There's never any reason for these to be negative, so
change the type.
Adjust a few conditionals so that they only convert known-positive
signed values to uint64_t before comparing with the target and max
values. Leave the actual stats accounting as loff_t for now, since
bugs in accounting will have bad effects if negative values wrap
around.
Sage Weil [Tue, 4 Feb 2014 23:59:22 +0000 (15:59 -0800)]
crushtool: new cli tests for the vary-r tunable
These illustrate the variation in mapping results as the vary_r tunable
is adjusted. Note:
1- For the vary_r=0 case, we have several inputs that map to only a single
output:
rule 3 (delltestrule) num_rep 4 result size == 1:\t27/1024 (esc)
rule 3 (delltestrule) num_rep 4 result size == 2:\t997/1024 (esc)
This is the behavior we are fixing. For all of the other values of
vary_r, we get 2 outputs for all inputs.
2- If we use vary_r 1, which is likely the most efficient computation,
we get lots of inputs that change. By setting larger values of vary_r,
we can trade a bit of extra computation to get a mapping that is more
similar to the legacy behavior. This is useful for legacy clusters:
$ for f in `seq 1 4` ; do diff -u test-map-vary-r-0.t test-map-vary-r-$f.t | grep -c -- + ; done
3030
1629
645
228
The crushmap here comes from a user who was seeing a bad mapping for certain
pgs after some OSDs were reweighted by utilization.