Rework Timer and SafeTimer to be more efficient and to handle shutdown
correctly. Document the API, especially what locks need to held where.
The destructor for both Timer and SafeTimer now joins the timer thread
safely. The shutdown() function is available to callers who want to join
it before the Timer is destroyed.
To make things more efficient, don't create a new std::set every time we
insert a Context. Use multimap instead. Don't signal the condition
variable unless the event we have insert comes before all the other
events in the scheduled map. Don't allocate an extra Context in
SafeTimer.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Fix a compiler warning about an uninitialized variable. Basically, we
used to insert uninitialized values into a std::multimap and then fix
them later. Rather than doing that, just insert the value we want
directly into the map.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
TestEncoding: add a templated encode-then-decode fn that can be used to
test encoding followed by decoding of any type. Test encoding and
decoding of a std::multimap.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Tue, 2 Nov 2010 18:10:38 +0000 (11:10 -0700)]
filestore: disable 'filestore btrfs snap' when SNAP_DESTROY is missing
We want to enable the new snap stuff by default. But we also want to work
with the default configuration on old kernels.
The only downside here is that someone might explicitly enable it, only to
have it disabled on started because their kernel is old. They'll get a
bright yellow warning in that case, at least.
The three modes each get an explicit config option that defaults to false.
You can choose one explicitly by enabling one of those. Otherwise, we
will choose an appropriate mode automatically based on detected btrfs
ioctls.
* Fix VPATH builds (i.e., builds where srcdir != builddir).
Don't assume that we can get a source files named blah with ./blah.
Use $(srcdir)/blah instead.
* When doing "make dist", inject the .git_version file directly into the
ceph tarball
* Add tools/gui_resources.h to noinst_HEADERS
* Add ceph_tool_gui_DATA to all_sources
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Fri, 29 Oct 2010 22:28:37 +0000 (15:28 -0700)]
osd: write potentially large pg info to object, not xattr [format change]
Write past_intervals and snap_collections to a separate object instead of
an attr on the collection directory. This avoids exceeding the underlying
filesystem xattr limits during thrashing recovery. The struct_v on the
small info xattr is used to indicate the format of the biginfo object.
Also fixed pg deletion to clean out log and biginfo objects.
Sage Weil [Fri, 29 Oct 2010 20:06:49 +0000 (13:06 -0700)]
mds: auth_pin head/snap pairs for all need_snapflush entries
This ensures that when snap metadata is flushed, we will be auth on both
inodes and be able to do the update properly. This isn't the nicest
solution ever, since it can make migrations laggy, but it's the simplest.
Make install now installs the gui resource files into
/usr/share/cephtool/gui_resources (or wherever we configure it to go
using configure). We also support grabbing the resources out of the
local source tree, for when we're running the program from there.
run_gui: catch exceptions and explain what they are, rather than letting
them go to the top level.
GuiMonitor::open_icon: const cleanup.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Michael McThrow [Wed, 27 Oct 2010 20:31:26 +0000 (13:31 -0700)]
Add the Ceph monitoring GUI
This adds a graphical monitoring mode to the ceph cluster monitoring tool. Its
functionality is similar to ./ceph -w. With ./ceph -g, you can watch over the
whole cluster graphically. It uses GTK2.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Sage Weil [Thu, 28 Oct 2010 21:54:56 +0000 (14:54 -0700)]
SubmittingPatches: initial version
Largely based on Linux's version. Includes the Signed-off-by stuff at
the top, and a bit more modern description of how to prepare/send patches
using git format-patch and send-email.
Greg Farnum [Thu, 28 Oct 2010 20:03:04 +0000 (13:03 -0700)]
mds: Migrator needs to add_dir_context all the way to root.
It was going to the default subtree root, which doesn't
work when we've just created a new subtree root out of the given dir!
Sage Weil [Thu, 28 Oct 2010 18:53:38 +0000 (11:53 -0700)]
objecter: refactor interface with object_locator_t
This paves the way for a locator that lets the user specify an arbitrary
string to hash for placement (instead of the object name). It also
captures everything that would affect placement (pool, preferred, etc.)
in a single type.
Just the client side; no server side or protocol changes yet.
Sage Weil [Mon, 25 Oct 2010 16:11:39 +0000 (09:11 -0700)]
osd: handle missing objects on snap read
The old check in handle_op doesn't work because we don't provide a snap
context on read, and we haven't loaded one off disk. Instead, handle
it in the pg queue worker. If find_object_context() returns EAGAIN, then
wait_for_missing_object.
Sage Weil [Fri, 22 Oct 2010 22:55:49 +0000 (15:55 -0700)]
client: fix dup entries in multifrag readdir
We need a next_offset of 0 for non-leftmost frags. Otherwise we set
our dentry offsets incorrectly and the next_offset we return to teh readdir
callback doesn't line up. This was causing the first readdir on a large
multifrag directory to duplicate the last two items.
Greg Farnum [Tue, 26 Oct 2010 19:39:25 +0000 (12:39 -0700)]
client: Initialize Inode::truncate_size to 0 instead of -1, and check prior_size
on truncation.
truncate_size needs to precisely match the defaults on the MDS, or we run into
problems when importing new inodes. No idea why it was previously set
to not match.
If we don't think the inode has any size, it doesn't need to truncate either.
This should fix #518.