khemraj / sanlock

Forked from sanlock 2 years ago
Clone

e0ee4ea sanlock: lockspace host events

Authored and Committed by teigland 10 years ago
    sanlock: lockspace host events
    
    Hosts can set/get events between each other using a common lockspace.
    . set_event takes two opaque 64 bit values ("event" and "data"), and
      a target host_id with optional host generation.
    . reg_event creates an fd that a program can use in poll(2), and
    . get_event on this fd returns the event values that have been set
      along with the source host_id/generation.
    . end_event releases the registered fd.
    
    Each set_event call replaces generation/event/data values from the
    previous set_event call, but host_id's from each are maintained.
    
    set_event can be used to send the same event/data values to multiple
    hosts at once using multiple set_event calls (generation is not
    applicable in this case.)
    
    set_event with different values within the same window of time results
    in -EBUSY (unless the REPLACE flag is used).  Otherwise, the second
    set_event may result in the earlier target host(s) seeing later values
    not intended for them, and missing the earlier values from the first
    set_event.
    
    Event values are passed through fields in the lockspace delta leases.
    Event notification is done via the host_id bitmaps in lockspace delta
    leases.  Setting an event (or making a resource request) for a target host
    results in the target host's bit being set in the sending host's bitmap.
    The bit remains set for set_bitmap_seconds (60 sec with 10 sec io
    timeout.) After this, the bit is cleared and the target host will no
    longer be notified.  The target host will typically generate three events
    for each set_event, once from each delta lease renewal (every 20 seconds)
    over the course of the set_bitmap_seconds.
    
    Signed-off-by: David Teigland <teigland@redhat.com>
    
        
file modified
+1 -0
file modified
+217 -9
file modified
+100 -1
file modified
+8 -0
file modified
+1 -0
file modified
+1 -0
file modified
+1 -1
file modified
+300 -11
file modified
+6 -2
file modified
+31 -3
file modified
+2 -0
file modified
+51 -0
file modified
+3 -0
file modified
+26 -5
file modified
+7 -0
file modified
+80 -0
file modified
+19 -2
file modified
+14 -0
file modified
+3 -1
file modified
+1 -1
file modified
+7 -2
file added
+105