On Sun, Jul 19, 2020 at 3:22 PM Liu, Changcheng <changcheng.liu@xxxxxxxxx> wrote: > > Hi all, > When the client writes to rbd image, it'll hold the "exclusive lock". > If the client dies abruptly without releaseing the "exclusive lock", > how the other client know that they could write to the rbd image? > > I write below program. If the first process/client died abrutply > (built with -DKILL_DEAD, send kill signal), the second > process/client(build without -DKILL_DEAD) could still write to the > rbd image. However, there's an abvious "time delay" that the second > client could write to the rbd image. > > Is there's a mechanism to watch/monitor that the "exclusive lock" is > released after the client, which hold it, died abruptly? Hi Changcheng, No, this time delay is it. Exclusive lock is built on RADOS watch/notify framework and the client is considered alive as long as its watch is present. When you kill the client, it stops responding to watch pings and the OSD times out the watch after 30 seconds. At that point the other client can break the lock (after adding the original client to the OSD blacklist). Thanks, Ilya _______________________________________________ Dev mailing list -- dev@xxxxxxx To unsubscribe send an email to dev-leave@xxxxxxx