osd: make ms_handle_reset debug more useful

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
osd: break con <-> session cycle when marking down old peers

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
osd/ReplicatedPG: fix obc leak on invalid LIST_SNAPS op

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
msgr: generate reset event on mark_down to addr (not con)

If the caller is marking down an addr, they presumably don't have the
Connection* handy, so we should generate a reset event to help them
clean up con <-> session ref cycles.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: update docs for mark_down, mark_down_all semantics

* RESET events
* note that the reset detection only happens if it is enabled in the
  policy.

Signed-off-by: Sage Weil <sage@inktank.com>
msg/SimpleMessenger: remove duplicated interface docs

Document these in the interface, not the implementation; having two copies
clutters the header and invites them to get out of sync.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: break con <-> session ref cycle in mon even if shutting down

If we get a reset during shutdown, we should still break the cycle to avoid
tripping the valgrind leak detection.  Note that we are touching no
internal Monitor state here and the locking has not changed.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: mark_down session by con, not addr

We have the ConnectionRef here; use it.  This avoids generating a spurious
RESET event for the connection.

Signed-off-by: Sage Weil <sage@inktank.com>
client: mark_down by con

We have the con handy; use it.  This avoids generate a spurious RESET
event, which we do not need or do anything useful with.  Note that in this
case we are not attaching anything to the Connection priv field.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: mark addr-based [lazy_]send_message and get_connection deprecated

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: fix small leak

We need to delete the version_req_d here.

Signed-off-by: Sage Weil <sage@inktank.com>
rgw: fix bucket re-creation on secondary region

We had a problem with bucket recreation, where we identified
that bucket has already existed, but missed the fact that it's
the same bucket, so removal of the bucket index was wrong.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: forward x_amz_meta headers when forwarding a request

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: adjust error for bucket removal on secondary region

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: forward delete bucket request to master after removal

We can only forward the bucket removal to the master if it was
successfully removed locally.
The master region has no knowledge about whether the
bucket can be removed or not, e.g., there are still objects in the
bucket. If we send it to the master first, then it'll happily remove it
even though it might fail in the end.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: remove s->objv_tracker

was never initialized correctly anyway. It was only supposed to
be used for buckets, but it was never initialized in that case.
Using s->bucket_info.objv_tracker instead.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: bucket entry point object ver fixes

Multiple fixes:
 - sync master, secondary entry point ver on creation
 - use correct entry point version when removing entry point
 - check correct version on bucket removal

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix time parsing in replica log

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw-admin: link / unlink should report errors

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: replace logic that compares regions

The logic was a bit broken. Basically, we want to make sure
that region names are the same. However, if region name is not
set then we need to check whether it's the master region. This
can happen in upgrade cases where originally we didn't have
a region name set.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>