Commit Graph

37443 Commits

Author SHA1 Message Date
Sage Weil
1e32e3bd82 ceph_test_rados_api_watch_notify: wait longer for osd to time us out
If cluster is thrashing this can fail.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-10 10:01:40 -08:00
Sage Weil
78eed527e7 ceph_test_rados_api_watch_notify: weak assert cookie is valid (it's a ptr)
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-10 10:01:40 -08:00
Sage Weil
6f43c6c53a osdc/Objecter: pass correct cookie value to error
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-10 09:44:01 -08:00
Sage Weil
8ed536e143 ceph_test_rados_api_watch_notify: fix signed/unsigend
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-07 10:36:17 -08:00
Sage Weil
45223d9a33 librados: mark new API watch/notify calls
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-07 10:36:07 -08:00
Sage Weil
dc67cd6960 rgw: switch to new watch/notify API
Note that we don't use it properly, yet!

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-05 18:00:04 -08:00
Sage Weil
a53dbabd76 librados:: carry IoCtx ref from WatchInfo
The WatchInfo gets totally async notifications.  Make sure our ioctx
ref is valid when that happens.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:21 -08:00
Sage Weil
a989fecea0 osd: allow deletion of objects with watchers
If we delete an object with a watcher, forcefully disconnect the watcher
instead of preventing the deletion with EBUSY.

Fixes: #2339
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:20 -08:00
Sage Weil
1c6944f79a osd/ReplicatedPG: do watch effects only when change commits
Do not tell the client their watch succeeded until it is durable and
visible to clients doing a notify.  This is less important in the initial
watch registration stage, but critical in the disconnect (and disconnect
+ reconnect) pipelining cases.

Simplify the watch_disconnects struct to have exactly the information
we need, and no more.  Note that the conn is not needed for disconnects
(and we don't have a req to provide one in the watch timeout op case).

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:20 -08:00
Sage Weil
1c5bba670b osd/ReplicatedPG: pass obc to OpContext ctor
We always set it, except for the handle_watch_timeout caller, which needs
to.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:20 -08:00
Sage Weil
6fa05dbf4a osdc/Objecter: queued_async() gets called inside watch_lock from caller
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:20 -08:00
Sage Weil
61fc317d72 librados: remove failed notify
Decided this wasn't useful.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:39:20 -08:00
Sage Weil
0a6128762d librados: s/handle/cookie/ in headers
Be consistent.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:38:53 -08:00
Sage Weil
f0614a109e ceph_test_rados_watch_notify: do not unwatch on invalid handle
It is not safe to call rados_unwatch on an undefined handle.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:37:22 -08:00
Sage Weil
27ceb16903 ceph_test_rados_api_watch_notify: test ENOENT case
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:37:22 -08:00
Sage Weil
1a36eb370d PendingReleaseNotes: a few notes about watch/notify changes
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:37:22 -08:00
Sage Weil
a824be974c test_async_driver: fix warning
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:06 -08:00
Sage Weil
7f8ffae88b osdc/Objecter: set last_error before async error event delivery
No reason to delay this.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:06 -08:00
Sage Weil
26440fd72d osdc/Objecter: use RWLock for watch_lock
This makes the linger_check fast path an RWLock read lock.  Drop the
unnecessary write lock on rwlock and drop the unused Cond.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
5c0a8c411f osdc/Objecter: make watch_check time reflect async delivery
When a librados user calls watch_check(), the age they get back should
establish a timestamp for which:

 1) we know that the watch was registered at least through this time,
 2) we have received and processed notifies sent as of this time,
 3) we have processed any async error events as of this time.

We already accomplish 1 by updating watch_valid_thru based on the time
the ping is sent (not received).

This patch gets us 2 and 3 by using the MIN of watch_valid_thru and the
oldest queued async event for the watch_check result.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
955a2f0ee9 osdc/Objecter: use recast LingerOp* as OTW cookie, too
This makes the OSD reply's cookie values match up with what the librados
users see.  And it makes life less confusing when debugging.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
14e933d2b0 librados: use (gid,cookie) to identify notify participants
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
5e99450858 librados: include missed watchers in notify reply data
Include a list of who missed their notify in the notify reply.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
32043a3839 encoding: multiset encode/decode
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
9d9e66e663 osd: rejigger watch connect/disconnect callers
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
88233696ff osdc/Objecter: ignore pings from previous registrations
If we have a ping in flight and then reregister (due to interval change
or whatever), ignore the result of the previous ping.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
45aaa340a9 osdc/Objecter: only reconnect watches; skip ack unless needed
Only watches get a RECONNECT op; lingers just get resent.

Only request an ACK in the non-watch reconnect case and when an ack
callback is specified.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
e8df077126 osdc/Objecter: drop ACK callback for watch
It is semantically useless.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
e72035f3f5 librados: move watch/notify into the Objecter
Several things here:
 - we move all of the junk from librados' RadosClient into Objecter
 - we use fast-dispatch to schedule the watch-notify events (this will
   keep them ordered wrt ping)
 - we use the LingerOp * as the librados-exposed handle so that we can
   avoid any lookups for watch-check.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
cd6a4aa9ee rados: break out notify replies by client
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
de9f18ddcc osdc/Objecter: take Finisher ref from creator
Only needed for watch/notify users, so most can pass NULL.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
8ec0af473e librados: use Objecter's linger_id as the cookie
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:05 -08:00
Sage Weil
34c9d72909 osdc/Objecter: spit out linger register step
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
5f90c20dd4 osdc/Objecter: expose LingerOp instead of linger_id
We want a reference-counted handle, not an id.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
889cd874e2 messages/MWatchNotify: print more nicer
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
03778502c2 librados: watch_check() to check on status of watch
Return either an accumulated error code, or the time since the watch was
last confirmed.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
8c867b8f77 ceph_test_rados: use new watch/notify API
Ignore error events for now; we are just stressing the OSD.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
42e4baa06a librados: unwatch doesn't need the oid argument
The handle is like a file handle: there is internal state that is getting
freed and the user needn't provide it again.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:34:04 -08:00
Sage Weil
85f336d5c8 rados: use new notify API
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:33:28 -08:00
Sage Weil
ea53983a9f librados: no need for '2' suffix in c++
Compiler disambiguates based on the rest of the signature.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:33:28 -08:00
Sage Weil
219f824894 librados: mark old rollback call deprecated
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:33:28 -08:00
Sage Weil
d3ec70ee13 librados: mark old watch calls deprecated
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:33:12 -08:00
Sage Weil
5e794c11c1 librados: mark old object listing api deprecated
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
1b6bcfe327 librados: mark old rollback method deprecated
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
6c83ec5733 librados: mark deprecated watch/notify methods with deprecated attribute
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
b5751947e1 scratchtoolpp: suppress deprecation warnings
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
cdc9f5f261 ceph_test_rados_api_watch_notify: test watch disconnect, reconnect
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
300131eaab osd: send watch DISCONNECT to client when a watch is removed
This is an explicit notification to the client that a watch is no longer
valid and needs to be re-registered.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
14cd71978b ceph_test_rados_api_watch_notify: reorder tests
Group by function, not language/pool type.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00
Sage Weil
a4eeaf5ad4 ceph_test_rados_api_watch_notify: drop 'Test' suffix
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-04 10:32:39 -08:00