-- A build is ordered by when it was asked, not when it finished (novox/hq 04-ISSUES/219). -- -- Two builds of one module can be in flight together — two merge plans a few minutes apart, each -- asking for everything standing on what it changed — and they finish in any order. Each build -- stands on the bases the mesh held when it was *asked*, so the one asked later is the newer one. -- The mesh ordered builds by `at`, which is when the outcome was recorded, and registered whatever -- it heard last: an older request that took longer replaced a newer one as what the module is, and -- the next push sent machines an image built on a base the mesh had already replaced. -- -- `build.asked` is when the build was requested, read from the correlation id the controller wrote -- (`build-`). Nullable: an id of any other shape says no request time, and such a -- build is placed where it was recorded, which is the order the mesh had before this. alter table build add column asked timestamptz; update build set asked = to_timestamp((substring(id from '^build-([0-9]{19})$'))::numeric / 1000000000) where id ~ '^build-[0-9]{19}$'; -- `module.built_asked` is when the build the module's registered manifest came from was asked, so -- a later-heard outcome of an earlier request is recorded and not registered. A manifest handed over -- by hand is a request made when it is handed over. Null for a module registered before this was -- kept: its next registration, whichever it is, sets it. alter table module add column built_asked timestamptz;