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
History
File Mode Size
buckifier
build_tools
cache
cmake
coverage
db
docs
env
examples
hdfs
include
java
memtable
monitoring
options
port
table
third-party
tools
util
utilities
.clang-format -rw-r--r-- 138 bytes
.gitignore -rw-r--r-- 705 bytes
.travis.yml -rw-r--r-- 3.2 KB
AUTHORS -rw-r--r-- 322 bytes
CMakeLists.txt -rw-r--r-- 33.8 KB
CODE_OF_CONDUCT.md -rw-r--r-- 249 bytes
CONTRIBUTING.md -rw-r--r-- 706 bytes
COPYING -rw-r--r-- 17.7 KB
DEFAULT_OPTIONS_HISTORY.md -rw-r--r-- 1.5 KB
DUMP_FORMAT.md -rw-r--r-- 763 bytes
HISTORY.md -rw-r--r-- 57.6 KB
INSTALL.md -rw-r--r-- 7.4 KB
LANGUAGE-BINDINGS.md -rw-r--r-- 904 bytes
LICENSE.Apache -rw-r--r-- 11.1 KB
LICENSE.leveldb -rw-r--r-- 1.5 KB
Makefile -rw-r--r-- 63.9 KB
README.md -rw-r--r-- 1.8 KB
ROCKSDB_LITE.md -rw-r--r-- 1.0 KB
TARGETS -rw-r--r-- 26.5 KB
USERS.md -rw-r--r-- 5.3 KB
Vagrantfile -rw-r--r-- 1017 bytes
WINDOWS_PORT.md -rw-r--r-- 12.5 KB
appveyor.yml -rw-r--r-- 428 bytes
issue_template.md -rw-r--r-- 243 bytes
src.mk -rw-r--r-- 27.6 KB
thirdparty.inc -rw-r--r-- 6.4 KB

README.md

back to top