]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/log
rocksdb.git
10 years agoEnsure the destruction order of PosixEnv and ThreadLocalPtr
Yueh-Hsuan Chiang [Fri, 11 Dec 2015 08:21:58 +0000 (00:21 -0800)]
Ensure the destruction order of PosixEnv and ThreadLocalPtr

Summary:
By default, RocksDB initializes the singletons of ThreadLocalPtr first, then initializes PosixEnv
via static initializer.  Destructor terminates objects in reverse order, so terminating PosixEnv
(calling pthread_mutex_lock), then ThreadLocal (calling pthread_mutex_destroy).

However, in certain case, application might initialize PosixEnv first, then ThreadLocalPtr.
This will cause core dump at the end of the program (eg. https://github.com/facebook/mysql-5.6/issues/122)

This patch fix this issue by ensuring the destruction order by moving the global static singletons
to function static singletons.  Since function static singletons are initialized when the function is first
called, this property allows us invoke to enforce the construction of the static PosixEnv and the
singletons of ThreadLocalPtr by calling the function where the ThreadLocalPtr singletons belongs
right before we initialize the static PosixEnv.

Test Plan: Verified in the MyRocks.

Reviewers: yoshinorim, IslamAbdelRahman, rven, kradhakrishnan, anthony, sdong, MarkCallaghan

Reviewed By: anthony

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D51789

10 years agoMerge pull request #862 from ceph/wip-env
Igor Canadi [Fri, 11 Dec 2015 02:45:07 +0000 (18:45 -0800)]
Merge pull request #862 from ceph/wip-env

implement EnvMirror

10 years agoenv: add EnvMirror wip-env
Sage Weil [Fri, 11 Dec 2015 02:32:45 +0000 (21:32 -0500)]
env: add EnvMirror

This is an Env implementation that mirrors all storage-related methods on
two different backend Env's and verifies that they return the same
results (return status and read results).  This is useful for implementing
a new Env and verifying its correctness.

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoCorrect a comment in include/rocksdb/cache.h
Yueh-Hsuan Chiang [Fri, 11 Dec 2015 00:39:10 +0000 (16:39 -0800)]
Correct a comment in include/rocksdb/cache.h

Summary: Correct a comment in include/rocksdb/cache.h

Test Plan: No code change.

Reviewers: igor, sdong, IslamAbdelRahman, rven, kradhakrishnan, anthony

Reviewed By: anthony

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D51831

10 years agoFixed the valgrind error in ColumnFamilyTest::CreateAndDropRace
Yueh-Hsuan Chiang [Thu, 10 Dec 2015 19:53:53 +0000 (11:53 -0800)]
Fixed the valgrind error in ColumnFamilyTest::CreateAndDropRace

Summary: Fixed the valgrind error in ColumnFamilyTest::CreateAndDropRace

Test Plan: valgrind --error-exitcode=2 --leak-check=full ./column_family_test

Reviewers: kradhakrishnan, rven, anthony, IslamAbdelRahman, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D51795

10 years agoChange SingleDelete to support conflict checking
agiardullo [Thu, 5 Nov 2015 04:52:22 +0000 (20:52 -0800)]
Change SingleDelete to support conflict checking

Summary: For Transactions, we want to start using the SST files to do write conflict checking.  To do this, we need to make sure that compaction never removes all writes if an earlier snapshot exists.  So I had to change the way we process SingleDeletes to sometimes leave a SingleDelete behind when we encounter a Put followed by a SingleDelete.  See the comments in this diff for a more detailed explanation.

Test Plan: added more unit tests

Reviewers: rven, igor, kradhakrishnan, IslamAbdelRahman, yhchiang, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D50295

10 years agoFix DBCompactionTestWithParam.CompactionTrigger in non-jemalloc build.
sdong [Tue, 1 Dec 2015 06:16:49 +0000 (22:16 -0800)]
Fix DBCompactionTestWithParam.CompactionTrigger in non-jemalloc build.

Summary: DBCompactionTestWithParam.CompactionTrigger fails in non-jemalloc build, after the skip list memtable change. Fix it by making mem table flush trigger by number of entries.

Test Plan: Run the test using both of jemalloc and non-jemalloc build.

Reviewers: anthony, IslamAbdelRahman, rven, kradhakrishnan, igor, yhchiang

Reviewed By: yhchiang

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D51471

10 years agoRevert previous behavior of internal_key_skipped_count
sdong [Tue, 1 Dec 2015 05:32:59 +0000 (21:32 -0800)]
Revert previous behavior of internal_key_skipped_count

Summary: With recent commit 33e0c93826fd45640b24324a642ca03d8b9ef123, db iterator skips perf context counter internal_key_skipped_count when blindly issuing internal Next(). Now increment the counter by one when issuing this Next()

Test Plan: Run all existing tests

Reviewers: rven, yhchiang, IslamAbdelRahman, kradhakrishnan, igor, anthony

Reviewed By: anthony

Subscribers: yoshinorim, leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D51465

10 years agoFix CLANG build
agiardullo [Tue, 1 Dec 2015 02:06:06 +0000 (18:06 -0800)]
Fix CLANG build

Summary: fix clang build

Test Plan: build

Reviewers: IslamAbdelRahman, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D51453

10 years agoFixed some typos in the comments of rocksdb options file example
Yueh-Hsuan Chiang [Tue, 1 Dec 2015 02:10:00 +0000 (18:10 -0800)]
Fixed some typos in the comments of rocksdb options file example

Summary: Fixed some typos in the comments of rocksdb options file example

Test Plan: No code change.

Reviewers: igor, anthony, IslamAbdelRahman, rven, kradhakrishnan, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D51393

10 years agoFix DBTest.SuggestCompactRangeTest for disable jemalloc case
sdong [Mon, 30 Nov 2015 19:41:53 +0000 (11:41 -0800)]
Fix DBTest.SuggestCompactRangeTest for disable jemalloc case

Summary: DBTest.SuggestCompactRangeTest fails for the case when jemalloc is disabled, including ASAN and valgrind builds. It is caused by the improvement of skip list, which allocates different size of nodes for a new records. Fix it by using a special mem table that triggers a flush by number of entries. In that way the behavior will be consistent for all allocators.

Test Plan: Run the test with both of DISABLE_JEMALLOC=1 and 0

Reviewers: anthony, rven, yhchiang, kradhakrishnan, igor, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D51423

10 years agoDB to only flush the column family with the largest memtable while option.db_write_bu...
sdong [Tue, 24 Nov 2015 23:53:42 +0000 (15:53 -0800)]
DB to only flush the column family with the largest memtable while option.db_write_buffer_size is hit

Summary: When option.db_write_buffer_size is hit, we currently flush all column families. Move to flush the column family with the largest active memt table instead. In this way, we can avoid too many small files in some cases.

Test Plan: Modify test DBTest.SharedWriteBuffer to work with the updated behavior

Reviewers: kradhakrishnan, yhchiang, rven, anthony, IslamAbdelRahman, igor

Reviewed By: igor

Subscribers: march, leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D51291

10 years agoMerge pull request #860 from SherlockNoMad/BuildFix
Siying Dong [Mon, 30 Nov 2015 19:18:09 +0000 (11:18 -0800)]
Merge pull request #860 from SherlockNoMad/BuildFix

Fix ms version Appveyor build error

10 years agoFix ms version Appveyor build error
SherlockNoMad [Mon, 30 Nov 2015 19:07:47 +0000 (11:07 -0800)]
Fix ms version Appveyor build error

10 years agoInitialize options.row_cache
sdong [Mon, 30 Nov 2015 18:30:22 +0000 (10:30 -0800)]
Initialize options.row_cache

Summary: options.row_cache should already been initialized as null by default. Still try to set it following current convention, because one valgrind failure reports a failure related to it.

Test Plan: Run all unit tests

Reviewers: yhchiang, kradhakrishnan, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D51303

10 years agoFix clang build
Islam AbdelRahman [Mon, 30 Nov 2015 18:03:07 +0000 (10:03 -0800)]
Fix clang build

Summary: Fix clang

Test Plan: make check

Reviewers: sdong, yhchiang, rven

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D51417