If you call copy_after(..., 0) on a log with a backlog, you get all the
backlog entries, but no backlog flag. That's invalid. You either need
the _complete_ backlog + the flag, or no backlog entries; getting only
some of them is useless information.
Make copy_after stop when it hits the tail. Callers who need the backlog
are already checking for that and copying the whole log as appropriate.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If the dir is supposed to be empty and we are setting I_COMPLETE, empty
it out and close it. This ensures we don't return bad results on a
subsequent readdir().
_Maybe_ related to #1509.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
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>
If mon+osd+client are on the same machine, sync() can deadlock. Setting it
to 0 disables the big sync. And the cutoff is now tunable.
Signed-off-by: Sage Weil <sage@newdream.net>
All that common_init_finish() does is indicate that we're done initializing
and we're allowed to start up extra threads and do the wonky things that
daemons like to do (like set up the admin socket). Since cconf is just
examining the config, we don't want to do any of that.
Signed-off-by: Sage Weil <sage@newdream.net>
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>
The only time need_up_thru is cleared is in the Peering state AdvMap
handler, but it doesn't get called if prior_set_affected() and we go
into build_prior(). Build_prior() sets need_up_thru if it's needed, but
it doesn't clear it if its not, which means the pg never goes active.
Reported-by: Sam Lang <samlang@gmail.com>
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>