Commit Graph

16346 Commits

Author SHA1 Message Date
Sage Weil
a711f2935c osd: remove throttle_op_queue()
There are subtle annoying problems with throttling and requeueing, and
throttling at this particular point in the stack makes little sense
anyway.  We have

 - messenger queue.  throttled based on total bytes/payload
 - op_queue, throttled before we queue items.

There is no real value in throttling a message before checking whether it
is valid (sent to the right osd, etc.) or putting it on the op_queue,
where it will sit until a worker thread picks it up and processes it.

When we get an osd_map, for instance, we pause op_queue, requeue
everything on the op_queue for reprocessing, and do the map update, so
not having a load of messages on that queue doesn't hurt us.  It just
complicates requeueing in the throttle_op_queue case, and delays the
checks for non-existent PGs or misdirected requests.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-20 10:58:20 -07:00
Sage Weil
46cfda7b82 osd: preserve ordering when throttling races with missing/degraded requeue
When we delay an op because the op_queue is full, we can violate the op
order:

 - op1 comes in, waits because object is missing
 - op2 comes in, throttles on op queue
 - op1 is requeued (no longer missing)
 - queue drains, op2 happens
 - op1 happens

To avoid this, if we delay, requeue ourselves... after whatever else is
on the queue.

Fixes: #1490
Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-19 18:23:10 -07:00
Sage Weil
4fb3d34a40 osd: set reply version for dup requests
If we get a dup request, set the version in the reply.  That means the
client knows the client was successful and committed, and they know the
version.  They don't get anything else (e.g., data payload resulting from
mutations).

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-19 16:52:47 -07:00
Greg Farnum
9cd0b5d226 Merge branch 'wip-flock' 2011-09-19 10:40:45 -07:00
Greg Farnum
d440a67412 flock: clean up waiting records of a lock when adding it succeeds
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-09-19 09:48:13 -07:00
Greg Farnum
39970c0f65 flock: add a replay parameter to add_lock
Only insert locks into the waiting lost when NOT replaying
an already-attempted lock.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-09-19 09:47:37 -07:00
Tommi Virtanen
d64237a6a5 ceph_common.sh: Do not sudo to root unless needed
Using do_root_cmd() doesn't really need to sudo to root
if you're already root.

Commit 71dc75bdaf causes a regression:
when system "foo" has a sudoers config that requires a tty,
init-ceph now fails like this:
  sudo: sorry, you must have a tty to run sudo

when it is invoked by root with something like this:
   ssh foo /etc/init.d/init-ceph start

Signed-off-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-19 09:47:11 -07:00
Greg Farnum
ea6986a501 flock: move operator<<() to flock header, remove extra line
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-09-19 09:37:40 -07:00
Greg Farnum
3e3c0baea2 flock: remove doubled debug output
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-09-19 09:20:10 -07:00
Sage Weil
375b8f76b9 fix .gitignore for test_addrs 2011-09-18 18:30:37 -07:00
Sage Weil
7c5a216856 test/test_addrs: unit tests for addr parsing
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-09-17 15:19:40 -07:00
Wido den Hollander
362dea30bb Remove various unused variables
Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-09-17 10:27:36 -07:00
Sage Weil
b6f4de41f9 msgr: parse ipv6 addresses without []'s
inet_pton() is annoying.  Be less lazy and work around it.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-09-16 21:59:46 -07:00
Colin Patrick McCabe
cb7f5534f0 doc/dev/logs.rst: Add performance counter writeup
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-16 15:43:47 -07:00
Colin Patrick McCabe
89c06e71f4 doc: Add section about changing config values
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-16 15:41:13 -07:00
Yehuda Sadeh
7d3aa0e558 osd: use target obj locator for source object if empty 2011-09-16 11:25:42 -07:00
Sage Weil
0d46f06b4b conf: allow ; as a list separator
Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-15 13:36:01 -07:00
Colin Patrick McCabe
3552878984 Merge branch 'wip-1477' 2011-09-14 16:05:42 -07:00
Colin Patrick McCabe
2981ccadb3 Make g_conf constant for all conf variable types
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 15:25:46 -07:00
Colin Patrick McCabe
dd01df7612 const-ify integer config values
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 14:54:35 -07:00
Colin Patrick McCabe
a052c2e450 config: define config vars once in config_opts.h
Rather than defining configuration variables twice, define them once in
config_opts.h. This makes it easier to work with them.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 13:31:56 -07:00
Samuel Just
ec992be48e init-ceph.in: change init script status output
Per Kyle Bader's suggestion: add $name: to the status output.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-09-14 11:16:10 -07:00
Colin Patrick McCabe
18e5be3c46 FileStore: use config observers
Use config observers to avoid thread-safety and performance problems in
FileStore.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 10:46:46 -07:00
Colin Patrick McCabe
c704b5274e cfuse.cc: use apply_changes API
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 10:46:46 -07:00
Colin Patrick McCabe
1312f18f44 testmsgr.cc: use set_val / apply_changes
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 10:46:46 -07:00
Colin Patrick McCabe
6a4a707cdd osd/OSD.cc: use set_val / apply_changes API
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 10:46:46 -07:00
Tommi Virtanen
668afd7d33 doc: Typo.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-14 10:42:11 -07:00
Colin Patrick McCabe
95a3845bd8 Fix double dash handling
Several functions examine argv in order to set options. Only the last
argument parsing pass should remove the '--' from the argument vector.
If it is removed earlier than that, entries may be parsed as options,
when that was not the user's intent.

