[PR #337] [MERGED] fix(store): the metadata leak after umount segment #1490

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/337
Author: @maobaolong
Created: 5/8/2025
Status: ✅ Merged
Merged: 5/15/2025
Merged by: @stmatengss

Base: main ← Head: fixUnmountLeak


📝 Commits (2)

  • b85e278 fix the metadata leak after umount segment
  • 5d4c261 Add a performance test

📊 Changes

3 files changed (+173 additions, -1 deletions)

View changed files

📝 mooncake-store/include/master_service.h (+6 -0)
📝 mooncake-store/src/master_service.cpp (+38 -1)
📝 mooncake-store/tests/master_service_test.cpp (+129 -0)

📄 Description

Description

Although UnmountSegement remove the specified segment from buffer_allocator_manager, but the related metadata of objects still exists.

Although MetadataAccessor will remove these invalid key in the constructor, but it will still leak if the related keys do not be accessed any more.

So the safe way is remove the related keys in the UnmountSegement function.

Future work

  • It would be better to collect the UnmountSegement request and execute it async.

🔄 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/337 **Author:** [@maobaolong](https://github.com/maobaolong) **Created:** 5/8/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `fixUnmountLeak` --- ### 📝 Commits (2) - [`b85e278`](https://github.com/kvcache-ai/Mooncake/commit/b85e278219d264021847d51b448821fe7be4fe1d) fix the metadata leak after umount segment - [`5d4c261`](https://github.com/kvcache-ai/Mooncake/commit/5d4c261884cab54545a67bc52678b23f074afe0e) Add a performance test ### 📊 Changes **3 files changed** (+173 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `mooncake-store/include/master_service.h` (+6 -0) 📝 `mooncake-store/src/master_service.cpp` (+38 -1) 📝 `mooncake-store/tests/master_service_test.cpp` (+129 -0) </details> ### 📄 Description # Description Although `UnmountSegement` remove the specified segment from buffer_allocator_manager, but the related metadata of objects still exists. Although `MetadataAccessor` will remove these invalid key in the constructor, but it will still leak if the related keys do not be accessed any more. So the safe way is remove the related keys in the UnmountSegement function. # Future work - It would be better to collect the `UnmountSegement` request and execute it async. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:27:55 +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#1490
No description provided.