Skip to content
  • Iustin Pop's avatar
    Implement lockless query operations · ec79568d
    Iustin Pop authored
    This patch adds the framework for, and enables lockless OpQueryInstances. This
    means that instances will be shown in ERROR_up or ERROR_down state, even though
    this is not an error (but just an in-progress job).
    
    The framework is implemented as follows:
      - the OpQueryInstances, OpQueryNodes and OpQueryExports opcodes take
        an additional “use_locking” flag which will denote whether to lock
        or not; this patch only implements this for LUQueryInstances
      - the luxi query functions take an additional argument use_locking
        which is passed to the master daemon, and then passed to the above
        opcodes
      - cli.py export a new SYNC_OPT command line options which implement
        setting this flag to true
      - except for gnt-instance list, which uses this option, and for
        name-only queries (e.g. QueryNodes(fields=["names"])), all other
        callers are setting this flag to True
      - RAPI also sets the flag to True
    
    The patch was tested with a continuous (0.2s sleep in-between)
    gnt-instance list during a burnin, and no problems were observed.
    
    Reviewed-by: ultrotter
    ec79568d