Sage Weil [Sat, 24 Sep 2011 22:19:31 +0000 (15:19 -0700)]
osd: drop map_cache_keep_from
The purpose here was to avoid trimming cached maps prior to what we have
on disk. However, now that we have the map_bl cache, this isn't needed:
anything after that epoch will come out of that cache.
Also, it was broken anyway--the value was never read. So clean it out!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Sage Weil [Sat, 24 Sep 2011 22:16:53 +0000 (15:16 -0700)]
osd: limit size of OSDMap cache
If we get way way behind on our maps, we may end up with a really large
OSDMap cache because we currently on trim old maps based on
oldest_last_clean, which may be way in the past. Avoid eating up gobs of
RAM by putting a ceiling on the cache size. It'll mean more disk IO in
those situations, but it also means that we'll only load up the old maps
that we actually need (not every single one).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Sage Weil [Sat, 24 Sep 2011 21:45:32 +0000 (14:45 -0700)]
osd: don't finish boot unless instance in map is really us
We were going BOOTING->ACTIVE as soon as we showed up in the map with the
same client_addr. Also verify that we were up_from an epoch after when
we started or rebound, to avoid the case where we rebind to the same
ports for client_addr (but maybe not others) and get caught in a rebind
loop.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Sage Weil [Mon, 19 Sep 2011 23:50:48 +0000 (16:50 -0700)]
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).
Sage Weil [Mon, 19 Sep 2011 21:00:59 +0000 (14:00 -0700)]
osd: clear need_up_thru in build_prior as appropriate
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>
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>
Sage Weil [Tue, 13 Sep 2011 04:23:00 +0000 (21:23 -0700)]
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.
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>
Sage Weil [Mon, 12 Sep 2011 02:19:32 +0000 (19:19 -0700)]
librbd: implement rbd buffered write window
Normal disks have a write cache and acknowledge writes before they reach
the platter. Among other things, this masks write latency. A flush
operation is needed when the user really cares that the writes are stable.
Implement a librbd write window that allows a window including the most
recent N bytes of writes to be immediately acked. An flush operation
blocks while they are pushed out to disk.
This differs from the typical disk in that writes are always immediately
sent to the backend store, while disks will buffer small writes for a time
(and, in fact, can be made to hold small writes in the cache indefinitely
under certain workloads).
Thus, 'rbd_writeback_window' may be a bit of a misnomer...
Currently this applies only to aio writes, not sync writes. That could
most easily be fixed by reimplementing write in terms of aio_write.
Sage Weil [Mon, 12 Sep 2011 01:58:42 +0000 (18:58 -0700)]
client: fix odd crash on rename
If the old_dentry is in the same dir, and it is the last dentry, we need
to keep the dir open.
This is hard to hit because the rename itself will typically instantiate
a null dentry on the target, and it's hard to construct a working where
a racing process makes us drop it. Fortunately this was triggered
reliably by the snaptest-git-ceph.sh workunit.
Fixes: #1519 Signed-off-by: Sage Weil <sage@newdream.net>
Samuel Just [Sat, 10 Sep 2011 04:39:27 +0000 (21:39 -0700)]
PG: generate backlog when confronted with corrupt log
Currently we throw out the log and start up anyway. With this change, we
would throw out the log, generate a fresh backlog, and then start up.
That may not be the best possible thing, but it's better than what we
currently do. Indirectly fixes #1502.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Tommi Virtanen [Fri, 9 Sep 2011 23:25:14 +0000 (16:25 -0700)]
man: Generate manpages from doc/man.
Keeping the generated files in version control lets us
support builds from scratch without requiring the full
documentation toolchain to be installed.
The files were just copied over from build-doc/output/man,
after a ./admin/build-doc call. When redoing this, also
take care to remove any roff output if a file was removed
from doc/man, and update Makefile.am.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
We were previously setting up a reference loop. But the only way
to get Sessions is via the Connection, so let's just give Sessions
the pointer, and give Connections a counted ref.
We can't do that if we're trying to be Valgrind-clean, so just
make the lock name part of the class.
As best I can tell, that ordered initialization is safe because
data members are initialized in the order they are declared. See eg
http://xenon.arcticus.com/c-morsels-initializer-list-execution-order