diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-03-22 21:24:29 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-04-02 15:30:03 +0200 |
commit | d5365822cd7d574bc1bf87e1e1f876d88d88f3e0 (patch) | |
tree | c2068564f3d6c7f60b9881daa2e647d18b9eec1d /src/buildtool/storage/garbage_collector.cpp | |
parent | ba65c0978e2a6e72b73c0675b0c0f413872c3674 (diff) | |
download | justbuild-d5365822cd7d574bc1bf87e1e1f876d88d88f3e0.tar.gz |
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.
Diffstat (limited to 'src/buildtool/storage/garbage_collector.cpp')
-rw-r--r-- | src/buildtool/storage/garbage_collector.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<ObjectType::File>(latest_cas, digest)) { + return true; + } + } + return false; +} + auto GarbageCollector::GlobalUplinkTree(bazel_re::Digest const& digest) noexcept -> bool { // Try to find tree in all generations. |