sofastack/sofa-jraft

RFC: multi-generation log cache

オープン

#854 opened on 2022/06/23

 (9 件のコメント) (1 件のリアクション) (0 人の担当者)Java (1,125 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (3,406 個のスター)
PR merge metrics
 (平均マージ 20h 13m) (30d で 3 merged PRs)

説明

RFC: multi-generation log cache

As discussion in #840 , jraft keeps a cache for latest log entries, it's unlimited and may consume too much memory under write-heavy workload or catching up replication when node restarts.

I think we can abstracts a cache interface and provide a multi-generation cache to replace current one:

  • Gen-1: totaly in memory with limited capacity.
  • Gen-2: Off-heap cache.When Gen-1 overflows, move the LRU(least recently used) item into off-heap cache such as OHC.

Main goals:

  • Abstracts log cache interface.
  • Provide a multi-generation cache implementation.

コントリビューターガイド