rocksdb/utilities/write_batch_with_index
Maysam Yabandeh 4e3c3d8c6a WritePrepared Txn: duplicate keys
Summary:
With WriteCommitted, when the write batch has duplicate keys, the txn db simply inserts them to the db with different seq numbers and let the db ignore/merge the duplicate values at the read time. With WritePrepared all the entries of the batch are inserted with the same seq number which prevents us from benefiting from this simple solution.

This patch applies a hackish solution to unblock the end-to-end testing. The hack is to be replaced with a proper solution soon. The patch simply detects the duplicate key insertions, and mark the previous one as obsolete. Then before writing to the db it rewrites the batch eliminating the obsolete keys. This would incur a memcpy cost. Furthermore handing duplicate merge would require to do FullMerge instead of simply ignoring the previous value, which is not handled by this patch.
Closes https://github.com/facebook/rocksdb/pull/2969

Differential Revision: D5976337

Pulled By: maysamyabandeh

fbshipit-source-id: 114e65b66f137d8454ff2d1d782b8c05da95f989
2017-10-05 07:41:02 -07:00
..
write_batch_with_index_internal.cc WritePrepared Txn: Advance seq one per batch 2017-09-18 14:45:08 -07:00
write_batch_with_index_internal.h Change RocksDB License 2017-07-15 16:11:23 -07:00
write_batch_with_index_test.cc Revert "comment out unused parameters" 2017-07-21 18:26:26 -07:00
write_batch_with_index.cc WritePrepared Txn: duplicate keys 2017-10-05 07:41:02 -07:00