Skip to content

Commit 2ee0068

Browse files
committed
Do not copy for both stores for now
It has a performance cost, and as the comment says we should be doing the better solution. We want to land this preparatory change on prod while the rest is still on staging, so we should just skip it for now. Skipping it will not affect regular fixed-output and input-addressed derivations, which are the only ones prod would deal with upon getting this code. The main CA derivations support branch will revert this commit so it still works.
1 parent 31ea645 commit 2ee0068

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

src/hydra-queue-runner/build-remote.cc

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -425,20 +425,6 @@ static void copyPathFromRemote(
425425
const ValidPathInfo & info
426426
)
427427
{
428-
// Why both stores? @thufschmitt says:
429-
//
430-
// > I think it's an easy (and terribly inefficient 😬) way of
431-
// making sure that `localStore.queryRealisations` will succeed
432-
// (which we IIRC we need later to get back some metadata about the
433-
// path to put it in the db).
434-
// >
435-
// > To be honest, we shouldn't do that but instead carry the needed
436-
// metadata in memory until the point where we need it (but that can
437-
// come later once we're confident that this is at least correct)
438-
//
439-
// TODO make the above change to avoid copying excess data back and
440-
// forth.
441-
for (auto * store : {&destStore, &localStore}) {
442428
/* Receive the NAR from the remote and add it to the
443429
destination store. Meanwhile, extract all the info from the
444430
NAR that getBuildOutput() needs. */
@@ -458,8 +444,7 @@ static void copyPathFromRemote(
458444
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
459445
});
460446

461-
store->addToStore(info, *source2, NoRepair, NoCheckSigs);
462-
}
447+
destStore.addToStore(info, *source2, NoRepair, NoCheckSigs);
463448
}
464449

465450
static void copyPathsFromRemote(

0 commit comments

Comments
 (0)