In 69321bf, EAGAIN changed behaviour to block indefinitely
rather than returning to user. Change the return for
`osd pool set` operations that are blocked by creating PGs
to return EBUSY instead of EAGAIN, so that they are excepted
from this blocking behaviour.
Signed-off-by: John Spray <john.spray@inktank.com>
There are several perils when splitting a cache pool:
- split invalidstes pg stats, which disables the agent
- a scrub must be manually triggered post-split to rebuild stats
- the pool may fill the OSDs during that period.
- or, the pool may end up beyond the 'full' mark and once scrub does
complete and the agent activate we may block IO for a long time while
we catch up with flush/evict
Make it a bit harder for users to shoot themselves in the foot.
Fixes: #8043
Signed-off-by: Sage Weil <sage@inktank.com>
strerror_r is not portable; on Gnu libc it returns char * and sometimes
does not fill in the supplied buffer. Use autoconf to test which
version this platform uses and adapt.
Clean up the random calls to strerror and strerror_r (along with all
their private little one-use buffers) and regularize the code to use
cpp_strerror almost everywhere. Where changed, any negation of the
error code is also removed, since cpp_strerror() will do that.
Note: some tools were using their own calls to strerror/strerror_r, so
will now get a (%d) in their output that wasn't there before; hence
the change to test/cli/monmaptool/print-nonexistent.t
Fixes: #8041
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Current the dup op checks happen in execute_ctx, long after we handle
cache ops or get the obc and (potentially) return ENOENT. That means that
object deletions and cache ops both aren't properly idempotent.
This is easy to fix by moving the check earlier in do_op.
Fixes: #8089
Signed-off-by: Sage Weil <sage@inktank.com>
If early reply is not allowed, MDS does not send reply to client immediately
after Locker::issue_new_caps adds new caps. So MDS can revoke the caps before
sending reply to client.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
MDCache::do_file_recover may call Locker::evel_gather, which may change
filelock to stable state. So we should authpin the inode (for unstable
lock state) first.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
We can get a query on a pg we still have but are no longer primary for. If
that happens, do not reply. The client will resend to the correct OSD
assuming it has the map. Send them the latest incremental so that we know
they know there is something new. We don't know the exact epoch they have,
unfortunately, because MCommand doesn't include it, but a newer inc is
enough to make them request the right incrementals from a mon. Eventually
they will figure it out and Objecter will resend the request to the
correct target.
It is possible we should include epoch in the MCommand message so that we
can do this mapping "correctly" (as in, the same way MOSDOp does). That
makes MCommand less general, though... a PG-specific command message might
be the most precise thing. Another day...
Fixes: #8085
Signed-off-by: Sage Weil <sage@inktank.com>
snap_rollback() is the same as selfmanaged_snap_rollback() but we want an
independent interface for pool snapshots. Should really take snapname
for consistency with other pool snapshot interfaces.
Signed-off-by: David Zafman <david.zafman@inktank.com>
Add C interface rados_ioctx_snap_rollback() and indicate that rados_rollback()
is deprecated.
Add C++ interface IoCtx::snap_rollback() and indicate that IoCtx::rollback()
is deprecated.
Modify snapshot test case to use new function names.
Signed-off-by: David Zafman <david.zafman@inktank.com>
If the object is missing on the primary, we need to fully populate the
missing_loc.needs_recovery_map. This broke with the recent refactoring of
recovery for EC, somewhere around 84e2f39c55.
Fixes: #8008
Signed-off-by: Sage Weil <sage@inktank.com>
We may get EAGAIN if the osd happens to be down, for example due to
thrashing. Try a few times and then give up.
Note that the other place we try to scrub we don't even check the return
value as we are poking ever pg in the pool. And the scrub commands get
lost due to any peering event, etc.
Signed-off-by: Sage Weil <sage@inktank.com>