facebook / facebook/rocksdb

memtable_insert_hint_per_batch doesn't work with Merge ops

Open
#7,513 1 comment 0 reactions 0 assignees View on GitHub
up-for-grabs
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

> Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev
```
WriteOptions wopts;
wopts.memtable_insert_hint_per_batch = true
db->Write(wopts, batch)
```
### Expected behavior
Some speedup if merges applied to sorted run of keys

### Actual behavior
Nothing happens

### Steps to reproduce the behavior
Open ```write_batch.cc``` and look insde ```MemTableInserter```:
```
PutCFImpl(....) {
....
bool mem_res =
mem->Add(sequence_, value_type, key, value,
concurrent_memtable_writes_, get_post_process_info(mem),
hint_per_batch_ ? &GetHintMap()[mem] : nullptr); // Here hints get used
....
}

MergeCF(....) {
.....
bool mem_res =
mem->Add(sequence_, value_type, key, value,
concurrent_memtable_writes_, get_post_process_info(mem)); // hints ignored completely
.....
}
```

As I understand in case of ```cuncurrent_memtable_write``` ```MergeCF``` won't try to merge operands before insertion and goes directly to insert routine, why not use hints here? Seems Merge op has no difference from any Put or Delete op at this point

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.