If the client reexports ceph via nfs, file creations come through as
a MKNOD followed by OPEN. If it's a MKNOD on a normal file, assume that
the client will probably write to it and set them up with the caps and
client_range to do so without asking us again first.
Signed-off-by: Sage Weil <sage@newdream.net>
It was only waiting for items in the op_queue to complete. The goal is
to wait for anything we've called queue_transactions(&osr,...) on. If we
do writeahead journaling, though, there might be new ops that are still
journaling but not yet submitted to the fs that are missed.
This adds a journal queue to the OpSequencer, and uses it in the writeahead
case only.
Signed-off-by: Sage Weil <sage@newdream.net>
common_init: avoid (mismatched) heap allocation
ConfFile::_parse: avoid memory leak on error path
ConfFile: NULL filename if not set, rather than leaving it undefined
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
This avoids two races:
- we just completed recovery by pushing objects to the replica, and the
replica starts scanning before those writes reach the fs.
- we just trimmed to something after last_update_applied.
Signed-off-by: Sage Weil <sage@newdream.net>
Eliminate calls to dout that use non-existent log levels, like negative
levels less than -1. Also trigger a compiler error in the future if they
get re-added. -1 is the highest priority dout level; putting lower
priorities into the output buffer will just cause errors.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
cmds: cerr -> derr
DoutStreambuf: primitive_log: just write to the stdout fd rather than cerr
assert: don't write output to stderr manually (dout will do that
automatically). Do _dout_lock.Lock rather than TryLock. Failing to wait
for the lock is potentially buggy and provides no benefit in that code.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
sub_op_scrub must set finalizing_scrub on the replica
before waiting for last_update_applied to catch up to
info.last_update.
Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
Use derr to announce errors in FileJournal.
Handle EINTR where necessary (still haven't fixed
read/write/pread/pwrite uses).
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Re-introduce derr as a special log level (level -1) which will show up
in all logs, and on stderr. These messages are the only messages which
will show up on stderr.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Li's revised interface for the async snap ioctl is more flexible. Update
the ioctl call sites and detection code accordingly.
Signed-off-by: Sage Weil <sage@newdream.net>
Otherwise, we could choose new stray dirs and fail to get all
the locks we needed (while leaving old strays locked forever!).
Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
Calling messenger->add_dispatcher_head() has the side-effect of starting
the messenger thread. So we must not do it before calling
messenger->start(), which sometimes calls daemonize.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
We need to detect when a pg mapping changes but the primary stays the same.
That means we can't just look at the final osdmap and see what is says; we
have to look at each intervening map and check each request to see if
something switched and the osd has thrown our request out.
Also refactor and clean up the linger vs normal op stuff some more.
Signed-off-by: Sage Weil <sage@newdream.net>
This is a big cleanup. Also
- switch to keeping per-osd Connection *'s
- make requests time out independently (not very efficiently yet)
Signed-off-by: Sage Weil <sage@newdream.net>
This will make observer crashes due to missed states (#648) much harder to
hit. Eventually the pgmap state trim problem will go away when the
monitor/paxos code is restructured (#647).
Signed-off-by: Sage Weil <sage@newdream.net>
Use Mutex::Locker to make logging exception-safe. That is, if you are
doing "dout() << foo() << dendl;" and foo throws an exception, the dout
mutex will not be left in a locked state.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Rename tools files to be more consistent. For example, the main()
function for ./ceph should be in ceph.cc.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>