1. 16 6月, 2018 7 次提交
  2. 14 6月, 2018 4 次提交
    • A
      Check with PosixEnv before opening LOCK file (#3993) · 1f32dc7d
      Andrew Kryczka 提交于
      Summary:
      Rebased and resubmitting #1831 on behalf of stevelittle.
      
      The problem is when a single process attempts to open the same DB twice, the second attempt fails due to LOCK file held. If the second attempt had opened the LOCK file, it'll now need to close it, and closing causes the file to be unlocked. Then, any subsequent attempt to open the DB will succeed, which is the wrong behavior.
      
      The solution was to track which files a process has locked in PosixEnv, and check those before opening a LOCK file.
      
      Fixes #1780.
      Closes https://github.com/facebook/rocksdb/pull/3993
      
      Differential Revision: D8398984
      
      Pulled By: ajkr
      
      fbshipit-source-id: 2755fe66950a0c9de63075f932f9e15768041918
      1f32dc7d
    • A
      Run manual compaction in stress/crash tests (#3936) · 7497f992
      Andrew Kryczka 提交于
      Summary:
      - Add support to `db_stress` for `CompactRange`
      - Enable `CompactRange` and `CompactFiles` in crash tests
      Closes https://github.com/facebook/rocksdb/pull/3936
      
      Differential Revision: D8230953
      
      Pulled By: ajkr
      
      fbshipit-source-id: 208f9980b5bc8c204b1fa726e83791ad674e21e8
      7497f992
    • A
      Choose unique keys faster in db_stress (#3990) · dd216dd7
      Andrew Kryczka 提交于
      Summary:
      db_stress initialization randomly chooses a set of keys to not overwrite. It was doing it separately for each column family. That caused 30+ second initialization times for the non-simple crash tests, which have 10 CFs. This PR:
      
      - reuses the same set of randomly chosen no-overwrite keys across all CFs
      - logs a couple more timestamps so we can more easily see initialization time
      Closes https://github.com/facebook/rocksdb/pull/3990
      
      Differential Revision: D8393821
      
      Pulled By: ajkr
      
      fbshipit-source-id: d0b263a298df607285ffdd8b0983ff6575cc6c34
      dd216dd7
    • A
      Avoid acquiring SyncPoint mutex when it is disabled (#3991) · a7204018
      Andrew Kryczka 提交于
      Summary:
      In `db_stress` profile the vast majority of CPU time is spent acquiring the `SyncPoint` mutex. I mistakenly assumed #3939 had fixed this mutex contention problem by disabling `SyncPoint` processing. But actually the lock was still being acquired just to check whether processing is enabled. We can avoid that overhead by using an atomic to track whether it's enabled.
      Closes https://github.com/facebook/rocksdb/pull/3991
      
      Differential Revision: D8393825
      
      Pulled By: ajkr
      
      fbshipit-source-id: 5bc4e3c722ee7304e7a9c2439998c456b05a6897
      a7204018
  3. 13 6月, 2018 4 次提交
    • S
      Fix regression bug of Prev() with upper bound (#3989) · d82f1421
      Siying Dong 提交于
      Summary:
      A recent change pushed down the upper bound checking to child iterators. However, this causes the logic of following sequence wrong:
        Seek(key);
        if (!Valid()) SeekToLast();
      Because !Valid() may be caused by upper bounds, rather than the end of the iterator. In this case SeekToLast() points to totally wrong places. This can cause wrong results, infinite loops, or segfault in some cases.
      This sequence is called when changing direction from forward to backward. And this by itself also implicitly happen during reseeking optimization in Prev().
      
      Fix this bug by using SeekForPrev() rather than this sequuence, as what is already done in prefix extrator case.
      Closes https://github.com/facebook/rocksdb/pull/3989
      
      Differential Revision: D8385422
      
      Pulled By: siying
      
      fbshipit-source-id: 429e869990cfd2dc389421e0836fc496bed67bb4
      d82f1421
    • A
      Fix argument mismatch in BlockBasedTableBuilder (#3974) · 9d347332
      Andrew Kryczka 提交于
      Summary:
      The sixth argument should be `key_includes_seq` bool, the seventh a `GetContext*`. We were mistakenly passing the `GetContext*` as the sixth argument and relying on the default (nullptr) for the seventh. This would make statistics inaccurate, at least.
      
      Blame: 402b7aa0
      Closes https://github.com/facebook/rocksdb/pull/3974
      
      Differential Revision: D8344907
      
      Pulled By: ajkr
      
      fbshipit-source-id: 3ad865a0541d6d30f75dfc726352788118cfe12e
      9d347332
    • S
      Fix a crash in WinEnvIO::GetSectorSize (#3975) · 9c7da963
      shpala 提交于
      Summary:
      Fix a crash in `WinEnvIO::GetSectorSize` that happens on old Windows systems (e.g Windows 7).
      On old Windows systems that don't support querying StorageAccessAlignmentProperty using IOCTL_STORAGE_QUERY_PROPERTY, the flow calls a different DeviceIoControl with nullptr as lpBytesReturned.
      When the code reaches this point, we get an access violation.
      Closes https://github.com/facebook/rocksdb/pull/3975
      
      Differential Revision: D8385186
      
      Pulled By: ajkr
      
      fbshipit-source-id: fae4c9b4b0a52c8a10182e1b35bcaa30dc393bbb
      9c7da963
    • F
      Remove restart point from the properties_block (#3970) · 35932753
      Fenggang Wu 提交于
      Summary:
      Property block will be read sequentially and cached in a heap located
      object, so there's no need for restart points. Thus we set the restart
      interval to infinity to save space.
      Closes https://github.com/facebook/rocksdb/pull/3970
      
      Differential Revision: D8332586
      
      Pulled By: fgwu
      
      fbshipit-source-id: 899c3267832a81d0f084ec2db6b387332f461134
      35932753
  4. 09 6月, 2018 1 次提交
  5. 08 6月, 2018 3 次提交
    • Y
      Fix build errors. · 3470c758
      Yanqin Jin 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3967
      
      Differential Revision: D8322775
      
      Pulled By: riversand963
      
      fbshipit-source-id: bd73067bd5d3ed4627348f0685bc499359ad6442
      3470c758
    • Z
      Fixed the fprintf of uint64_t by using PRIu64 (#3963) · 23e1d236
      Zhichao Cao 提交于
      Summary:
      Fixed the fprintf format of uint64_t by using PRIu64 in file tools/ldb_cmd.cc
      Closes https://github.com/facebook/rocksdb/pull/3963
      
      Differential Revision: D8306179
      
      Pulled By: zhichao-cao
      
      fbshipit-source-id: 597dcd55321576801bbf2cf4714736ebc4750a0c
      23e1d236
    • Y
      Refactoring db_stress.cc (#3902) · 0a0860a5
      Yanqin Jin 提交于
      Summary:
      We use `db_stress.cc` intensively to test and verify the behavior of RocksDB. Sometimes we need to add new tests for recently added features. Original `StressTest` class provides many general functionality that can be leveraged by other tests. Therefore, in this refactoring PR, I try to identify the general operations as well as operations that future tests most likely want to customize. Future tests can inherit `StressTest` and overriding the virtual functions to test custom logic.
      Closes https://github.com/facebook/rocksdb/pull/3902
      
      Differential Revision: D8284607
      
      Pulled By: riversand963
      
      fbshipit-source-id: 019302d04665a2b18334b6d05d04a477168c8ea4
      0a0860a5
  6. 07 6月, 2018 3 次提交
  7. 06 6月, 2018 3 次提交
  8. 05 6月, 2018 4 次提交
    • M
      Extend some tests to format_version=3 (#3942) · d0c38c0c
      Maysam Yabandeh 提交于
      Summary:
      format_version=3 changes the format of SST index. This is however not being tested currently since tests only work with the default format_version which is currently 2. The patch extends the most related tests to also test for format_version=3.
      Closes https://github.com/facebook/rocksdb/pull/3942
      
      Differential Revision: D8238413
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: 915725f55753dd8e9188e802bf471c23645ad035
      d0c38c0c
    • A
      Fix singleton destruction order of PosixEnv and SyncPoint (#3951) · 22101529
      Andrew Kryczka 提交于
      Summary:
      Ensure the PosixEnv singleton is destroyed first since its destructor waits for background threads to all complete. This ensures background threads cannot hit sync points after the SyncPoint singleton is destroyed, which was previously possible.
      Closes https://github.com/facebook/rocksdb/pull/3951
      
      Differential Revision: D8265295
      
      Pulled By: ajkr
      
      fbshipit-source-id: 7738dd458c5d993a78377dd0420e82badada81ab
      22101529
    • M
      Fix clang analyze · ab2254be
      Manuel Ung 提交于
      Summary:
      This fixes the errors as reported here:
      https://github.com/facebook/rocksdb/pull/3941#issuecomment-394424043
      Closes https://github.com/facebook/rocksdb/pull/3950
      
      Differential Revision: D8263086
      
      Pulled By: lth
      
      fbshipit-source-id: 5e148d489cab2153e5846d16979a0a1f2d677d57
      ab2254be
    • D
      Provide a way to override windows memory allocator with jemalloc for ZSTD · f4b72d70
      Dmitri Smirnov 提交于
      Summary:
      Windows does not have LD_PRELOAD mechanism to override all memory allocation functions and ZSTD makes use of C-tuntime calloc. During flushes and compactions default system allocator fragments and the system slows down considerably.
      
      For builds with jemalloc we employ an advanced ZSTD context creation API that re-directs memory allocation to jemalloc. To reduce the cost of context creation on each block we cache ZSTD context within the block based table builder while a new SST file is being built, this will help all platform builds including those w/o jemalloc. This avoids system allocator fragmentation and improves the performance.
      
      The change does not address random reads and currently on Windows reads with ZSTD regress as compared with SNAPPY compression.
      Closes https://github.com/facebook/rocksdb/pull/3838
      
      Differential Revision: D8229794
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 719b622ab7bf4109819bc44f45ec66f0dd3ee80d
      f4b72d70
  9. 04 6月, 2018 1 次提交
    • A
      Fix crash test check for direct I/O · 4f297ad0
      Andrew Kryczka 提交于
      Summary:
      We need to keep the DB directory around since the direct IO check in "db_crashtest.py" relies on it existing. This PR fixes an issue where it was removed after each stress test run during the second half of whitebox crash testing.
      Closes https://github.com/facebook/rocksdb/pull/3946
      
      Differential Revision: D8247998
      
      Pulled By: ajkr
      
      fbshipit-source-id: 4e7cffbdab9b40df125e7842d0d59916e76261d3
      4f297ad0
  10. 02 6月, 2018 5 次提交
    • Z
      Fix test for rocksdb_lite: hide incompatible option kDirectIO · 50d7ac0e
      Zhongyi Xie 提交于
      Summary:
      Previous commit https://github.com/facebook/rocksdb/pull/3935 unhide a few test options which includes kDirectIO. However it's not supported by RocksDB lite. Need to hide this option from the lite build.
      Closes https://github.com/facebook/rocksdb/pull/3943
      
      Differential Revision: D8242757
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 1edfad3a5d01a46bfb7eedee765981ebe02c500a
      50d7ac0e
    • A
      Copy Get() result when file reads use mmap · fea2b1df
      Andrew Kryczka 提交于
      Summary:
      For iterator reads, a `SuperVersion` is pinned to preserve a snapshot of SST files, and `Block`s are pinned to allow `key()` and `value()` to return pointers directly into a RocksDB memory region. This works for both non-mmap reads, where the block owns the memory region, and mmap reads, where the file owns the memory region.
      
      For point reads with `PinnableSlice`, only the `Block` object is pinned. This works for non-mmap reads because the block owns the memory region, so even if the file is deleted after compaction, the memory region survives. However, for mmap reads, file deletion causes the memory region to which the `PinnableSlice` refers to be unmapped.   The result is usually a segfault upon accessing the `PinnableSlice`, although sometimes it returned wrong results (I repro'd this a bunch of times with `db_stress`).
      
      This PR copies the value into the `PinnableSlice` when it comes from mmap'd memory. We can tell whether the `Block` owns its memory using `Block::cachable()`, which is unset when reads do not use the provided buffer as is the case with mmap file reads. When that is false we ensure the result of `Get()` is copied.
      
      This feels like a short-term solution as ideally we'd have the `PinnableSlice` pin the mmap'd memory so we can do zero-copy reads. It seemed hard so I chose this approach to fix correctness in the meantime.
      Closes https://github.com/facebook/rocksdb/pull/3881
      
      Differential Revision: D8076288
      
      Pulled By: ajkr
      
      fbshipit-source-id: 31d78ec010198723522323dbc6ea325122a46b08
      fea2b1df
    • A
      Configure direct I/O statically in db_stress · 88c3ee2d
      Andrew Kryczka 提交于
      Summary:
      Previously `db_stress` attempted to configure direct I/O dynamically in `SetOptions()` which had multiple problems (ummm must've never been tested):
      
      - It's a DB option so SetDBOptions should've been called instead
      - It's not a dynamic option so even SetDBOptions would fail
      - It required enabling SyncPoint to mask O_DIRECT since it had no way to detect whether the DB directory was in tmpfs or not. This required locking that consumed ~80% of db_stress CPU.
      
      In this PR I delete the broken dynamic config and instead configure it statically, only enabling it if the DB directory truly supports O_DIRECT.
      Closes https://github.com/facebook/rocksdb/pull/3939
      
      Differential Revision: D8238120
      
      Pulled By: ajkr
      
      fbshipit-source-id: 60bb2deebe6c9b54a3f788079261715b4a229279
      88c3ee2d
    • M
      Extend existing unit tests to run with WriteUnprepared as well · 01e3c30d
      Manuel Ung 提交于
      Summary:
      As titled.
      
      I have not extended the Compatibility tests because the new WAL markers are still unimplemented.
      Closes https://github.com/facebook/rocksdb/pull/3941
      
      Differential Revision: D8238394
      
      Pulled By: lth
      
      fbshipit-source-id: 980e3d44837bbf2cfa64047f9738f559dfac4b1d
      01e3c30d
    • S
      add c api rocksdb_sstfilewriter_file_size · 89b37081
      straw 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3922
      
      Differential Revision: D8208528
      
      Pulled By: ajkr
      
      fbshipit-source-id: d384fe53cf526f2aadc7b79a423ce36dbd3ff224
      89b37081
  11. 01 6月, 2018 5 次提交