From d5365822cd7d574bc1bf87e1e1f876d88d88f3e0 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 22 Mar 2024 21:24:29 +0100 Subject: LargeBlobs: Uplink large objects. * Uplink parts of the large entry before entry itself; * Uplink large entries in LargeObjectCAS::GetEntryPath to not split things two times; * Promote spliced tree during uplinking of a large tree entry to properly promote parts of the tree; * Uplink large entries in LocalUplink{Blob, Tree} to support proper uplinking in Action Cache and Target Cache; Tested: * Uplink large blobs and trees; * Uplink a large object that depends on other large objects. --- src/buildtool/storage/garbage_collector.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/buildtool/storage/garbage_collector.cpp') diff --git a/src/buildtool/storage/garbage_collector.cpp b/src/buildtool/storage/garbage_collector.cpp index cfc6daf5..232c8ab8 100644 --- a/src/buildtool/storage/garbage_collector.cpp +++ b/src/buildtool/storage/garbage_collector.cpp @@ -72,6 +72,20 @@ auto GarbageCollector::GlobalUplinkBlob(bazel_re::Digest const& digest, return false; } +auto GarbageCollector::GlobalUplinkLargeBlob( + bazel_re::Digest const& digest) noexcept -> bool { + // Try to find large entry in all generations. + auto const& latest_cas = Storage::Generation(0).CAS(); + for (std::size_t i = 0; i < StorageConfig::NumGenerations(); ++i) { + if (Storage::Generation(i) + .CAS() + .LocalUplinkLargeObject(latest_cas, digest)) { + return true; + } + } + return false; +} + auto GarbageCollector::GlobalUplinkTree(bazel_re::Digest const& digest) noexcept -> bool { // Try to find tree in all generations. -- cgit v1.2.3