[PR #1219] [CLOSED] [Store] Delete useless meta from http metadata server #2083

Closed
opened 2026-10-29 21:32:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1219
Author: @stmatengss
Created: 12/16/2025
Status: ❌ Closed

Base: main ← Head: refactor_metadata_server


📝 Commits (10+)

  • b56dbf2 [Store] Delete useless meta from http metadata server
  • 0bc7cce update
  • 3a42c5b update
  • 158bc76 Merge branch 'main' into refactor_metadata_server
  • cddaafc update
  • 2a2b0a2 Merge branch 'main' into refactor_metadata_server
  • cea4970 Merge branch 'main' into refactor_metadata_server
  • ce80efa [Store] Optimize HTTP metadata server health checks (#1484)
  • 283ccd7 [Store] Format code with clang-format-20 (#1489)
  • abb53d4 [Store] Remove trailing whitespace in rpc_service.cpp (#1490)

📊 Changes

6 files changed (+170 additions, -40 deletions)

View changed files

📝 mooncake-store/include/http_metadata_server.h (+21 -0)
📝 mooncake-store/include/master_config.h (+10 -0)
📝 mooncake-store/include/rpc_service.h (+2 -0)
📝 mooncake-store/src/http_metadata_server.cpp (+107 -0)
📝 mooncake-store/src/master.cpp (+19 -40)
📝 mooncake-store/src/rpc_service.cpp (+11 -0)

📄 Description

Description

Adds periodic health monitoring to the HTTP metadata server to automatically clean up stale segment metadata. The HTTP metadata server is initialized after the WrappedMasterService is created, allowing it to query segment status and remove metadata for segments that no longer exist.

Key changes:

  • Added GetAllSegments() method to WrappedMasterService to expose segment information for health checks
  • Moved HTTP metadata server initialization to after WrappedMasterService creation in the non-HA path, passing the shared_ptr<WrappedMasterService> directly for health monitoring
  • Implemented a health monitoring thread in HttpMetadataServer that periodically (every 10 minutes) checks segments and cleans up metadata for segments that no longer exist
  • Added HTTP metadata server configuration fields (enable_http_metadata_server, http_metadata_server_port, http_metadata_server_host) to MasterServiceSupervisorConfig
  • Resolved merge conflicts with main branch: removed legacy ha_helper files (replaced by new HA backend abstraction), integrated with new shared_ptr-based WrappedMasterService, and preserved new NoF segment methods

Module

  • Mooncake Store (mooncake-store)

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Other

How Has This Been Tested?

Verified code compiles and passes clang-format-20 formatting checks.

Checklist

  • I have performed a self-review of my own code.
  • I have formatted my own code using ./scripts/code_format.sh before submitting.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1219 **Author:** [@stmatengss](https://github.com/stmatengss) **Created:** 12/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor_metadata_server` --- ### 📝 Commits (10+) - [`b56dbf2`](https://github.com/kvcache-ai/Mooncake/commit/b56dbf2dc995ea71747141951366d133d126a2e6) [Store] Delete useless meta from http metadata server - [`0bc7cce`](https://github.com/kvcache-ai/Mooncake/commit/0bc7cce4bba1b54bd6c009da22deb7341037e4e7) update - [`3a42c5b`](https://github.com/kvcache-ai/Mooncake/commit/3a42c5b8220c66e2c0daa12726bef367c490ab23) update - [`158bc76`](https://github.com/kvcache-ai/Mooncake/commit/158bc763a76dae9224a0c508083a0d9d86c6a6e6) Merge branch 'main' into refactor_metadata_server - [`cddaafc`](https://github.com/kvcache-ai/Mooncake/commit/cddaafce459b470aa4b66d00f73442fe757e1f86) update - [`2a2b0a2`](https://github.com/kvcache-ai/Mooncake/commit/2a2b0a25a4f8626181575a6a69b3feb91deabc83) Merge branch 'main' into refactor_metadata_server - [`cea4970`](https://github.com/kvcache-ai/Mooncake/commit/cea4970142921a47b66651ca83894794f395abab) Merge branch 'main' into refactor_metadata_server - [`ce80efa`](https://github.com/kvcache-ai/Mooncake/commit/ce80efaa5a147efe9b8aafc3369f9aeea8c80b5a) [Store] Optimize HTTP metadata server health checks (#1484) - [`283ccd7`](https://github.com/kvcache-ai/Mooncake/commit/283ccd73bd31801447b2ad92b40cf32e9ec4c69c) [Store] Format code with clang-format-20 (#1489) - [`abb53d4`](https://github.com/kvcache-ai/Mooncake/commit/abb53d4e7b757bc569c43f30d23c53d1a20c763a) [Store] Remove trailing whitespace in rpc_service.cpp (#1490) ### 📊 Changes **6 files changed** (+170 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `mooncake-store/include/http_metadata_server.h` (+21 -0) 📝 `mooncake-store/include/master_config.h` (+10 -0) 📝 `mooncake-store/include/rpc_service.h` (+2 -0) 📝 `mooncake-store/src/http_metadata_server.cpp` (+107 -0) 📝 `mooncake-store/src/master.cpp` (+19 -40) 📝 `mooncake-store/src/rpc_service.cpp` (+11 -0) </details> ### 📄 Description ## Description Adds periodic health monitoring to the HTTP metadata server to automatically clean up stale segment metadata. The HTTP metadata server is initialized after the `WrappedMasterService` is created, allowing it to query segment status and remove metadata for segments that no longer exist. **Key changes:** - Added `GetAllSegments()` method to `WrappedMasterService` to expose segment information for health checks - Moved HTTP metadata server initialization to after `WrappedMasterService` creation in the non-HA path, passing the `shared_ptr<WrappedMasterService>` directly for health monitoring - Implemented a health monitoring thread in `HttpMetadataServer` that periodically (every 10 minutes) checks segments and cleans up metadata for segments that no longer exist - Added HTTP metadata server configuration fields (`enable_http_metadata_server`, `http_metadata_server_port`, `http_metadata_server_host`) to `MasterServiceSupervisorConfig` - Resolved merge conflicts with main branch: removed legacy `ha_helper` files (replaced by new HA backend abstraction), integrated with new `shared_ptr`-based `WrappedMasterService`, and preserved new NoF segment methods ## Module - [x] Mooncake Store (`mooncake-store`) ## Type of Change - [ ] Bug fix - [x] New feature - [ ] Refactor - [ ] Breaking change - [ ] Documentation update - [ ] Other ## How Has This Been Tested? Verified code compiles and passes `clang-format-20` formatting checks. ## Checklist - [x] I have performed a self-review of my own code. - [x] I have formatted my own code using `./scripts/code_format.sh` before submitting. - [ ] I have updated the documentation. - [ ] I have added tests to prove my changes are effective. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:32:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2083
No description provided.