Commit Graph

37443 Commits

Author SHA1 Message Date
Sage Weil
0601b5f908 ceph_test_rados_watch_notify: fix signed/unsigned warnings
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
2c6076b09f ceph_test_rados_api_watch_notify: verify notify after missed notify works
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
b4d769cf45 osdc/Objecter: fix whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
485daaba84 osdc/Objecter: factor out _send_op_account()
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
872012f1ae osdc/Objecter: skip ping if PAUSERD
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
f68fcc0f74 osdc/Objecter: objecter_inject_no_watch_ping
Tunable to prevent PINGs.  This will let us test paths the client gets
disconnected from the OSD (at least from the client's perspective).

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
b583152e83 osdc/Objecter: stop sending pings once we get an error
If we get ENOTCONN or ETIMEDOUT we can stop pinging.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
26e2fc7321 osd/Watch: set timeout event for new watchers
For a new watcher, we set the timeout event on connect, and reset it when
we get a ping.

For an old watcher, we continue to set the timeout on disconnect() and
rely on the msgr Connection reset.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
83189b07da make ping verify we are connected 2014-12-04 10:32:38 -08:00
Sage Weil
b76fc39a42 osdc/Objecter: only ping watches (not notifies)
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
1a82cc3926 osd, librados: distinguish between old and new watchers
Use a new watch op code that is different from the legacy one so we can
tell when the client is doing all the new stuff (like sending pings).

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
10ac629580 librados: tell watcher if we cause a notify timeout
If we are a watcher and we fail to notify in a timely manner, or
circumstances otherwise conspire to prevent out ack from arriving in time,
initiate a callback.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
7f00b722ef osd/Watch: inform watchers when they cause a notify timeout
If a watcher doesn't ack in time, let them know that they triggered a
notify failure.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
e0e90f71e4 librados: EINVAL on bad args to watch2
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
aa7ea5b9d8 librados: behave if errcb is NULL
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
7c8a1cd31f osd/Watch: drop redundant in_progress_watchers
This is essentially watchers.size() at all times and obfuscates the code.
In particular this makes the maybe_complete_notify() logic much clearer.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
66747c8bbd osd/Watch: fix comment typo
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
e8f36efd45 ceph_test_rados_api_watch_notify: verify we get the right # of notifies
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
29802bf5de ceph_test_rados_api_watch_notify: s/handle/cookie/
Use consist nameing for C and C++ tests.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
89e033c75b clean up CEPH_WATCH_EVENT_* namespace, and make COMPLETE distinct
Use a proper prefix and make a separate event for the notify completion
message.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
bdef13c952 osdc/Objecter: send regular PING ops
Send a full PING op to the object to ensure we are still connected. For
now just use the existing ping interval; we may want to change this in
the future.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
909bdbc5a7 osdc/Objecter: queue an error if reconnect fails
If we fail to reconnect, trigger the on_error (reusable) context to
let the user know about it.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
e424103301 osdc/Objecter: separate WATCH from RECONNECT
Use WATCH op for the initial registration.  This is idempotent in that
it will succeed whether the watch information has been persisted or not.
It is used by the client if it does not know that it is registered.

The RECONNECT op is used for any subsequent session reconnect.  It will
fail if the watch state isn't already persisted on the OSD.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
5e113ce2ea rados: improve watch command output
- hexdump the notify payload, and include all of the new metadata
- print error events too

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
22572a3977 librados: add infrastructure to deliver an error notification
Use a reusable context in the WatchNotifyInfo to trigger an error
event, delivered via the existing Finisher thread.  Re-lookup the cookie
in the thread to cope with races with unregister (just as we do with
notify events).

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:38 -08:00
Sage Weil
c973c93f3f librados: define error callback
This is the async notification of a watch error (failure to reconnect to
the object's OSD after a peering event or network disconnect).

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
97661e1a65 librados: remove crufty declaration
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
d44bd2b0c8 osd/ReplicatedPG: handle PING and RECONNECT watch ops
The ping will essentially assert that a watch is still valid.

A reconnect will reestablish session state *only* if the watch is
still persistent.  If not, it will fail (and the client will know it
may have missed something).

Note that the only difference here is that a PING is a bit lighter
weight; it will not reestablish the session state (which should already
be established).  We could use a single op here but the unique op
code makes the messages easier to understand and simplifies the code
path a bit for PING.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
2288f318e1 librados: define RECONNECT and PING watch ops
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
2e508d055e osdc/Objecter: fix assert_src_version
Don't use the add_watch() helper; do it like assert_version
does it.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
73720130c3 librados: use new watch op codes; simplify Objecter helpers
- drop the useless add_watch() helper; do it explicitly
- drop the unused var arg everywhere
- make a separate notify member of the union that excludes
  the other unused fields

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
0d6aa20d4f librados: define CEPH_OSD_WATCH_OP_*
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
6af4e1f68e librados: unconditionally pass WATCH_NOTIFY to legacy callback
This was always WATCH_NOTIFY; just pass that explicitly.  No need to
pay attention to what's in the message.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
6183dccd37 osd: allow multiple watchers/notify replies per client
It is perfectly valid to register multiple watchers via the same
librados client.  Make the notify_replies a multimap to capture all
of the acks.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
8b409d498e librados: include notifier's gid in notify
The notify replies include the identify of everyone who acked the
notify.  For symmetry, inform the notified client who sent the notify.

Fixes: #9198
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
e1a3bc8703 ceph_test_rados_api_watch_notify: test notify2 api
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
7589bfcc90 librados: update notify2 API to accept reply payloads
Allow the notify2 callers to provide bufferlists or char ** pointers
so that we can pass the reply buffer back to them.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
81cdff275a osd: implement notify ack payloads
If the notified send back reply payloads, pass them back to the notifier.

Note that we have changed the on-wire behavior of the watch completion
message a bit: instead of sending the original notify payload back to the
notifier, we send the map of notified to replies.  Note that only users of
the new API will know what to do with the notify acknowledgement
information.  At the same time, we stop sending the original payload.
However, the old API users never saw that data; we were uselessly sending
it over the wire.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
7e0c4efcd4 librados: define updated watch/notify interface
- new notify callback with the correct values:
  - notify_id
  - watch handle
  - payload
- new notify_ack call
  - not implicit when the callback returns (for new api only)
  - optional payload
- new watch2 call
  - that provides the new callback
- new notify2 call
  - with the right arguments, and optional timeout

A couple refactors in here:
- IoCtx notify_ack is now called unlocked (Note: this will soon change
  with pending Objecter locking changes)
- Objecter notify_ack takes a buffer

TODO:
- no timeout on the individual watch, yet...

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:37 -08:00
Sage Weil
12940c9f86 librados: drop useless ver arg to _notify_ack
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:31:46 -08:00
Gregory Farnum
96d06a5f5c Merge pull request #3076 from ceph/wip-mon-mdsdne
MDSMonitor.cc: fix assertion caused by MDSMap::STATE_DNE state

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2014-12-04 10:31:34 -08:00
Sage Weil
19e6c58622 Merge pull request #3072 from ceph/wip-10231-gperftools-location
heap_profiler: support new gperftools header locations

gitbuilders are happy

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-04 10:13:55 -08:00
Sage Weil
12098b4115 Merge pull request #3084 from ceph/wip-rados-include
librados: Fix rados include problem reported by "sponce"

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-04 10:11:18 -08:00
David Zafman
22c1d9b0cf librados: Fix rados include problem reported by "sponce"
Caused by a03f85a8e7

Signed-off-by: David Zafman <dzafman@redhat.com>
2014-12-04 10:06:30 -08:00
Sage Weil
f9c602a2ce Merge pull request #3059 from dachary/wip-10125-radosgw-init
rgw: run radosgw as apache with systemd

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-04 10:04:30 -08:00
Loic Dachary
7b621f4abf rgw: run radosgw as apache with systemd
Same as sysv.

http://tracker.ceph.com/issues/10125 Fixes: #10125

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-12-04 18:57:29 +01:00
Samuel Just
cad4edceda Merge pull request #2997 from ceph/wip-snapmapper
osd: require SNAPMAPPER feature; drop tolerate_collection_add_enoent

Reviewed-by: Samuel Just <sjust@redhat.com>
2014-12-04 09:30:44 -08:00
Samuel Just
a6a8aeaefb Merge pull request #2979 from ceph/wip-kill-category
osd: kill 'category' from pg_stats_t

Reviewed-by: Samuel Just <sjust@redhat.com>
2014-12-04 09:29:31 -08:00
Samuel Just
d212ced82b Merge pull request #2694 from dachary/wip-9728-jerasure-neon
erasure-code: jerasure support for NEON

Reviewed-by: Samuel Just <sjust@redhat.com>
2014-12-04 09:26:48 -08:00
Sage Weil
08aa6d3ee9 Merge pull request #3082 from scuttlemonkey/wip-doc-10247
Changed os-recommendation table sorting to remove implied bias.

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-04 09:25:40 -08:00