diff options
| author | zousar <[email protected]> | 2023-12-06 16:46:00 -0700 |
|---|---|---|
| committer | zousar <[email protected]> | 2023-12-06 16:46:00 -0700 |
| commit | ed465b8d83c5b1a3f996fd8f4f037427574918f2 (patch) | |
| tree | 008ab3b4d6b4347d3fbea6c0b8c2181872aed766 | |
| parent | Ran precommit (diff) | |
| download | zen-ed465b8d83c5b1a3f996fd8f4f037427574918f2.tar.xz zen-ed465b8d83c5b1a3f996fd8f4f037427574918f2.zip | |
Change naming to ChunkInfos instead of Chunks
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | src/zenserver/projectstore/httpprojectstore.cpp | 10 | ||||
| -rw-r--r-- | src/zenserver/projectstore/httpprojectstore.h | 2 | ||||
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 6 | ||||
| -rw-r--r-- | src/zenserver/projectstore/projectstore.h | 6 |
5 files changed, 14 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d44bb2ec..64b53f31c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - Feature: Added xmake task `updatefrontend` which updates the zip file containing the frontend html (`/src/zenserver/frontend/html.zip`) - Feature: Added `--powercycle` option to zenserver which causes it do shut down immediately after initialization is completed. This is useful for profiling startup/shutdown primarily but could also be useful for some kinds of validation/state upgrade scenarios - Feature: New endpoint `/admin/gc-stop` to cancel a running garbage collect operation -- Feature: Added `zen gc-stop` command to cancel a running garbage collect operation +- Feature: Added `zen gc-stop` command to cancel a running garbage collect operation` - Bugfix: Fix sentry host name where last character of name was being truncated - Bugfix: GCv2 - make sure to discover all projects and oplogs before checking for expired data - Bugfix: Fix sync of log position and state log when writing cas index snapshot @@ -23,6 +23,7 @@ - Improvement: GCv2: Sort chunks to read by block/offset when finding references - Improvement: GCv2: Exit as soon as no more unreferenced items are left - Improvement: Reduce memory usage in GC and diskbucket flush +- Improvement: Added a `{project}/oplog/{log}/chunkinfos` endpoint that can be used for getting all chunk info within an oplog in batch ## 0.2.35 - Bugfix: Fix timeout calculation for semtimedop call diff --git a/src/zenserver/projectstore/httpprojectstore.cpp b/src/zenserver/projectstore/httpprojectstore.cpp index 3994a9a46..0ba49cf8a 100644 --- a/src/zenserver/projectstore/httpprojectstore.cpp +++ b/src/zenserver/projectstore/httpprojectstore.cpp @@ -276,8 +276,8 @@ HttpProjectService::HttpProjectService(CidStore& Store, ProjectStore* Projects, HttpVerb::kGet); m_Router.RegisterRoute( - "{project}/oplog/{log}/chunks", - [this](HttpRouterRequest& Req) { HandleChunksRequest(Req); }, + "{project}/oplog/{log}/chunkinfos", + [this](HttpRouterRequest& Req) { HandleChunkInfosRequest(Req); }, HttpVerb::kGet); m_Router.RegisterRoute( @@ -648,9 +648,9 @@ HttpProjectService::HandleFilesRequest(HttpRouterRequest& Req) } void -HttpProjectService::HandleChunksRequest(HttpRouterRequest& Req) +HttpProjectService::HandleChunkInfosRequest(HttpRouterRequest& Req) { - ZEN_TRACE_CPU("ProjectService::Chunks"); + ZEN_TRACE_CPU("ProjectService::ChunkInfos"); HttpServerRequest& HttpReq = Req.ServerRequest(); @@ -658,7 +658,7 @@ HttpProjectService::HandleChunksRequest(HttpRouterRequest& Req) const auto& OplogId = Req.GetCapture(2); CbObject ResponsePayload; - std::pair<HttpResponseCode, std::string> Result = m_ProjectStore->GetProjectChunks(ProjectId, OplogId, ResponsePayload); + std::pair<HttpResponseCode, std::string> Result = m_ProjectStore->GetProjectChunkInfos(ProjectId, OplogId, ResponsePayload); if (Result.first == HttpResponseCode::OK) { return HttpReq.WriteResponse(HttpResponseCode::OK, ResponsePayload); diff --git a/src/zenserver/projectstore/httpprojectstore.h b/src/zenserver/projectstore/httpprojectstore.h index 9845164d7..9990ee264 100644 --- a/src/zenserver/projectstore/httpprojectstore.h +++ b/src/zenserver/projectstore/httpprojectstore.h @@ -64,7 +64,7 @@ private: void HandleProjectListRequest(HttpRouterRequest& Req); void HandleChunkBatchRequest(HttpRouterRequest& Req); void HandleFilesRequest(HttpRouterRequest& Req); - void HandleChunksRequest(HttpRouterRequest& Req); + void HandleChunkInfosRequest(HttpRouterRequest& Req); void HandleChunkInfoRequest(HttpRouterRequest& Req); void HandleChunkByIdRequest(HttpRouterRequest& Req); void HandleChunkByCidRequest(HttpRouterRequest& Req); diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 8bc49c55f..9ba8e3a19 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -2230,9 +2230,9 @@ ProjectStore::GetProjectFiles(const std::string_view ProjectId, const std::strin } std::pair<HttpResponseCode, std::string> -ProjectStore::GetProjectChunks(const std::string_view ProjectId, const std::string_view OplogId, CbObject& OutPayload) +ProjectStore::GetProjectChunkInfos(const std::string_view ProjectId, const std::string_view OplogId, CbObject& OutPayload) { - ZEN_TRACE_CPU("ProjectStore::GetProjectChunks"); + ZEN_TRACE_CPU("ProjectStore::GetProjectChunkInfos"); using namespace std::literals; @@ -2254,7 +2254,7 @@ ProjectStore::GetProjectChunks(const std::string_view ProjectId, const std::stri FoundLog->IterateChunkMap([&ChunkInfos](const Oid& Id, const IoHash& Hash) { ChunkInfos.push_back({Id, Hash}); }); CbObjectWriter Response; - Response.BeginArray("chunks"sv); + Response.BeginArray("chunkinfos"sv); for (const auto& ChunkInfo : ChunkInfos) { diff --git a/src/zenserver/projectstore/projectstore.h b/src/zenserver/projectstore/projectstore.h index 27cb092a2..57cda8ae7 100644 --- a/src/zenserver/projectstore/projectstore.h +++ b/src/zenserver/projectstore/projectstore.h @@ -307,9 +307,9 @@ public: const std::string_view OplogId, bool FilterClient, CbObject& OutPayload); - std::pair<HttpResponseCode, std::string> GetProjectChunks(const std::string_view ProjectId, - const std::string_view OplogId, - CbObject& OutPayload); + std::pair<HttpResponseCode, std::string> GetProjectChunkInfos(const std::string_view ProjectId, + const std::string_view OplogId, + CbObject& OutPayload); std::pair<HttpResponseCode, std::string> GetChunkInfo(const std::string_view ProjectId, const std::string_view OplogId, const std::string_view ChunkId, |