[PR #287] [MERGED] Add LRU in MasterService, complexity O(1) #1452

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/287
Author: @zhaoyongke
Created: 4/23/2025
Status: ✅ Merged
Merged: 5/15/2025
Merged by: @xiaguan

Base: main ← Head: main


📝 Commits (10+)

  • 00c660a Fix nvmeof build issue
  • fb71e56 Merge branch 'kvcache-ai:main' into main
  • 16d6f17 Merge branch 'kvcache-ai:main' into main
  • 731d23e Add LRU in Master Service, complexity O(1)
  • b9a348b Move Macros to CMake Options
  • e86054a fix lru build options
  • 14af70c Now we can setup LRU_MAX_CAPACITY with cmake commands
  • 8492d1f Refactoring LRU to EvictionStrategy Class
  • 7d2f451 Add tests of eviction strategy
  • ae3d416 fix build issues

📊 Changes

10 files changed (+280 additions, -3 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)
📝 mooncake-common/common.cmake (+10 -0)
➕ mooncake-store/include/eviction_strategy.h (+99 -0)
📝 mooncake-store/include/master_metric_manager.h (+1 -0)
📝 mooncake-store/include/master_service.h (+5 -0)
📝 mooncake-store/src/master_metric_manager.cpp (+6 -0)
📝 mooncake-store/src/master_service.cpp (+20 -1)
📝 mooncake-store/tests/CMakeLists.txt (+4 -0)
➕ mooncake-store/tests/eviction_strategy_test.cpp (+134 -0)
📝 mooncake-transfer-engine/CMakeLists.txt (+0 -1)

📄 Description

We found mooncake store will discard all the put() requests after its capacity reaches the max. This case is not applicable in our online service. We solved this via LRU( Least Recently Used) algorithm.


🔄 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/287 **Author:** [@zhaoyongke](https://github.com/zhaoyongke) **Created:** 4/23/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@xiaguan](https://github.com/xiaguan) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`00c660a`](https://github.com/kvcache-ai/Mooncake/commit/00c660a7e0824f45a5e64966bbe943c2a2d82315) Fix nvmeof build issue - [`fb71e56`](https://github.com/kvcache-ai/Mooncake/commit/fb71e5691713e0385e5244692b033f52aeb8d4c7) Merge branch 'kvcache-ai:main' into main - [`16d6f17`](https://github.com/kvcache-ai/Mooncake/commit/16d6f17d280803a6b5d107fa65069cbf1b9bb6ac) Merge branch 'kvcache-ai:main' into main - [`731d23e`](https://github.com/kvcache-ai/Mooncake/commit/731d23e8e38d345b87274c1e7fb3f2fde460aa5f) Add LRU in Master Service, complexity O(1) - [`b9a348b`](https://github.com/kvcache-ai/Mooncake/commit/b9a348b90c18dbb798bdc4cad08272d251cc5967) Move Macros to CMake Options - [`e86054a`](https://github.com/kvcache-ai/Mooncake/commit/e86054acace0899e7ee0e7253ba1ddf4eaab5b2b) fix lru build options - [`14af70c`](https://github.com/kvcache-ai/Mooncake/commit/14af70c9cadffa91824ca43331839e78d07050a4) Now we can setup LRU_MAX_CAPACITY with cmake commands - [`8492d1f`](https://github.com/kvcache-ai/Mooncake/commit/8492d1f906f8444bf4b5f2e03c7fb0ef54b82c70) Refactoring LRU to EvictionStrategy Class - [`7d2f451`](https://github.com/kvcache-ai/Mooncake/commit/7d2f451deeee5a5612cf93c5b665933e2a2aa153) Add tests of eviction strategy - [`ae3d416`](https://github.com/kvcache-ai/Mooncake/commit/ae3d41639c9a2db08f66bfa49ec7a3649f208d98) fix build issues ### 📊 Changes **10 files changed** (+280 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) 📝 `mooncake-common/common.cmake` (+10 -0) ➕ `mooncake-store/include/eviction_strategy.h` (+99 -0) 📝 `mooncake-store/include/master_metric_manager.h` (+1 -0) 📝 `mooncake-store/include/master_service.h` (+5 -0) 📝 `mooncake-store/src/master_metric_manager.cpp` (+6 -0) 📝 `mooncake-store/src/master_service.cpp` (+20 -1) 📝 `mooncake-store/tests/CMakeLists.txt` (+4 -0) ➕ `mooncake-store/tests/eviction_strategy_test.cpp` (+134 -0) 📝 `mooncake-transfer-engine/CMakeLists.txt` (+0 -1) </details> ### 📄 Description We found mooncake store will discard all the put() requests after its capacity reaches the max. This case is not applicable in our online service. We solved this via LRU( Least Recently Used) algorithm. --- <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:33 +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#1452
No description provided.