]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Return MergeInProgress when fetching from transactions or WBWI with overwrite_key
authoragiardullo <agiardullo@fb.com>
Tue, 29 Sep 2015 02:24:44 +0000 (19:24 -0700)
committeragiardullo <agiardullo@fb.com>
Wed, 30 Sep 2015 18:45:32 +0000 (11:45 -0700)
commit0fb70a800e574ed83ee4d136e0efcd393d34b0e8
treeb813abd7760c06c7026e6b1734b9f90f4e52e8b3
parent8dbf5a39bd0ffa88f4aff3260941f75470c5837b
Return MergeInProgress when fetching from transactions or WBWI with overwrite_key

Summary:
WriteBatchWithIndex::GetFromBatchAndDB only works correctly for overwrite_key=false.  Transactions use overwrite_key=true (since WriteBatchWithIndex::GetIteratorWithBase only works when overwrite_key=true).  So currently, Transactions could return incorrectly merged results when calling Get/GetForUpdate().

Until a permanent fix can be put in place, Transaction::Get[ForUpdate] and WriteBatchWithIndex::GetFromBatch[AndDB] will now return MergeInProgress if the most recent write to a key in the batch is a Merge.

Test Plan: more tests

Reviewers: sdong, yhchiang, rven, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D47817
include/rocksdb/utilities/transaction.h
include/rocksdb/utilities/write_batch_with_index.h
utilities/transactions/transaction_test.cc
utilities/write_batch_with_index/write_batch_with_index.cc
utilities/write_batch_with_index/write_batch_with_index_internal.cc
utilities/write_batch_with_index/write_batch_with_index_internal.h
utilities/write_batch_with_index/write_batch_with_index_test.cc