Fix a bug that made it impossible to turn off logging to a file.
Remove the old "log_dir" setting. It has been deprecated for a long
time, and it adds a lot of complexity to the code.
heap_profiler: use the directory that log_file is in to construct a
profiler output file name. Don't use log_dir.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
The heartbeat start message comes from hbin messenger, which has no port
and a nonce of the pid (at startup). When we mark ourselves down/up, and
then resend a start, the peer will send a RESETSESSION and the stat
message will get lost, and then we'll miss heartbeats.
Mark down all connections, so that when we reconnect, our start message
is not lost.
Signed-off-by: Sage Weil <sage@newdream.net>
Only head inodes have caps. Don't set need_issue if it's not a head inode.
This is cleaner than bailing out of issue_caps(); we shouldn't get to that
point. The places that set need_issue = true usually set gather++ too,
which also shouldn't happen on a snapped inode.
Fixes: #1390
Reported-by: Damien Churchill <damoxc@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
If we are a replica, the 'flushing' means that we had dirty scatterlock
data and are waiting for it to get flushed out to the auth copy (by
cycling from MIX->LOCK, normally). If we end up with 'flushing' set
while in the MIX state, we can't wait for it to clear before responding
to a lock request from the primary or we'll deadlock.
On the auth, flushing means flushing to the log, which makes sense; that
will always make progress despite scatterlock activity.
This fixes a hang from 3-mds fsstress with thrashing exports. (Strangely
I never hit this on fatty.)
Signed-off-by: Sage Weil <sage@newdream.net>
AioBlockCompletions and read_iterate each had their own copy of this
code, leading to bugs when only one was changed. Move this to a
separate function, handle_sparse_read.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
The Client has a cache, but it is actually usually duplicating
what the kernel has in the page cache. Use the Client callback to do a
libfuse upcall to invalidate the kernel page cache when appropriate.
Usually people didn't notice this because we were invalidating the page
cache on every file open. Stop doing that.
This gives us:
- consistent multi-client semantics for open files
- fewer read calls because the kernel can (re)use the page cache more
effectively.
We are still double-caching. We probably want to be aggressive about not
caching any clean file data in Client from cfuse since the page cache does
a better job than we do.
Signed-off-by: Sage Weil <sage@newdream.net>
We want to truncate our cached data when the file size changes, not
when truncate_size does. This aligns us with the kernel implementation,
and it works when overwriting a file from multiple clients.
Signed-off-by: Sage Weil <sage@newdream.net>
These aren't strictly necessary now (you can just read the raw object or
do a writefull and get the same thing) but this way we document the format
and can change the backend to be smarter in the future without changing up
the interface.
Signed-off-by: Sage Weil <sage@newdream.net>
If we are a replica, the 'flushing' means that we had dirty scatterlock
data and are waiting for it to get flushed out to the auth copy (by
cycling from MIX->LOCK, normally). If we end up with 'flushing' set
while in the MIX state, we can't wait for it to clear before responding
to a lock request from the primary or we'll deadlock.
On the auth, flushing means flushing to the log, which makes sense; that
will always make progress despite scatterlock activity.
This fixes a hang from 3-mds fsstress with thrashing exports. (Strangely
I never hit this on fatty.)
Signed-off-by: Sage Weil <sage@newdream.net>