aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver')
-rw-r--r--src/zenserver/buildstore/httpbuildstore.cpp21
-rw-r--r--src/zenserver/zenserver.cpp27
-rw-r--r--src/zenserver/zenserver.h1
3 files changed, 29 insertions, 20 deletions
diff --git a/src/zenserver/buildstore/httpbuildstore.cpp b/src/zenserver/buildstore/httpbuildstore.cpp
index bcec74ce6..3e1bc4203 100644
--- a/src/zenserver/buildstore/httpbuildstore.cpp
+++ b/src/zenserver/buildstore/httpbuildstore.cpp
@@ -266,7 +266,7 @@ HttpBuildStoreService::PutMetadataRequest(HttpRouterRequest& Req)
BlobsArrayIt++;
MetadataArrayIt++;
}
- m_BuildStore.PutMetadatas(BlobHashes, MetadataPayloads);
+ m_BuildStore.PutMetadatas(BlobHashes, MetadataPayloads, &GetSmallWorkerPool(EWorkloadType::Burst));
return ServerRequest.WriteResponse(HttpResponseCode::OK);
}
@@ -484,7 +484,7 @@ HttpBuildStoreService::BlobsExistsRequest(HttpRouterRequest& Req)
ResponseWriter.BeginArray("metadataExists"sv);
for (const BuildStore::BlobExistsResult& BlobExists : BlobsExists)
{
- ResponseWriter.AddBool(BlobExists.HasBody);
+ ResponseWriter.AddBool(BlobExists.HasMetadata);
if (BlobExists.HasMetadata)
{
m_BuildStoreStats.BlobExistsMetaHitCount++;
@@ -529,22 +529,11 @@ HttpBuildStoreService::HandleStatsRequest(HttpServerRequest& Request)
BuildStore::StorageStats StorageStats = m_BuildStore.GetStorageStats();
Cbo << "count" << StorageStats.EntryCount;
- Cbo << "bytes" << StorageStats.LargeBlobBytes + StorageStats.SmallBlobBytes + StorageStats.MetadataByteCount;
+ Cbo << "bytes" << StorageStats.BlobBytes + StorageStats.MetadataByteCount;
Cbo.BeginObject("blobs");
{
- Cbo << "count" << (StorageStats.LargeBlobCount + StorageStats.SmallBlobCount);
- Cbo << "bytes" << (StorageStats.LargeBlobBytes + StorageStats.SmallBlobBytes);
- Cbo.BeginObject("large");
- {
- Cbo << "count" << StorageStats.LargeBlobCount;
- Cbo << "bytes" << StorageStats.LargeBlobBytes;
- }
- Cbo.EndObject(); // large
- Cbo.BeginObject("small");
- {
- Cbo << "count" << StorageStats.SmallBlobCount;
- Cbo << "bytes" << StorageStats.SmallBlobBytes;
- }
+ Cbo << "count" << StorageStats.BlobCount;
+ Cbo << "bytes" << StorageStats.BlobBytes;
Cbo.EndObject(); // small
}
Cbo.EndObject(); // blobs
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 27ec4c690..54da51d77 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -265,10 +265,15 @@ ZenServer::Initialize(const ZenServerOptions& ServerOptions, ZenServerState::Zen
if (ServerOptions.BuildStoreConfig.Enabled)
{
+ CidStoreConfiguration BuildCidConfig;
+ BuildCidConfig.RootDirectory = m_DataRoot / "builds_cas";
+ m_BuildCidStore = std::make_unique<CidStore>(m_GcManager);
+ m_BuildCidStore->Initialize(BuildCidConfig);
+
BuildStoreConfig BuildsCfg;
BuildsCfg.RootDirectory = m_DataRoot / "builds";
BuildsCfg.MaxDiskSpaceLimit = ServerOptions.BuildStoreConfig.MaxDiskSpaceLimit;
- m_BuildStore = std::make_unique<BuildStore>(std::move(BuildsCfg), m_GcManager);
+ m_BuildStore = std::make_unique<BuildStore>(std::move(BuildsCfg), m_GcManager, *m_BuildCidStore);
}
if (ServerOptions.StructuredCacheConfig.Enabled)
@@ -664,6 +669,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
m_StatsReporter.AddProvider(m_CacheStore.Get());
m_StatsReporter.AddProvider(m_CidStore.get());
+ m_StatsReporter.AddProvider(m_BuildCidStore.get());
}
void
@@ -836,6 +842,7 @@ ZenServer::Cleanup()
m_BuildStoreService.reset();
m_BuildStore = {};
+ m_BuildCidStore.reset();
m_StructuredCacheService.reset();
m_UpstreamService.reset();
@@ -1035,9 +1042,18 @@ ZenServer::ScrubStorage()
WorkerThreadPool ThreadPool{1, "Scrub"};
ScrubContext Ctx{ThreadPool};
- m_CidStore->ScrubStorage(Ctx);
- m_ProjectStore->ScrubStorage(Ctx);
- m_StructuredCacheService->ScrubStorage(Ctx);
+
+ if (m_CidStore)
+ m_CidStore->ScrubStorage(Ctx);
+
+ if (m_ProjectStore)
+ m_ProjectStore->ScrubStorage(Ctx);
+
+ if (m_StructuredCacheService)
+ m_StructuredCacheService->ScrubStorage(Ctx);
+
+ if (m_BuildCidStore)
+ m_BuildCidStore->ScrubStorage(Ctx);
const uint64_t ElapsedTimeMs = Timer.GetElapsedTimeMs();
@@ -1059,6 +1075,9 @@ ZenServer::Flush()
if (m_ProjectStore)
m_ProjectStore->Flush();
+
+ if (m_BuildCidStore)
+ m_BuildCidStore->Flush();
}
void
diff --git a/src/zenserver/zenserver.h b/src/zenserver/zenserver.h
index 5cfa04ba1..0dcab6ec4 100644
--- a/src/zenserver/zenserver.h
+++ b/src/zenserver/zenserver.h
@@ -128,6 +128,7 @@ private:
Ref<ZenCacheStore> m_CacheStore;
std::unique_ptr<OpenProcessCache> m_OpenProcessCache;
HttpTestService m_TestService;
+ std::unique_ptr<CidStore> m_BuildCidStore;
std::unique_ptr<BuildStore> m_BuildStore;
#if ZEN_WITH_TESTS