Skip to content
Snippets Groups Projects
  1. Jul 14, 2008
    • Iustin Pop's avatar
      Improve cli.SubmitOpCode · e2212007
      Iustin Pop authored
      Currently, the feedback_fn argument to SubmitOpCode is no longer used.
      We still need it in burnin, so we re-enable it by making the code call
      that function with the msg argument in case feedback_fn is callable. The
      patch also modifies burnin to accept the new argument format (msg is not
      a triple instead of a string).
      
      The patch also removes the ‘proc’ argument as it's obsolete; instead we
      can accept a luxi.Client instance (noone uses this right now).
      
      Reviewed-by: ultrotter
      e2212007
    • Iustin Pop's avatar
      First version of user feedback fixes · f1048938
      Iustin Pop authored
      This patch contains a raw version for fixing feedback_fn.
      
      The new mechanism works as follows:
        - instead of a per-Processor feedback_fn, there's one for each
          ExecOpCode, so that feedback for different opcodes go via possibly
          different functions
        - each _QueuedOpCode gets a message buffer, a method for adding
          feedback and a method for retrieving (parts of) the feedback
        - the _QueuedJob object gets a new attribute that is equal to the
          index of the currently executing opcode
        - job queries get an extra parameter called 'ticker' that will return
          the latest message on the current executing opcode
        - the cli.py job completion poll will show the new status if different
          from the old one
      
      Of course, quick messages will be lost, as currently only the latest one
      is available. Also changes between opcodes are not represented at all.
      
      Reviewed-by: imsnah
      f1048938
    • Iustin Pop's avatar
      Cache some jobs in memory · ac0930b9
      Iustin Pop authored
      This patch adds a caching mechanisms to the JobStorage. Note that is
      does not make the memory cache authoritative.
      
      The algorithm is:
        - all jobs loaded from disks are entered in the cache
        - all new jobs are entered in the cache
        - at each job save (in UpdateJobUnlocked), jobs which are not
          executing or queued are removed from the cache
      
      The end effect is that running jobs will always be in the cache (which
      will fix the opcode log changes) and finished jobs will be kept for a
      while in the cache after being loaded.
      
      Reviewed-by: imsnah
      ac0930b9
    • Iustin Pop's avatar
      Fix JobStorage._GetJobIDsUnlocked · 8a70e415
      Iustin Pop authored
      The job ID returned must be an integer (and the regex enforces that),
      but we didn't convert it manually.
      
      Reviewed-by: imsnah
      8a70e415
    • Iustin Pop's avatar
      Change JobStorage to work with ids not filenames · 911a495b
      Iustin Pop authored
      Currently some of the functions in JobStorage work with filenames (which
      is an implementation detail and should only be used when dealing with
      the storage) and not with job IDs. We need to change this in order to
      implement a job cache.
      
      Reviewed-by: ultrotter
      911a495b
  2. Jul 11, 2008
  3. Jul 10, 2008
  4. Jul 09, 2008
    • Iustin Pop's avatar
      Fix double-logging in daemons · ff5fac04
      Iustin Pop authored
      Currently, in debug mode, both the logfile handler and the stderr
      handler will log debug messages. Since the stderr is redirected to the
      same logfile (to catch non-logged errors), it means log entries are
      doubled.
      
      The patch adds an extra parameter to the logger.SetupDaemon() function
      that allows disabling of the stderr logging. The master and node daemon
      will use this to enable stderr logging only when running in foreground.
      
      Reviewed-by: imsnah
      ff5fac04
    • Iustin Pop's avatar
      ganeti-noded logging improvements · c89189b1
      Iustin Pop authored
      The patch adds some more logging to the node daemon:
      
      - log methods at beggining not only at the end
      - log method parameters (they are very verbose, but useful)
      
      A separate change is to initialize the global variable in the global
      scope, not inside main().
      
      Reviewed-by: imsnah
      c89189b1
    • Iustin Pop's avatar
      Fix utils.py unittest · e5392d79
      Iustin Pop authored
      Reviewed-by: imsnah
      e5392d79
    • Iustin Pop's avatar
      Move the master socket in the ganeti run dir · 68676a00
      Iustin Pop authored
      ... as it was intended from the beggining, but by mistake left in the
      top run dir.
      
      Reviewed-by: ultrotter
      68676a00
    • Iustin Pop's avatar
      Reduce duplicate Attach() calls in bdev · cb999543
      Iustin Pop authored
      Currently, the 'public' functions of bdev (FindDevice and
      AttachOrAssemble) will call the Attach() method right after class
      instantiation.
      
      But the constructor itself calls this function, and therefore we have
      duplicate Attach() calls (which are not cheap at all).
      
      The patch introduces a new 'attached' instance attribute that tells if
      the last Attach() was successful. The public functions reuse this so
      that we only do the minimum required number of calls.
      
      Reviewed-by: imsnah
      cb999543
    • Iustin Pop's avatar
      Convert bdev.py to the logging module · 468c5f77
      Iustin Pop authored
      This does not enhance in any way the messages; it just switches to the
      new module.
      
      Reviewed-by: imsnah
      468c5f77
    • Iustin Pop's avatar
      Convert utils.py to the logging module · bb698c1f
      Iustin Pop authored
      The patch also logs all commands executed from RunCmd when we are at
      debug level.
      
      Reviewed-by: imsnah
      bb698c1f
    • Iustin Pop's avatar
      Remove the old locking functions · d4fa5c23
      Iustin Pop authored
      This removes (hopefully) all traces of the old locking functions and
      uses.
      
      Reviewed-by: imsnah
      d4fa5c23
    • Michael Hanselmann's avatar
      Remove old job queue code · 2467e0d3
      Michael Hanselmann authored
      Reviewed-by: iustinp
      2467e0d3
    • Michael Hanselmann's avatar
      Change masterd/client RPC protocol · 0bbe448c
      Michael Hanselmann authored
      - Introduce abstraction class on client side
      - Use constants for method names
      - Adopt legacy function SubmitOpCode to use it
      
      Reviewed-by: iustinp
      0bbe448c
    • Michael Hanselmann's avatar
      Make luxi RPC more flexible · 3d8548c4
      Michael Hanselmann authored
      - Use constants for dict entries
      - Handle exceptions on server side
      - Rename client function to CallMethod to match server side naming
      
      Reviewed-by: iustinp
      3d8548c4
    • Michael Hanselmann's avatar
      Instantiate new job queue in master daemon · 50a3fbb2
      Michael Hanselmann authored
      Reviewed-by: iustinp
      50a3fbb2
    • Michael Hanselmann's avatar
      Add very simple job queue · e2715f69
      Michael Hanselmann authored
      Reviewed-by: iustinp
      e2715f69
  5. Jul 08, 2008
    • Guido Trotter's avatar
      Add a more comment lines to testLockingConstants · b10b9d74
      Guido Trotter authored
      This is to discourage even more whoever may think that this requirement
      is not really useful and can be lifted, and to at least know where it's
      used before trying to break it.
      
      Reviewed-by: imsnah
      b10b9d74
    • Guido Trotter's avatar
      Convert LUTestDelay to concurrent usage · fbe9022f
      Guido Trotter authored
      In order to do so:
        - We set REQ_BGL to False
        - We implement ExpandNames
      
      That's it, really.
      
      Reviewed-by: iustinp
      fbe9022f
    • Guido Trotter's avatar
      Processor: Acquire locks before executing an LU · 68adfdb2
      Guido Trotter authored
      If we're running in a "new style" LU we may need some locks, as required
      by the ExpandNames function, to be able to run. We'll walk up the lock
      levels present in the needed_locks dictionary and acquire them, then run
      the actual LU. LUs can release some or all the acquired locks, if they
      want, before terminating, provided they update their needed_locks
      dictionary appropriately, so that we know not to release a level if they
      have already done so.
      
      Reviewed-by: iustinp
      68adfdb2
    • Guido Trotter's avatar
      LogicalUnit: add ExpandNames function · d465bdc8
      Guido Trotter authored
      New concurrent LUs will need to call ExpandNames so that any names
      passed in by the user are canonicalized, and can be used by hooks,
      locking and other parts of the code. This was done in CheckPrereq
      before, but it's now splitted out, as it's needed for locking, which in
      turn CheckPrereq needs. Old LUs can be converted gradually.
      
      Reviewed-by: iustinp
      d465bdc8
    • Guido Trotter's avatar
      Processor: Move LU execution to its own method · 36c381d7
      Guido Trotter authored
      This makes the try...finally code simplier, and helps adding a more
      complex locking structure before the actual execution. It also fixes a
      concurrency bug caused by the fact that write_count was read before
      acquiring the BGL, and thus spurious config update hooks run could have
      been triggered. This doesn't solve the issue of running config update
      hooks for concurrent LUs.
      
      Reviewed-by: iustinp
      36c381d7
    • Guido Trotter's avatar
      Add a new LockSet unittest · 2e1d6d96
      Guido Trotter authored
      This test checks the LockSet behaviour when an empty list is passed.
      The current behaviour is expected, but since this is a corner case,
      we're safer to keep it under a check, and if we need a different one
      monitor that everything is as we expect it to be.
      
      Reviewed-by: imsnah
      2e1d6d96
Loading