Revision 6f5e6445d9b56208e9f92bfeaa201d54f0c0b943 authored by Maysam Yabandeh on 12 April 2018, 02:59:25 UTC, committed by Facebook Github Bot on 12 April 2018, 03:11:51 UTC
Summary: We introduced smallest_prep optimization in this commit b225de7e10f02be6d00e96b9fb86dfef880babdf, which enables storing the smallest uncommitted sequence number along with the snapshot. This enables the readers that read from the snapshot to skip further checks and safely assumed the data is committed if its sequence number is less than smallest uncommitted when the snapshot was taken. The problem was that smallest uncommitted and the snapshot must be taken atomically, and the lack of atomicity had led to readers using a smallest uncommitted after the snapshot was taken and hence mistakenly skipping some data. This patch fixes the problem by i) separating the process of removing of prepare entries from the AddCommitted function, ii) removing the prepare entires AFTER the committed sequence number is published, iii) getting smallest uncommitted (from the prepare list) BEFORE taking a snapshot. This guarantees that the smallest uncommitted that is accompanied with a snapshot is less than or equal of such number if it was obtained atomically. Tested by running MySQLStyleTransactionTest/MySQLStyleTransactionTest.TransactionStressTest that was failing sporadically. Closes https://github.com/facebook/rocksdb/pull/3703 Differential Revision: D7581934 Pulled By: maysamyabandeh fbshipit-source-id: dc9d6f4fb477eba75d4d5927326905b548a96a32
1 parent d42bd04
File | Mode | Size |
---|---|---|
builder.cc | -rw-r--r-- | 8.9 KB |
builder.h | -rw-r--r-- | 3.6 KB |
c.cc | -rw-r--r-- | 127.6 KB |
c_test.c | -rw-r--r-- | 56.2 KB |
column_family.cc | -rw-r--r-- | 52.2 KB |
column_family.h | -rw-r--r-- | 24.3 KB |
column_family_test.cc | -rw-r--r-- | 106.4 KB |
compact_files_test.cc | -rw-r--r-- | 9.4 KB |
compacted_db_impl.cc | -rw-r--r-- | 5.7 KB |
compacted_db_impl.h | -rw-r--r-- | 3.9 KB |
compaction.cc | -rw-r--r-- | 15.7 KB |
compaction.h | -rw-r--r-- | 11.8 KB |
compaction_iteration_stats.h | -rw-r--r-- | 1.2 KB |
compaction_iterator.cc | -rw-r--r-- | 26.3 KB |
compaction_iterator.h | -rw-r--r-- | 8.3 KB |
compaction_iterator_test.cc | -rw-r--r-- | 35.3 KB |
compaction_job.cc | -rw-r--r-- | 58.7 KB |
compaction_job.h | -rw-r--r-- | 5.8 KB |
compaction_job_stats_test.cc | -rw-r--r-- | 35.5 KB |
compaction_job_test.cc | -rw-r--r-- | 35.3 KB |
compaction_picker.cc | -rw-r--r-- | 61.9 KB |
compaction_picker.h | -rw-r--r-- | 12.7 KB |
compaction_picker_test.cc | -rw-r--r-- | 56.5 KB |
compaction_picker_universal.cc | -rw-r--r-- | 27.6 KB |
compaction_picker_universal.h | -rw-r--r-- | 3.7 KB |
comparator_db_test.cc | -rw-r--r-- | 12.3 KB |
convenience.cc | -rw-r--r-- | 2.2 KB |
corruption_test.cc | -rw-r--r-- | 15.2 KB |
cuckoo_table_db_test.cc | -rw-r--r-- | 9.8 KB |
db_basic_test.cc | -rw-r--r-- | 30.9 KB |
db_blob_index_test.cc | -rw-r--r-- | 13.5 KB |
db_block_cache_test.cc | -rw-r--r-- | 22.5 KB |
db_bloom_filter_test.cc | -rw-r--r-- | 39.5 KB |
db_compaction_filter_test.cc | -rw-r--r-- | 28.2 KB |
db_compaction_test.cc | -rw-r--r-- | 127.3 KB |
db_dynamic_level_test.cc | -rw-r--r-- | 16.9 KB |
db_encryption_test.cc | -rw-r--r-- | 2.6 KB |
db_filesnapshot.cc | -rw-r--r-- | 4.8 KB |
db_flush_test.cc | -rw-r--r-- | 7.6 KB |
db_impl.cc | -rw-r--r-- | 102.7 KB |
db_impl.h | -rw-r--r-- | 60.5 KB |
db_impl_compaction_flush.cc | -rw-r--r-- | 79.8 KB |
db_impl_debug.cc | -rw-r--r-- | 6.6 KB |
db_impl_experimental.cc | -rw-r--r-- | 5.4 KB |
db_impl_files.cc | -rw-r--r-- | 22.8 KB |
db_impl_open.cc | -rw-r--r-- | 44.4 KB |
db_impl_readonly.cc | -rw-r--r-- | 7.0 KB |
db_impl_readonly.h | -rw-r--r-- | 4.7 KB |
db_impl_write.cc | -rw-r--r-- | 55.6 KB |
db_info_dumper.cc | -rw-r--r-- | 3.7 KB |
db_info_dumper.h | -rw-r--r-- | 481 bytes |
db_inplace_update_test.cc | -rw-r--r-- | 5.6 KB |
db_io_failure_test.cc | -rw-r--r-- | 18.6 KB |
db_iter.cc | -rw-r--r-- | 50.1 KB |
db_iter.h | -rw-r--r-- | 4.2 KB |
db_iter_test.cc | -rw-r--r-- | 102.3 KB |
db_iterator_test.cc | -rw-r--r-- | 71.1 KB |
db_log_iter_test.cc | -rw-r--r-- | 9.7 KB |
db_memtable_test.cc | -rw-r--r-- | 9.1 KB |
db_merge_operator_test.cc | -rw-r--r-- | 20.5 KB |
db_options_test.cc | -rw-r--r-- | 24.8 KB |
db_properties_test.cc | -rw-r--r-- | 52.3 KB |
db_range_del_test.cc | -rw-r--r-- | 38.2 KB |
db_sst_test.cc | -rw-r--r-- | 35.5 KB |
db_statistics_test.cc | -rw-r--r-- | 5.1 KB |
db_table_properties_test.cc | -rw-r--r-- | 8.8 KB |
db_tailing_iter_test.cc | -rw-r--r-- | 23.9 KB |
db_test.cc | -rw-r--r-- | 195.7 KB |
db_test2.cc | -rw-r--r-- | 87.6 KB |
db_test_util.cc | -rw-r--r-- | 44.1 KB |
db_test_util.h | -rw-r--r-- | 30.6 KB |
db_universal_compaction_test.cc | -rw-r--r-- | 66.8 KB |
db_wal_test.cc | -rw-r--r-- | 46.7 KB |
db_write_test.cc | -rw-r--r-- | 3.6 KB |
dbformat.cc | -rw-r--r-- | 6.1 KB |
dbformat.h | -rw-r--r-- | 21.3 KB |
dbformat_test.cc | -rw-r--r-- | 7.0 KB |
deletefile_test.cc | -rw-r--r-- | 16.1 KB |
event_helpers.cc | -rw-r--r-- | 4.8 KB |
event_helpers.h | -rw-r--r-- | 2.0 KB |
experimental.cc | -rw-r--r-- | 1.5 KB |
external_sst_file_basic_test.cc | -rw-r--r-- | 24.7 KB |
external_sst_file_ingestion_job.cc | -rw-r--r-- | 19.4 KB |
external_sst_file_ingestion_job.h | -rw-r--r-- | 5.3 KB |
external_sst_file_test.cc | -rw-r--r-- | 68.1 KB |
fault_injection_test.cc | -rw-r--r-- | 16.3 KB |
file_indexer.cc | -rw-r--r-- | 7.5 KB |
file_indexer.h | -rw-r--r-- | 6.1 KB |
file_indexer_test.cc | -rw-r--r-- | 9.8 KB |
filename_test.cc | -rw-r--r-- | 5.6 KB |
flush_job.cc | -rw-r--r-- | 14.6 KB |
flush_job.h | -rw-r--r-- | 3.6 KB |
flush_job_test.cc | -rw-r--r-- | 8.6 KB |
flush_scheduler.cc | -rw-r--r-- | 2.4 KB |
flush_scheduler.h | -rw-r--r-- | 1.2 KB |
forward_iterator.cc | -rw-r--r-- | 28.2 KB |
forward_iterator.h | -rw-r--r-- | 5.5 KB |
forward_iterator_bench.cc | -rw-r--r-- | 11.3 KB |
internal_stats.cc | -rw-r--r-- | 53.9 KB |
internal_stats.h | -rw-r--r-- | 22.3 KB |
job_context.h | -rw-r--r-- | 5.5 KB |
listener_test.cc | -rw-r--r-- | 29.0 KB |
log_format.h | -rw-r--r-- | 1.3 KB |
log_reader.cc | -rw-r--r-- | 13.9 KB |
log_reader.h | -rw-r--r-- | 5.5 KB |
log_test.cc | -rw-r--r-- | 21.6 KB |
log_writer.cc | -rw-r--r-- | 4.5 KB |
log_writer.h | -rw-r--r-- | 3.8 KB |
malloc_stats.cc | -rw-r--r-- | 1.6 KB |
malloc_stats.h | -rw-r--r-- | 623 bytes |
managed_iterator.cc | -rw-r--r-- | 6.6 KB |
managed_iterator.h | -rw-r--r-- | 2.4 KB |
manual_compaction_test.cc | -rw-r--r-- | 4.4 KB |
memtable.cc | -rw-r--r-- | 34.7 KB |
memtable.h | -rw-r--r-- | 17.7 KB |
memtable_list.cc | -rw-r--r-- | 16.3 KB |
memtable_list.h | -rw-r--r-- | 10.4 KB |
memtable_list_test.cc | -rw-r--r-- | 21.4 KB |
merge_context.h | -rw-r--r-- | 3.2 KB |
merge_helper.cc | -rw-r--r-- | 15.7 KB |
merge_helper.h | -rw-r--r-- | 8.0 KB |
merge_helper_test.cc | -rw-r--r-- | 11.2 KB |
merge_operator.cc | -rw-r--r-- | 3.1 KB |
merge_test.cc | -rw-r--r-- | 14.0 KB |
obsolete_files_test.cc | -rw-r--r-- | 6.5 KB |
options_file_test.cc | -rw-r--r-- | 3.5 KB |
perf_context_test.cc | -rw-r--r-- | 22.8 KB |
pinned_iterators_manager.h | -rw-r--r-- | 2.4 KB |
plain_table_db_test.cc | -rw-r--r-- | 39.6 KB |
pre_release_callback.h | -rw-r--r-- | 1.2 KB |
prefix_test.cc | -rw-r--r-- | 29.2 KB |
range_del_aggregator.cc | -rw-r--r-- | 21.9 KB |
range_del_aggregator.h | -rw-r--r-- | 8.5 KB |
range_del_aggregator_test.cc | -rw-r--r-- | 6.2 KB |
read_callback.h | -rw-r--r-- | 569 bytes |
repair.cc | -rw-r--r-- | 23.6 KB |
repair_test.cc | -rw-r--r-- | 11.5 KB |
snapshot_checker.h | -rw-r--r-- | 1.6 KB |
snapshot_impl.cc | -rw-r--r-- | 767 bytes |
snapshot_impl.h | -rw-r--r-- | 4.0 KB |
table_cache.cc | -rw-r--r-- | 16.9 KB |
table_cache.h | -rw-r--r-- | 6.3 KB |
table_properties_collector.cc | -rw-r--r-- | 3.8 KB |
table_properties_collector.h | -rw-r--r-- | 4.3 KB |
table_properties_collector_test.cc | -rw-r--r-- | 17.9 KB |
transaction_log_impl.cc | -rw-r--r-- | 10.5 KB |
transaction_log_impl.h | -rw-r--r-- | 4.3 KB |
version_builder.cc | -rw-r--r-- | 15.3 KB |
version_builder.h | -rw-r--r-- | 1.6 KB |
version_builder_test.cc | -rw-r--r-- | 10.4 KB |
version_edit.cc | -rw-r--r-- | 19.0 KB |
version_edit.h | -rw-r--r-- | 10.0 KB |
version_edit_test.cc | -rw-r--r-- | 6.5 KB |
version_set.cc | -rw-r--r-- | 148.4 KB |
version_set.h | -rw-r--r-- | 39.3 KB |
version_set_test.cc | -rw-r--r-- | 14.6 KB |
wal_manager.cc | -rw-r--r-- | 16.2 KB |
wal_manager.h | -rw-r--r-- | 3.3 KB |
wal_manager_test.cc | -rw-r--r-- | 9.5 KB |
write_batch.cc | -rw-r--r-- | 63.3 KB |
write_batch_base.cc | -rw-r--r-- | 3.1 KB |
write_batch_internal.h | -rw-r--r-- | 8.8 KB |
write_batch_test.cc | -rw-r--r-- | 26.6 KB |
write_callback.h | -rw-r--r-- | 803 bytes |
write_callback_test.cc | -rw-r--r-- | 14.5 KB |
write_controller.cc | -rw-r--r-- | 4.0 KB |
write_controller.h | -rw-r--r-- | 4.7 KB |
write_controller_test.cc | -rw-r--r-- | 4.6 KB |
write_thread.cc | -rw-r--r-- | 24.0 KB |
write_thread.h | -rw-r--r-- | 14.7 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...