This changes fixes the common argument parsing loops so that they do not
remove the double dash. It also rearranges some programs so that the
user's argument parsing loop comes last, rather than coming before the
common argument parsing loops.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 09:56:39 -07:00
Colin Patrick McCabe
ffe844aeb6 mds/MDS.cc: don't crash on bad injectargs
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-14 09:44:50 -07:00
Tommi Virtanen
2f3cfa174a doc: Instructions how to build RPMs.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-14 08:58:03 -07:00
Tommi Virtanen
b68eaf1875 doc: Say "radosgw" not "rgw".
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-14 08:42:06 -07:00
Tommi Virtanen
ecd368c230 doc: Shrinking of MDSes is not supported yet.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-14 08:42:06 -07:00
Yehuda Sadeh
ee6126bbfa Makefile.am: fix test_librbd 2011-09-14 00:08:40 -07:00
Colin Patrick McCabe
e86f3bdad8 osd/OSD.cc: don't crash on incorrect injectargs
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-13 14:38:19 -07:00
Samuel Just
6c81960e15 PG: fix typo in PgPriorSet constructor
down.insert(o) rather than down.insert(0)

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-09-13 14:40:56 -07:00
Colin Patrick McCabe
5b57fb635c tools: fix compile
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-13 13:40:43 -07:00
Colin Patrick McCabe
9a0f55d1b2 Get rid of silly unused parameter
Apparently we were passing a string to the function so it could do:
rs = rs;

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-13 13:34:59 -07:00
Sage Weil
8e141f4a26 monclient: reopen session on monmap change
If our cur_mon is removed from the monmap, reopen the session.  Do not
call _pick_new_mon() directly or we won't reset state, won't
reauthenticate, etc.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 21:23:00 -07:00
Sage Weil
613e906e22 monclient: use cur_con throughout
We choose a monitor and open a connection in exactly two places.  Use
cur_con and cur_con->get_peer_addr() everywhere else.

Simplify and clean up handle_monmap a bit.

Also add an assert to catch #1534.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 21:07:54 -07:00
Sage Weil
691794f129 msgr: send_keepalive to a Connection
This avoids the lookup, if we already have a reference.  Mirrors the
send_message() Connection variant.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 20:54:06 -07:00
Greg Farnum
7564035c8f test_librbd: remove unsigned/signed comparison
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-09-12 16:02:43 -07:00
Tommi Virtanen
37f1b96922 librbd: Update .gitignore after moving to gtest.
Commits e2ec946858
and 5cb7b3729b
changed the names of binaries created, ignore the
new name or "make distcheck" will whine.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-09-12 15:14:03 -07:00
Colin Patrick McCabe
f74f603d2a get_*_compat_set: get ctor param ordering right
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-12 14:31:18 -07:00
Samuel Just
9a1e13cf73 PG: assemble backlog directly rather than queueing on corrupt log
The queue responsible for calling generate_backlog hasn't actually been
started at that stage of startup.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-09-12 14:08:41 -07:00
Sage Weil
6228389df8 qa: add test_librbd workunit
Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 14:01:46 -07:00
Colin Patrick McCabe
e84996de69 Remove global ctors/dtors for CompatSet
Instead of having global CompatSet objects, just have functions that can
return appropriate CompatSet objects. This avoids global constructor
and destructor ordering issues.

Fixes bug #1512

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-09-12 11:38:10 -07:00
Sage Weil
923c60c588 librados: add conf_parse_env()
With optional env var name, defaults to CEPH_ARGS.

Parse it for librados and librbd api gtests.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 10:56:37 -07:00
Sage Weil
5cb7b3729b librbd: move c++ tests to gtest
Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-12 10:55:08 -07:00
Sage Weil
e2ec946858 librbd: convert C tests to gtest
Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-11 21:35:21 -07:00
Sage Weil
9b6f3e1679 librbd: rev LIBRBD_VER_EXTRA for rbd_flush() addition
This allows qemu driver to conditionally call it if it exists.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-09-11 20:14:01 -07:00