hansonzhao007 / WipDB

WipDB: A Write-in-place Key-value Store
5 stars 7 forks source link

Concurrency Issues #1

Open AnonyK1 opened 2 years ago

AnonyK1 commented 2 years ago

I used YCSB to generate trace file firstly, then load the workload in memory and split for 4 threads. The 4 threads execute YCSB-A (mixed read/write) concurrently and Segmentation fault occurs. If I changed the hashtable-based memtable to skiplist-based memtable, WipDB can run successfully. If set skiplistrep = false, there exists some concurrency issues.

I used gdb to trace the stack and found that the errors are mainly from assert in method (VersionSet::SetLastSequence and compare method invoked by NULL object).

std::vector<ArrayNode> pool_ in Memtable seems like not thread-safe.

AnonyK1 commented 2 years ago

With test scripts in test_bench, the evaluation can be execued successfully.

I found the YCSB workload generated by kv_bench is with uniform distribution. In my own test, I used YCSB to generate traces with zipfian distribution in default.

Multi-thread test with uniform distribution workload can be executed successfully as the data bewteen different threads are not shared, while error happens with zipfian distribution.

From my perspective, some concurrency issues exist in the single bucket.