facebook / facebook/rocksdb

Many empty memtables are created during MyRocks create index

Open
#12,179 11 comments 0 reactions 1 assignee Claimed by @pranavshenoy View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### Expected behavior
New MemTable should not be created if there are empty memtables.

### Actual behavior
Many new (empty) MemTables are created during MyRocks create index. This is a benign bug, these empty MemTables are deleted on create index finishes.

### Steps to reproduce the behavior
In MyRocks, create many indexes in parallel on existing large table while heavily writing to another table.

It seems these MemTables are created in `IngestExternalFiles` -> `FlushMemTable` -> `SwitchMemtable`.

-----
We found this bug by our webview inspector for DB, gray are empty MemTables:

![image](https://github.com/facebook/rocksdb/assets/1574991/fc3e604b-896b-4b4c-91a8-276fac2642ea)

These empty MemTables get deleted:

![image](https://github.com/facebook/rocksdb/assets/1574991/f5f3a09b-0348-4081-af67-d9897e71bea3)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.