Otherwise, we update the stat.stat structure, but not the
stat.invalid_stats part. This will result in a recently
split primary propogating the invalid stats but not the
invalid marker. Sending the whole pg_stat_t structure
also mirrors MOSDSubOp.
Fixes: #4557
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Remove now superfluous directory changes
that are causing tests to fail.
This code should have been removed when we transitioned
from running tests with Ant to using Java to run the tests.
Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Noah Watkins <noahwatkins@gmail.com>
The assertion failure reported in #4530 is triggered
by the following:
1. client sends request
2. mds sends unsafe reply
3. before request gets journaled, mds is killed
4. mds restarts
5. client receives session close (from close request before restart)
6. session close does kick_requests()
7. kick_requests tries to signal caller that doesn't exist.
This fix avoids signaling a caller if the unsafe reply
has been received and the make_request() function has completed.
We do this by setting the caller_cond to null once the caller
is woken up, and only signal the caller in kick_requests if
caller_cond is non-null. This avoids trying to resend requests
listed in mds_request but that have already received unsafe replies.
The unsafe requests are handled by resend_unsafe_requests() code,
so skipping those requests is allowable.
Fixes#4530.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
After changing the partition table, allow the udev event to be
processed before calling partprobe. This helps prevent partprobe
from getting a resource busy error on some platforms.
Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
Always increment the iterator when adding old pools
to the backtrace. This fixes a bug on files where
the layout had been set to a different pool and then
back to the same pool, causing continuous looping in
the build_backtrace() function.
Fixes#4537.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Split up the conditionals handling unsafe reply
and signaling the caller to improve readability.
The overall behavior of the code remains the same.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
If the mds sends a duplicate safe reply, the mds_requests
map won't contain a matching request id (tid). Instead of
assert failing, we log a message that we saw a reply without
a matching request.
Also remove redundant mds_requests->erase(tid) line.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
The client MetaRequest should always be cleaned up
and removed from the mds_requests map once the client
gets a safe reply. This patch avoids a leak where the
mds does not send back an unsafe reply and the request
is never cleaned up.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Once a safe reply is received, we remove the
request from the mds_requests map, so checking that
it might be a duplicate won't succeed. This patch
removes the got_safe checks in the reply handling code
and the got_safe field on the MetaRequest to avoid confusion.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Passing the result of c_str() to a function that takes
std::string as argument is slow and redundant.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fixes: #4508
Backport: bobtail
On certain bucket index operations we didn't check whether
the bucket was a system bucket, which caused the operations
to fail. This triggered an error message on bucket removal
operations.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Adds a few JNI utilities from the Android project (license: Apache) to
help with IP address conversions. These functions are also updated to
work in our environment (use Ceph exception utilities, edit header
paths).
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
On rename, only set the other inode if the
lookup for the destination succeeds, otherwise we hit
a segv in set_other_inode().
Fixes#4517.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Tested-by: Noah Watkins <jayhawk@cs.ucsc.edu>
Introduced by fc80c1dc6e,
the client should _not_ fail if the lookup for the
destination path on rename returns ENOENT.
The previous code also did not check that the lookup
returned ENOENT or success. We add the check and fail
if we get any other errors.
Fixes#4517.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Note if the cluster is degraded. If so, indicate specifically which MDSs
are degraded and what state they are in.
Signed-off-by: Sage Weil <sage@inktank.com>
We should clobber configuration and log data, but *not* user data. Leave
/var/lib/ceph alone.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
Make an 'unlink' mode of remove that will remove a link to a bucket but
not remove the bucket itself. This refactors remove_item[_under] and moves
some of the checks into common helpers where they are not duplicated. Fix
callers to pass the extra arg.
Signed-off-by: Sage Weil <sage@inktank.com>
Remove the bucket if there are no references left.
Remove the name from the map even if it is a bucket (not sure why that
condition was there in the first place!).
Signed-off-by: Sage Weil <sage@inktank.com>
This is (I think) the last missing piece to let you construct an entire
map via the CLI. The add/set commands will construct intervening ancestor
nodes provide there is an existing ancestor to stick them under, but this
is needed to create the initial root node.
Signed-off-by: Sage Weil <sage@inktank.com>