On Thu, Jun 23, 2016 at 12:57:01PM +0100, 'Federico Morg Pareschi' via ganeti-devel wrote: > When the watcher runs on each node group, if it can obtain the group > lock, it submits a GROUP_VERIFY_DISKS job for each group. This happens > every 5 minutes due to a cron job. This patch stops the watcher from > submitting unnecessary verify disks jobs if there are some already > pending in the queue to prevent job congestion. > > Signed-off-by: Federico Morg Pareschi <m...@google.com>
Great. LGTM except for a tiny nit and a couple of lint warnings. I'll fix those up and push. Thanks, Brian. > + existing_jobs = _GetPendingVerifyDisks(cl, uuid) > + if existing_jobs: > + logging.info("There are verify disks jobs already pending (%s), skipping > " > + "VerifyDisks step for %s." % (existing_jobs, uuid)) > + return This will log something like "...jobs already pending (['68040']), skipping..." We can use utils.CommaJoin to avoid the extra punctuation. > op = opcodes.OpGroupVerifyDisks( > group_name=uuid, priority=constants.OP_PRIO_LOW) > op.reason = [(constants.OPCODE_REASON_SRC_WATCHER, > -- > 2.8.0.rc3.226.g39d4020 >