rocksdb/db
Kai Liu 75df72f2a5 Change the logic in KeyMayExist()
Summary:
Previously in KeyMayExist(), if DB::Get() returns non-Status::OK(), we assumes key may not exist.
However, as if index block is not in block cache, Status::Incomplete() will return. Worse still, if
options::filter_delete is enabled, we may falsely ignore the "delete" operation:

  https://github.com/facebook/rocksdb/blob/master/db/write_batch.cc#L217-L220

This diff fixes this bug and will let crash-test pass.

Test Plan:
Ran:

  ./db_stress --test_batches_snapshots=1 --ops_per_thread=1000000 --threads=32 --write_buffer_size=4194304 --destroy_db_initially=1 --reopen=0 --readpercent=5 --prefixpercent=45 --writepercent=35 --delpercent=5 --iterpercent=10 --db=/home/kailiu/local/newer --max_key=100000000 --disable_seek_compaction=0 --mmap_read=0 --block_size=16384 --cache_size=1048576 --open_files=500000 --verify_checksum=1 --sync=0 --disable_wal=0 --disable_data_sync=0 --target_file_size_base=2097152
--target_file_size_multiplier=2 --max_write_buffer_number=3 --max_background_compactions=20 --max_bytes_for_level_base=10485760 --filter_deletes=1

Previously we'll see crash happens very soon.

Reviewers: igor, dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D14115
2013-11-17 01:00:34 -08:00
..
builder.cc Follow-up Cleaning-up After D13521 2013-10-30 10:52:33 -07:00
builder.h Fixing the warning messages captured under mac os # Consider using git commit -m 'One line title' && arc diff. # You will save time by running lint and unit in the background. 2013-11-12 20:05:28 -08:00
c_test.c Migrate names of properties from 'leveldb' prefix to 'rocksdb' prefix. 2013-10-06 00:14:26 -07:00
c.cc WAL log retention policy based on archive size. 2013-11-06 18:46:28 -08:00
corruption_test.cc Make "Table" pluggable 2013-10-28 17:54:09 -07:00
db_bench.cc make util/env_posix.cc work under mac 2013-11-16 23:44:39 -08:00
db_filesnapshot.cc Speed up FindObsoleteFiles 2013-11-08 15:23:46 -08:00
db_impl_readonly.cc Make "Table" pluggable 2013-10-28 17:54:09 -07:00
db_impl_readonly.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
db_impl.cc Change the logic in KeyMayExist() 2013-11-17 01:00:34 -08:00
db_impl.h PurgeObsoleteFiles() unittest 2013-11-14 18:03:57 -08:00
db_iter.cc Fix Bug: iterator.Prev() or iterator.SeekToLast() might return the first element instead of the correct one 2013-10-17 18:33:18 -07:00
db_iter.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
db_statistics.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
db_stats_logger.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
db_test.cc make util/env_posix.cc work under mac 2013-11-16 23:44:39 -08:00
dbformat_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
dbformat.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
dbformat.h Make "Table" pluggable 2013-10-28 17:54:09 -07:00
deletefile_test.cc Start DeleteFileTest with clean plate 2013-11-15 16:30:23 -08:00
filename_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
filename.cc Unify DeleteFile and DeleteWalFiles 2013-10-25 08:32:14 -07:00
filename.h Unify DeleteFile and DeleteWalFiles 2013-10-25 08:32:14 -07:00
log_format.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
log_reader.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
log_reader.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
log_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
log_writer.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
log_writer.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
memtable.cc [RocksDB] Generalize prefix-aware iterator to be used for more than one Seek 2013-11-06 20:45:49 -08:00
memtable.h [RocksDB] Generalize prefix-aware iterator to be used for more than one Seek 2013-11-06 20:45:49 -08:00
memtablelist.cc Fix the string format issue 2013-11-12 21:05:39 -08:00
memtablelist.h Fix the log number bug when updating MANIFEST file 2013-10-24 21:05:33 -07:00
merge_helper.cc [Merge operand meant for key K is being applied on wrong key] 2013-11-14 17:13:24 -08:00
merge_helper.h Fixing the warning messages captured under mac os # Consider using git commit -m 'One line title' && arc diff. # You will save time by running lint and unit in the background. 2013-11-12 20:05:28 -08:00
merge_operator.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
merge_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
perf_context_test.cc [RocksDB] Add perf_context.wal_write_time to track time spent on writing the recovery log. 2013-10-23 13:38:39 -07:00
prefix_filter_iterator.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
prefix_test.cc Implementing DynamicIterator for TransformRepNoLock 2013-11-08 00:31:09 -08:00
repair.cc Fixing the warning messages captured under mac os # Consider using git commit -m 'One line title' && arc diff. # You will save time by running lint and unit in the background. 2013-11-12 20:05:28 -08:00
simple_table_db_test.cc Fixing the warning messages captured under mac os # Consider using git commit -m 'One line title' && arc diff. # You will save time by running lint and unit in the background. 2013-11-12 20:05:28 -08:00
skiplist_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
skiplist.h Implementing DynamicIterator for TransformRepNoLock 2013-11-08 00:31:09 -08:00
snapshot.h Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
table_cache.cc Follow-up Cleaning-up After D13521 2013-10-30 10:52:33 -07:00
table_cache.h Follow-up Cleaning-up After D13521 2013-10-30 10:52:33 -07:00
table_stats_collector_test.cc Provide mechanism to configure when to flush the block 2013-11-07 21:27:21 -08:00
table_stats_collector.cc Support user-defined table stats collector 2013-10-28 15:45:14 -07:00
table_stats_collector.h Support user-defined table stats collector 2013-10-28 15:45:14 -07:00
transaction_log_impl.cc Fix the string format issue 2013-11-12 21:05:39 -08:00
transaction_log_impl.h Making the transaction log iterator more robust 2013-11-04 20:49:03 -08:00
version_edit_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
version_edit.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
version_edit.h Fix the log number bug when updating MANIFEST file 2013-10-24 21:05:33 -07:00
version_set_reduce_num_levels.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
version_set_test.cc Add appropriate LICENSE and Copyright message. 2013-10-16 17:48:41 -07:00
version_set.cc Fix the string format issue 2013-11-12 21:05:39 -08:00
version_set.h Small changes in Deleting obsolete files 2013-11-12 11:53:26 -08:00
write_batch_internal.h In-place updates for equal keys and similar sized values 2013-10-31 11:27:12 -07:00
write_batch_test.cc WriteBatch::Put() overload that gathers key and value from arrays of slices 2013-11-08 16:34:32 -08:00
write_batch.cc WriteBatch::Put() overload that gathers key and value from arrays of slices 2013-11-08 16:34:32 -08:00