clear-queue-non-current: Work around PostgreSQL query optimizer stupidity

[?]
Jan 14, 2014, 5:14 PM
KEBKLMYZTP2Z5YLG5VKAX7URF72EJQNWN6JPCSCV2AZXBCCBKRTAC

Dependencies

  • [2] UOINKJ2J Add an action to cancel all builds in a jobset eval
  • [3] 67NFGL7D add links in admin page to clear queue (all non-running builds, and all non-running old (non-current) builds)
  • [4] R6B5CAFF Let Builds.timestamp refer to the time the build was added
  • [5] DETQRBBR clear_queue_non_current: Don't use isCurrent
  • [*] ZWCTAZGL added newsitems, added some admin options to clear various caches.

Change contents

  • replacement in src/lib/Hydra/Controller/Admin.pm at line 38
    [2.50][3.37:239](),[3.37][3.37:239]()
    { finished => 0, busy => 0
    , id => { -not_in => \ "select build from JobsetEvalMembers where eval in (select max(id) from JobsetEvals where hasNewBuilds = 1 group by project, jobset)" }
    [2.50]
    [2.51]
    { id => { -in => \ "select id from Builds where id in ((select id from Builds where finished = 0 and busy = 0) except (select build from JobsetEvalMembers where eval in (select max(id) from JobsetEvals where hasNewBuilds = 1 group by project, jobset)))" }