cockroachdb / cockroachdb/pebble

genericcache: investigate replacing with Otter v2

Open
#5,031 0 comments 0 reactions 0 assignees View on GitHub
A-storage C-performance T-storage
Dominant language
Go
Stars
6k
Forks
584
Avg merge
16h 35m
Merged PRs (30d)
5

Description

[`genericcache.Cache`](https://github.com/cockroachdb/pebble/blob/master/internal/genericcache/cache.go#L14-L20) implements a sharded cache using CLOCK-Pro. We should investigate whether this cache can be replaced with [Otter v2](https://github.com/maypok86/otter?tab=readme-ov-file) which is optimized for read-heavy workloads which is what we expect from the [`FileCache`](https://github.com/cockroachdb/pebble/blob/master/file_cache.go#L407-L409) used to cache open file handles.

Jira issue: PEBBLE-538

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading internal/genericcache/cache.go and the FileCache implementation in file_cache.go, then review the linked Otter v2 documentation. Compare whether Otter v2 is suitable for the read-heavy open-file-handle workload and document a clear replacement recommendation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.