From 62ceea46f33fe6a6704b40aaa2c980c8b29eff5e Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 19 Mar 2024 16:56:26 +0100 Subject: serve target: Fix sharding inconsistencies When running in single node, serve endpoint should not even consider sharding. Additionally, garbage collection uplinking should also take the shard into account. For this purpose, a TargetCache instance now remembers if it was explicitly sharded and passed that information to the GarbageCollector for uplinking. --- src/buildtool/main/build_utils.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/buildtool/main/build_utils.cpp') diff --git a/src/buildtool/main/build_utils.cpp b/src/buildtool/main/build_utils.cpp index 492e80d6..5b8d142d 100644 --- a/src/buildtool/main/build_utils.cpp +++ b/src/buildtool/main/build_utils.cpp @@ -83,15 +83,6 @@ auto CreateTargetCacheWriterMap( TargetCacheKey tc_key{key}; // check if entry actually needs storing if (not cache_targets.contains(tc_key)) { - // sanity check: if not in the map, then it must be in cache - if (not tc.Read(tc_key)) { - (*logger)( - fmt::format("Target-cache key {} is neither stored " - "nor marked for storing", - key.ToString()), - /*fatal=*/true); - return; - } // entry already in target-cache, so nothing to be done (*setter)(nullptr); return; -- cgit v1.2.3