brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.94k stars 2.24k forks source link

Update operation in RocksDB client is not blind #1638

Closed chenlx0 closed 2 years ago

chenlx0 commented 2 years ago

Hi, I recently stress tested Rocksdb on ycsb, and I found that the update operation in RocksDB client would call 'Get' function before 'Put' function:

https://github.com/brianfrankcooper/YCSB/blob/ce3eb9ce51c84ee9e236998cdd2cefaeb96798a8/rocksdb/src/main/java/site/ycsb/db/rocksdb/RocksDBClient.java#L271

That makes update operation more like a 'Read-Modify-Write' operation. However, the YCSB paper pointed out that the workload A updates are different from 'Read-Modify-Write', it should be blind writes:

We also ran a “read-modify-write” workload that reflects the frequently used pattern of reading a record, modifying it, and writing the changes back to the database. This work- load is similar to workload A (50/50 read/write ratio) except that the updates are “read-modify-write” rather than blind writes.

Is it ok to remove Get operation in RocksDB updates ? thks.

busbey commented 2 years ago

it depends on how values are being encoded. the update should change just the fields present while leaving prior fields the same. if the current implementation stores all the fields for a given record in a single rocksdb entry, then it will need to read the existing entry to get the existing fields.

chenlx0 commented 2 years ago

Thanks for your answers!