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>
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>
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>
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>
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>
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>
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>
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>
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>
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>