After uploading a .narinfo, add it to the LRU cache

[?]
Feb 20, 2016, 9:35 AM
RITB7JRKWI5CLS5FKLMKEVYZX7UJ5BKOLLVD7YDKMBPFPYLQ37BQC

Dependencies

  • [2] SOB276BA Keep some statistics for the binary cache stores
  • [3] MBZRPJTZ Fix log message
  • [4] GTUZLZRH Add an S3-backed binary cache store
  • [5] 73YR46NJ hydra-queue-runner: Write directly to a binary cache
  • [6] 3FQ65IXO hydra-queue-runner: Compress binary cache NARs using xz
  • [7] N2NKSKHS Refactor local binary cache code into a subclass
  • [8] 32HHP5CW hydra-queue-runner: Support generating a signed binary cache

Change contents

  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 53
    [4.930][4.930:957]()
    NarInfo narInfo(info);
    [4.930]
    [4.118]
    auto narInfo = make_ref<NarInfo>(info);
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 55
    [4.119][4.958:1041]()
    narInfo.narSize = nar.size();
    narInfo.narHash = hashString(htSHA256, nar);
    [4.119]
    [4.2885]
    narInfo->narSize = nar.size();
    narInfo->narHash = hashString(htSHA256, nar);
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 58
    [4.2886][4.1042:1117]()
    if (info.narHash.type != htUnknown && info.narHash != narInfo.narHash)
    [4.2886]
    [4.2947]
    if (info.narHash.type != htUnknown && info.narHash != narInfo->narHash)
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 62
    [4.149][4.1156:1188]()
    narInfo.compression = "xz";
    [4.149]
    [4.302]
    narInfo->compression = "xz";
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 66
    [4.403][4.1189:1278](),[4.185][4.1189:1278]()
    narInfo.fileHash = hashString(htSHA256, narXz);
    narInfo.fileSize = narXz.size();
    [4.403]
    [4.404]
    narInfo->fileHash = hashString(htSHA256, narXz);
    narInfo->fileSize = narXz.size();
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 71
    [4.524][3.0:41]()
    % narInfo.path % narInfo.narSize
    [4.524]
    [4.559]
    % narInfo->path % narInfo->narSize
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 76
    [4.3212][4.1279:1349](),[4.1349][2.204:240]()
    narInfo.url = "nar/" + printHash32(narInfo.fileHash) + ".nar.xz";
    if (!fileExists(narInfo.url)) {
    [4.3212]
    [2.240]
    narInfo->url = "nar/" + printHash32(narInfo->fileHash) + ".nar.xz";
    if (!fileExists(narInfo->url)) {
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 79
    [2.266][2.266:306]()
    upsertFile(narInfo.url, narXz);
    [2.266]
    [2.306]
    upsertFile(narInfo->url, narXz);
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 88
    [4.3431][4.1405:1450]()
    if (secretKey) narInfo.sign(*secretKey);
    [4.3431]
    [4.3518]
    if (secretKey) narInfo->sign(*secretKey);
  • replacement in src/hydra-queue-runner/binary-cache-store.cc at line 90
    [4.3519][4.665:715]()
    upsertFile(narInfoFile, narInfo.to_string());
    [4.3519]
    [2.491]
    upsertFile(narInfoFile, narInfo->to_string());
    {
    auto state_(state.lock());
    state_->narInfoCache.upsert(narInfo->path, narInfo);
    stats.narInfoCacheSize = state_->narInfoCache.size();
    }