1. 06 3月, 2018 1 次提交
    • Z
      fix FreeBSD build · 92b1a68d
      Zhongyi Xie 提交于
      Summary:
      Currently FreeBSD build is broken in master and possibly some previous releases due to unrecognized symbol `O_DIRECT`.
      This PR will fix the build on FreeBSD
      Closes https://github.com/facebook/rocksdb/pull/3560
      
      Differential Revision: D7148646
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 95b6c3d310fa531267c086b2cd40a5ab1c042b5a
      92b1a68d
  2. 24 2月, 2018 1 次提交
    • A
      Fix the Logger::Close() and DBImpl::Close() design pattern · dfbe52e0
      Anand Ananthabhotla 提交于
      Summary:
      The recent Logger::Close() and DBImpl::Close() implementation rely on
      calling the CloseImpl() virtual function from the destructor, which will
      not work. Refactor the implementation to have a private close helper
      function in derived classes that can be called by both CloseImpl() and
      the destructor.
      Closes https://github.com/facebook/rocksdb/pull/3528
      
      Reviewed By: gfosco
      
      Differential Revision: D7049303
      
      Pulled By: anand1976
      
      fbshipit-source-id: 76a64cbf403209216dfe4864ecf96b5d7f3db9f4
      dfbe52e0
  3. 23 2月, 2018 2 次提交
  4. 16 2月, 2018 1 次提交
    • J
      Several small "fixes" · 4e7a182d
      jsteemann 提交于
      Summary:
      - removed a few unneeded variables
      - fused some variable declarations and their assignments
      - fixed right-trimming code in string_util.cc to not underflow
      - simplifed an assertion
      - move non-nullptr check assertion before dereferencing of that pointer
      - pass an std::string function parameter by const reference instead of by value (avoiding potential copy)
      Closes https://github.com/facebook/rocksdb/pull/3507
      
      Differential Revision: D7004679
      
      Pulled By: sagar0
      
      fbshipit-source-id: 52944952d9b56dfcac3bea3cd7878e315bb563c4
      4e7a182d
  5. 03 2月, 2018 1 次提交
  6. 17 1月, 2018 1 次提交
    • A
      Add a Close() method to DB to return status when closing a db · d0f1b49a
      Anand Ananthabhotla 提交于
      Summary:
      Currently, the only way to close an open DB is to destroy the DB
      object. There is no way for the caller to know the status. In one
      instance, the destructor encountered an error due to failure to
      close a log file on HDFS. In order to prevent silent failures, we add
      DB::Close() that calls CloseImpl() which must be implemented by its
      descendants.
      The main failure point in the destructor is closing the log file. This
      patch also adds a Close() entry point to Logger in order to get status.
      When DBOptions::info_log is allocated and owned by the DBImpl, it is
      explicitly closed by DBImpl::CloseImpl().
      Closes https://github.com/facebook/rocksdb/pull/3348
      
      Differential Revision: D6698158
      
      Pulled By: anand1976
      
      fbshipit-source-id: 9468e2892553eb09c4c41b8723f590c0dbd8ab7d
      d0f1b49a
  7. 16 11月, 2017 1 次提交
    • Y
      Suppress valgrind "unimplemented functionality" error · bbcd3b0b
      Yi Wu 提交于
      Summary:
      Add ROCKSDB_VALGRIND_RUN macro and suppress false-positive "unimplemented functionality" throw by valgrind for steam hints.
      
      Another approach would be add a valgrind suppress file. Valgrind is suppose to print the suppression when given "--gen-suppressions=all" param, which is suppose to be the content for the suppression file. But it doesn't print.
      Closes https://github.com/facebook/rocksdb/pull/3174
      
      Differential Revision: D6338786
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 3559efa5f3b92d40d09ad6ac82bc7b59f86c75aa
      bbcd3b0b
  8. 11 11月, 2017 2 次提交
    • D
      Fix crashes, address test issues and adjust windows test script · f8e2db07
      Dmitri Smirnov 提交于
      Summary:
      Add per-exe execution capability
        Add fix parsing of groups/tests
        Add timer test exclusion
      
       Fix unit tests
        Ifdef threadpool specific tests that do not pass on Vista threadpool.
        Remove spurious outout from prefix_test so test case listing works
        properly.
        Fix not using standard test directories results in file creation errors
        in sst_dump_test.
      
        BlobDb fixes:
          In C++ end() iterators can not be dereferenced. They are not valid.
      	When deleting blob_db_ set it to nullptr before any other code executes.
      	Not fixed:. On Windows you can not delete a file while it is open.
      	[ RUN      ] BlobDBTest.ReadWhileGC
      	d:\dev\rocksdb\rocksdb\utilities\blob_db\blob_db_test.cc(75): error: DestroyBlobDB(dbname_, options, bdb_options)
      	IO error: Failed to delete: d:/mnt/db\testrocksdb-17444/blob_db_test/blob_dir/000001.blob: Permission denied
      	d:\dev\rocksdb\rocksdb\utilities\blob_db\blob_db_test.cc(75): error: DestroyBlobDB(dbname_, options, bdb_options)
      	IO error: Failed to delete: d:/mnt/db\testrocksdb-17444/blob_db_test/blob_dir/000001.blob: Permission denied
      
        write_batch
          Should not call front() if there is a chance the container is empty
      Closes https://github.com/facebook/rocksdb/pull/3152
      
      Differential Revision: D6293274
      
      Pulled By: sagar0
      
      fbshipit-source-id: 318c3717c22087fae13b18715dffb24565dbd956
      f8e2db07
    • S
      Stream · eefd75a2
      Shaohua Li 提交于
      Summary:
      Add a simple policy for NVMe write time life hint
      Closes https://github.com/facebook/rocksdb/pull/3095
      
      Differential Revision: D6298030
      
      Pulled By: shligit
      
      fbshipit-source-id: 9a72a42e32e92193af11599eb71f0cf77448e24d
      eefd75a2
  9. 01 11月, 2017 1 次提交
  10. 31 10月, 2017 1 次提交
  11. 25 10月, 2017 1 次提交
  12. 24 10月, 2017 1 次提交
  13. 20 10月, 2017 1 次提交
  14. 23 9月, 2017 1 次提交
    • A
      Repair DBs with trailing slash in name · 4708a687
      Andrew Kryczka 提交于
      Summary:
      Problem:
      
      - `DB::SanitizeOptions` strips trailing slash from `wal_dir` but not `dbname`
      - We check whether `wal_dir` and `dbname` refer to the same directory using string equality: https://github.com/facebook/rocksdb/blob/master/db/repair.cc#L258
      - Providing `dbname` with trailing slash causes default `wal_dir` to be misidentified as a separate directory.
      - Then the repair tries to add all SST files to the `VersionEdit` twice (once for `dbname` dir, once for `wal_dir`) and fails with coredump.
      
      Solution:
      
      - Add a new `Env` function, `AreFilesSame`, which uses device and inode number to check whether files are the same. It's currently only implemented in `PosixEnv`.
      - Migrate repair to use `AreFilesSame` to check whether `dbname` and `wal_dir` are same. If unsupported, falls back to string comparison.
      Closes https://github.com/facebook/rocksdb/pull/2827
      
      Differential Revision: D5761349
      
      Pulled By: ajkr
      
      fbshipit-source-id: c839d548678b742af1166d60b09abd94e5476238
      4708a687
  15. 04 8月, 2017 1 次提交
    • A
      Introduce bottom-pri thread pool for large universal compactions · cc01985d
      Andrew Kryczka 提交于
      Summary:
      When we had a single thread pool for compactions, a thread could be busy for a long time (minutes) executing a compaction involving the bottom level. In multi-instance setups, the entire thread pool could be consumed by such bottom-level compactions. Then, top-level compactions (e.g., a few L0 files) would be blocked for a long time ("head-of-line blocking"). Such top-level compactions are critical to prevent compaction stalls as they can quickly reduce number of L0 files / sorted runs.
      
      This diff introduces a bottom-priority queue for universal compactions including the bottom level. This alleviates the head-of-line blocking situation for fast, top-level compactions.
      
      - Added `Env::Priority::BOTTOM` thread pool. This feature is only enabled if user explicitly configures it to have a positive number of threads.
      - Changed `ThreadPoolImpl`'s default thread limit from one to zero. This change is invisible to users as we call `IncBackgroundThreadsIfNeeded` on the low-pri/high-pri pools during `DB::Open` with values of at least one. It is necessary, though, for bottom-pri to start with zero threads so the feature is disabled by default.
      - Separated `ManualCompaction` into two parts in `PrepickedCompaction`. `PrepickedCompaction` is used for any compaction that's picked outside of its execution thread, either manual or automatic.
      - Forward universal compactions involving last level to the bottom pool (worker thread's entry point is `BGWorkBottomCompaction`).
      - Track `bg_bottom_compaction_scheduled_` so we can wait for bottom-level compactions to finish. We don't count them against the background jobs limits. So users of this feature will get an extra compaction for free.
      Closes https://github.com/facebook/rocksdb/pull/2580
      
      Differential Revision: D5422916
      
      Pulled By: ajkr
      
      fbshipit-source-id: a74bd11f1ea4933df3739b16808bb21fcd512333
      cc01985d
  16. 29 7月, 2017 1 次提交
    • S
      Replace dynamic_cast<> · 21696ba5
      Siying Dong 提交于
      Summary:
      Replace dynamic_cast<> so that users can choose to build with RTTI off, so that they can save several bytes per object, and get tiny more memory available.
      Some nontrivial changes:
      1. Add Comparator::GetRootComparator() to get around the internal comparator hack
      2. Add the two experiemental functions to DB
      3. Add TableFactory::GetOptionString() to avoid unnecessary casting to get the option string
      4. Since 3 is done, move the parsing option functions for table factory to table factory files too, to be symmetric.
      Closes https://github.com/facebook/rocksdb/pull/2645
      
      Differential Revision: D5502723
      
      Pulled By: siying
      
      fbshipit-source-id: fd13cec5601cf68a554d87bfcf056f2ffa5fbf7c
      21696ba5
  17. 22 7月, 2017 2 次提交
  18. 16 7月, 2017 1 次提交
  19. 13 7月, 2017 1 次提交
  20. 06 7月, 2017 1 次提交
    • A
      Fix GetCurrentTime() initialization for valgrind · 33042573
      Andrew Kryczka 提交于
      Summary:
      Valgrind had false positive complaints about the initialization pattern for `GetCurrentTime()`'s argument in #2480. We can instead have the client initialize the time variable before calling `GetCurrentTime()`, and have `GetCurrentTime()` promise to only overwrite it in success case.
      Closes https://github.com/facebook/rocksdb/pull/2526
      
      Differential Revision: D5358689
      
      Pulled By: ajkr
      
      fbshipit-source-id: 857b189f24c19196f6bb299216f3e23e7bc4be42
      33042573
  21. 27 6月, 2017 2 次提交
    • E
      Encryption at rest support · 51778612
      Ewout Prangsma 提交于
      Summary:
      This PR adds support for encrypting data stored by RocksDB when written to disk.
      
      It adds an `EncryptedEnv` override of the `Env` class with matching overrides for sequential&random access files.
      The encryption itself is done through a configurable `EncryptionProvider`. This class creates is asked to create `BlockAccessCipherStream` for a file. This is where the actual encryption/decryption is being done.
      Currently there is a Counter mode implementation of `BlockAccessCipherStream` with a `ROT13` block cipher (NOTE the `ROT13` is for demo purposes only!!).
      
      The Counter operation mode uses an initial counter & random initialization vector (IV).
      Both are created randomly for each file and stored in a 4K (default size) block that is prefixed to that file. The `EncryptedEnv` implementation is such that clients of the `Env` class do not see this prefix (nor data, nor in filesize).
      The largest part of the prefix block is also encrypted, and there is room left for implementation specific settings/values/keys in there.
      
      To test the encryption, the `DBTestBase` class has been extended to consider a new environment variable called `ENCRYPTED_ENV`. If set, the test will setup a encrypted instance of the `Env` class to use for all tests.
      Typically you would run it like this:
      
      ```
      ENCRYPTED_ENV=1 make check_some
      ```
      
      There is also an added test that checks that some data inserted into the database is or is not "visible" on disk. With `ENCRYPTED_ENV` active it must not find plain text strings, with `ENCRYPTED_ENV` unset, it must find the plain text strings.
      Closes https://github.com/facebook/rocksdb/pull/2424
      
      Differential Revision: D5322178
      
      Pulled By: sdwilsh
      
      fbshipit-source-id: 253b0a9c2c498cc98f580df7f2623cbf7678a27f
      51778612
    • S
      Improve the error message for I/O related errors. · 857e9960
      Siying Dong 提交于
      Summary:
      Force people to write something other than file name while returning status for IOError.
      Closes https://github.com/facebook/rocksdb/pull/2493
      
      Differential Revision: D5321309
      
      Pulled By: siying
      
      fbshipit-source-id: 38bcf6c19e80831cd3e300a047e975cbb131d822
      857e9960
  22. 13 6月, 2017 1 次提交
  23. 09 6月, 2017 3 次提交
  24. 07 6月, 2017 1 次提交
  25. 02 6月, 2017 1 次提交
    • M
      Retire memenv https://github.com/facebook/rocksdb/pull/2082 · 5a9b4d74
      Maysam Yabandeh 提交于
      Summary:
      This is a manual commit of this PR:
      Retire InMemoryEnv in favor of MockEnv #2082
      With MockEnv doing the same yet being more mature, InMemoryEnv is redundant.
      
      Reviewed By: IslamAbdelRahman
      
      Differential Revision: D5162323
      
      fbshipit-source-id: 59fd0082a891dc99cc531e4da9d68bf891eae3f5
      5a9b4d74
  26. 24 5月, 2017 1 次提交
    • A
      New API for background work in single thread pool · 6cc9aef1
      Andrew Kryczka 提交于
      Summary:
      Previously users could set `max_background_flushes=0` to force rocksdb to use a single thread pool for both background flushes and compactions. That'll no longer be possible since I'm going to deprecate `max_background_flushes` and `max_background_compactions` in favor of a single option. This diff introduces a new way to force a single thread pool: when high-pri pool has zero threads, all background jobs will be submitted to low-pri pool.
      
      Note the majority of the code change is adding `Env::GetBackgroundThreads()`, which is necessary to check whether the user has provided a zero-sized thread pool.
      Closes https://github.com/facebook/rocksdb/pull/2204
      
      Differential Revision: D4936256
      
      Pulled By: ajkr
      
      fbshipit-source-id: 929a07a0c0705f7766f5339cd013ff74e90d6e01
      6cc9aef1
  27. 23 5月, 2017 1 次提交
  28. 11 5月, 2017 1 次提交
  29. 04 5月, 2017 1 次提交
  30. 29 4月, 2017 1 次提交
  31. 28 4月, 2017 1 次提交
  32. 27 4月, 2017 1 次提交
  33. 26 4月, 2017 1 次提交
  34. 22 4月, 2017 1 次提交