This is pretty limited; if you get multiple errors in one batch
of probes it'll only return the last one to get sent back (ENOENT is
excluded). But it's better than nothing.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Re-enable the proflogger test. This time, it doesn't test the basic
socket functionality (that is what test/admin_socket.cc is for).
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
In most cases we don't end up in this branch because there's an escape
if you already have an auth_pin on the ref in question. But when
you've got snapshots going on, you can process the request, block on
a lock state change, commit a snapshot change to the inode, and then
try to process the request again. On this second attempt, though,
you end up with a different ref which you don't have a pin on.
Deadlock and breakage ensues!
To fix, drop all locks and auth pins when you wait -- either
you don't have any to drop anyway, or you've got them on a previous
version of the inode that isn't useful anymore.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously we set mseq=0 unconditionally; this was a mistake that
creeped in via bitrot. Instead, set mseq from the auth cap.
This bug meant that any inodes which had gotten migrated between
MDSes would have their flush_snap messages dropped by the MDS.
Resolves#1324.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We may have subtrees split locally due to migrations that are just getting
started or stopped. Simplify the map we journal to disk. Among other
things this makes the replay check simple (it can compare against the
current "live" map).
Signed-off-by: Sage Weil <sage@newdream.net>
If there is an rmdir with an empty subtree on another mds, we need to witness/
journal that on the dirfrag's auth mds so that replay correctly updates the
subtree map.
This is simpler than the rename witnesses (and the link/unlink ones) because
we aren't actually journaling a modification to any actual metadata; it's just
the subtree map that is changing.
The projection of the subtree map update needs work still, but that is also the
case for renames.
Signed-off-by: Sage Weil <sage@newdream.net>
ceph pg force_create_pg <pgid> will now reset that pg's status to
creating to handle corner cases where no osd has that pg.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Technically, JSON always uses double quotes, even though Javascript
often uses single quotes for strings. Also add a comma that had been
omitted.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
There was some seriously wrong and ancient cruft in there. open(2)
specifies that one of O_RDONLY, O_WRONLY, and O_RDWR must always be
specified. Drop all the crazy.
Linux VFS interprets O_WRONLY|O_RDWR as read+write, so we'll do the same.
Signed-off-by: Sage Weil <sage@newdream.net>
Currently
fd = open("aaa",O_RDWR|O_CREAT|O_APPEND,0666);
gives us fmode of 1 instead of 3. We should only infer O_WRONLY if no
other mode is explicitly specified.
Reported-by: Fyodor Ustinov <ufm@ufm.su>
Signed-off-by: Sage Weil <sage@newdream.net>
Introduce a new configuration variable, internal_safe_to_start_threads.
This will be set by common_init_finish once it is safe to start threads.
That will trigger callbacks for any configuration observers listening
for this event.
This is used by ProfLogger to hold off on starting the UNIX domain
socket thread until it is safe to do so.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Test multiple profloggers, and removing profloggers.
Add a clear function which removes all profloggers.
Make the order in which profloggers are output to JSON determininstic.
Const cleanup on get() methods.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Test JSON formatting a bit. Use single quotes in our JSON because that
seems to make things easier.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
When we're exiting normally, we ought to unlink our UNIX domain sockets.
Also fix a bug in ProfLogThread, and enable some more tests.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>