baidu / baidu/tera

some issues in mem-table

Open
#814 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
432
PR merge metrics
No merged PRs in 30d

Description

1. 内存泄漏
问题:
当表有多个inmem的lg时,Load时会new多个block_cache,但Unload时只释放其中一个,造成内存泄漏。
解决方案:
所有内存lg共用一个block_cache,不new多个。
2. 一个lg是内存表,会导致整个表都成为内存表
问题:
因为所有lg共享block_cache,导致本来打算只给内存表用的block_cache其他表也可以用,所有数据都cache在内存了。
解决方案:
在LGInfo中增加block_cache,每个lg用自己的block_cache配置。
3. 内存表的block_cache过小
问题:
可能是因为解决2中的问题,去年7月一次升级将内存表block_cache改成20M了,导致内存表本城磁盘表了,性能肯定很差。
解决方案:
改回10GB
4. 共享block_cache导致野指针
问题:
多个tablet共享一个sst时,会导致共享一个block_cache,如果block_cache的拥有者删除了这个block_cache,那另一个tablet再访问就是野指针,core掉
解决方案:
1个表的某个lg,在一个ts上所有tablet共享同一个block_cache。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the mem-table Load and Unload paths and the LGInfo definition, then trace block_cache ownership across multiple in-memory LGs, tables, and tablets. Reproduce or add coverage for the four reported cases: leaked caches, unintended caching, the 20MB size, and use-after-free; done means ownership and per-LG configuration are safe and the intended cache size is restored.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
database
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.