Previously, we returned NULL if the osd lacked the pool, but not if the
osd had the pool and lacked the pg. In that case, the assert in
_lookup_lock_pg would crash the osd.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>