1. 18 4月, 2020 1 次提交
    • Y
      Add IsDirectory() to Env and FS (#6711) · 243852ec
      Yanqin Jin 提交于
      Summary:
      IsDirectory() is a common API to check whether a path is a regular file or
      directory.
      POSIX: call stat() and use S_ISDIR(st_mode)
      Windows: PathIsDirectoryA() and PathIsDirectoryW()
      HDFS: FileSystem.IsDirectory()
      Java: File.IsDirectory()
      ...
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6711
      
      Test Plan: make check
      
      Reviewed By: anand1976
      
      Differential Revision: D21053520
      
      Pulled By: riversand963
      
      fbshipit-source-id: 680aadfd8ce982b63689190cf31b3145d5a89e27
      243852ec
  2. 21 3月, 2020 1 次提交
    • C
      Support direct IO in RandomAccessFileReader::MultiRead (#6446) · 4fc21664
      Cheng Chang 提交于
      Summary:
      By supporting direct IO in RandomAccessFileReader::MultiRead, the benefits of parallel IO (IO uring) and direct IO can be combined.
      
      In direct IO mode, read requests are aligned and merged together before being issued to RandomAccessFile::MultiRead, so blocks in the original requests might share the same underlying buffer, the shared buffers are returned in `aligned_bufs`, which is a new parameter of the `MultiRead` API.
      
      For example, suppose alignment requirement for direct IO is 4KB, one request is (offset: 1KB, len: 1KB), another request is (offset: 3KB, len: 1KB), then since they all belong to page (offset: 0, len: 4KB), `MultiRead` only reads the page with direct IO into a buffer on heap, and returns 2 Slices referencing regions in that same buffer. See `random_access_file_reader_test.cc` for more examples.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6446
      
      Test Plan: Added a new test `random_access_file_reader_test.cc`.
      
      Reviewed By: anand1976
      
      Differential Revision: D20097518
      
      Pulled By: cheng-chang
      
      fbshipit-source-id: ca48a8faf9c3af146465c102ef6b266a363e78d1
      4fc21664
  3. 21 2月, 2020 1 次提交
    • S
      Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) · fdf882de
      sdong 提交于
      Summary:
      When dynamically linking two binaries together, different builds of RocksDB from two sources might cause errors. To provide a tool for user to solve the problem, the RocksDB namespace is changed to a flag which can be overridden in build time.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/6433
      
      Test Plan: Build release, all and jtest. Try to build with ROCKSDB_NAMESPACE with another flag.
      
      Differential Revision: D19977691
      
      fbshipit-source-id: aa7f2d0972e1c31d75339ac48478f34f6cfcfb3e
      fdf882de
  4. 08 1月, 2020 1 次提交
  5. 21 9月, 2019 1 次提交
  6. 16 7月, 2019 1 次提交
  7. 05 4月, 2019 1 次提交
  8. 28 3月, 2019 1 次提交
  9. 22 3月, 2019 1 次提交
    • B
      fix NowNanos overflow (#5062) · 88d85b68
      Burton Li 提交于
      Summary:
      The original implementation of WinEnvIO::NowNanos() has a constant data overflow by:
      li.QuadPart *= std::nano::den;
      As a result, the api provides a incorrect result.
      e.g.:
      li.QuadPart=13477844301545
      std::nano::den=1e9
      
      The fix uses pre-computed nano_seconds_per_period_ to present the nano seconds per performance counter period, in the case if nano::den is divisible by perf_counter_frequency_. Otherwise it falls back to use high_resolution_clock.
      siying ajkr
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/5062
      
      Differential Revision: D14426842
      
      Pulled By: anand1976
      
      fbshipit-source-id: 127f1daf423dd4b30edd0dcf8ea0466f468bec12
      88d85b68
  10. 12 10月, 2018 1 次提交
    • W
      Add compile time option to work with utf8 filename strings (#4469) · 5d809ece
      Wilfried Goesgens 提交于
      Summary:
      The default behaviour of rocksdb is to use the `*A(` windows API functions.
      These accept filenames in the currently configured system encoding,
      be it Latin 1, utf8 or whatever.
      If the Application intends to completely work with utf8 strings internally,
      converting these to that codepage properly isn't even always possible.
      Thus this patch adds a switch to use the `*W(` functions, which accept
      UTF-16 filenames, and uses C++11 features to translate the
      UTF8 containing std::string to an UTF16 containing std::wstring.
      
      This feature is a compile time options, that can be enabled by setting `WITH_WINDOWS_UTF8_FILENAMES` to true.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4469
      
      Differential Revision: D10356011
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 27b6ae9171f209085894cdf80069e8a896642044
      5d809ece
  11. 15 9月, 2018 1 次提交
  12. 06 9月, 2018 1 次提交
  13. 24 8月, 2018 1 次提交
  14. 10 8月, 2018 1 次提交
    • D
      Implement Env::NumFileLinks (#4221) · ab22cf34
      Dmitri Smirnov 提交于
      Summary:
      Although delete scheduler implementation allows for the interface not to be supported, the delete_scheduler_test does not allow for that.
      Address compiler warnings
      Make sst_dump_test use test directory structure as the current execution directory may not be writiable.
      Pull Request resolved: https://github.com/facebook/rocksdb/pull/4221
      
      Differential Revision: D9210152
      
      Pulled By: siying
      
      fbshipit-source-id: 381a74511e969ecb8089d5c4b4df87dc30c8df63
      ab22cf34
  15. 13 6月, 2018 1 次提交
    • 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
  16. 25 5月, 2018 1 次提交
    • D
      Catchup with posix features · 3db8504c
      Dmitri Smirnov 提交于
      Summary:
      Catch up with Posix features
        NewWritableRWFile must fail when file does not exists
        Implement Env::Truncate()
        Adjust Env options optimization functions
        Implement MemoryMappedBuffer on Windows.
      Closes https://github.com/facebook/rocksdb/pull/3857
      
      Differential Revision: D8053610
      
      Pulled By: ajkr
      
      fbshipit-source-id: ccd0d46c29648a9f6f496873bc1c9d6c5547487e
      3db8504c
  17. 04 5月, 2018 1 次提交
    • D
      Better destroydb · 934f96de
      Dmitri Smirnov 提交于
      Summary:
      Delete archive directory before WAL folder
        since archive may be contained as a subfolder.
        Also improve loop readability.
      Closes https://github.com/facebook/rocksdb/pull/3797
      
      Differential Revision: D7866378
      
      Pulled By: riversand963
      
      fbshipit-source-id: 0c45d97677ce6fbefa3f8d602ef5e2a2a925e6f5
      934f96de
  18. 07 3月, 2018 1 次提交
    • D
      Windows cumulative patch · c364eb42
      Dmitri Smirnov 提交于
      Summary:
      This patch addressed several issues.
        Portability including db_test std::thread -> port::Thread Cc: @
        and %z to ROCKSDB portable macro. Cc: maysamyabandeh
      
        Implement Env::AreFilesSame
      
        Make the implementation of file unique number more robust
      
        Get rid of C-runtime and go directly to Windows API when dealing
        with file primitives.
      
        Implement GetSectorSize() and aling unbuffered read on the value if
        available.
      
        Adjust Windows Logger for the new interface, implement CloseImpl() Cc: anand1976
      
        Fix test running script issue where $status var was of incorrect scope
        so the failures were swallowed and not reported.
      
        DestroyDB() creates a logger and opens a LOG file in the directory
        being cleaned up. This holds a lock on the folder and the cleanup is
        prevented. This fails one of the checkpoin tests. We observe the same in production.
        We close the log file in this change.
      
       Fix DBTest2.ReadAmpBitmapLiveInCacheAfterDBClose failure where the test
       attempts to open a directory with NewRandomAccessFile which does not
       work on Windows.
        Fix DBTest.SoftLimit as it is dependent on thread timing. CC: yiwu-arbug
      Closes https://github.com/facebook/rocksdb/pull/3552
      
      Differential Revision: D7156304
      
      Pulled By: siying
      
      fbshipit-source-id: 43db0a757f1dfceffeb2b7988043156639173f5b
      c364eb42
  19. 03 2月, 2018 1 次提交
  20. 22 12月, 2017 1 次提交
    • B
      Disable onboard cache for compaction output · b5c99cc9
      burtonli 提交于
      Summary:
      FILE_FLAG_WRITE_THROUGH is for disabling device on-board cache in windows API, which should be disabled if user doesn't need system cache.
      There was a perf issue related with this, we found during memtable flush, the high percentile latency jumps significantly. During profiling, we found those high latency (P99.9) read requests got queue-jumped by write requests from memtable flush and takes 80ms or even more time to wait, even when SSD overall IO throughput is relatively low.
      
      After enabling FILE_FLAG_WRITE_THROUGH, we rerun the test found high percentile latency drops a lot without observable impact on writes.
      
      Scenario 1: 40MB/s + 40MB/s  R/W compaction throughput
      
       Original | FILE_FLAG_WRITE_THROUGH | Percentage reduction
      ---------------------------------------------------------------
      P99.9 | 56.897 ms | 35.593 ms | -37.4%
      P99 | 3.905 ms | 3.896 ms | -2.8%
      
      Scenario 2:  14MB/s + 14MB/s R/W compaction throughput, cohosted with 100+ other rocksdb instances have manually triggered memtable flush operations (memtable is tiny), creating a lot of randomized the small file writes operations during test.
      
      Original | FILE_FLAG_WRITE_THROUGH | Percentage reduction
      ---------------------------------------------------------------
      P99.9 | 86.227   ms | 50.436 ms | -41.5%
      P99 | 8.415   ms | 3.356 ms | -60.1%
      Closes https://github.com/facebook/rocksdb/pull/3225
      
      Differential Revision: D6624174
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 321b86aee9d74470840c70e5d0d4fa9880660a91
      b5c99cc9
  21. 01 11月, 2017 1 次提交
  22. 24 10月, 2017 1 次提交
  23. 09 8月, 2017 1 次提交
  24. 16 7月, 2017 1 次提交
  25. 21 6月, 2017 1 次提交
  26. 13 6月, 2017 1 次提交
  27. 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
  28. 18 5月, 2017 1 次提交
  29. 06 5月, 2017 1 次提交
    • T
      travis: add Windows cross-compilation · fdaefa03
      Tamir Duberstein 提交于
      Summary:
      - downcase includes for case-sensitive filesystems
      - give targets the same name (librocksdb) on all platforms
      
      With this patch it is possible to cross-compile RocksDB for Windows
      from a Linux host using mingw.
      
      cc yuslepukhin orgads
      Closes https://github.com/facebook/rocksdb/pull/2107
      
      Differential Revision: D4849784
      
      Pulled By: siying
      
      fbshipit-source-id: ad26ed6b4d393851aa6551e6aa4201faba82ef60
      fdaefa03
  30. 28 4月, 2017 1 次提交
  31. 06 4月, 2017 1 次提交
  32. 31 3月, 2017 1 次提交
  33. 07 2月, 2017 1 次提交
    • D
      Windows thread · 0a4cdde5
      Dmitri Smirnov 提交于
      Summary:
      introduce new methods into a public threadpool interface,
      - allow submission of std::functions as they allow greater flexibility.
      - add Joining methods to the implementation to join scheduled and submitted jobs with
        an option to cancel jobs that did not start executing.
      - Remove ugly `#ifdefs` between pthread and std implementation, make it uniform.
      - introduce pimpl for a drop in replacement of the implementation
      - Introduce rocksdb::port::Thread typedef which is a replacement for std::thread.  On Posix Thread defaults as before std::thread.
      - Implement WindowsThread that allocates memory in a more controllable manner than windows std::thread with a replaceable implementation.
      - should be no functionality changes.
      Closes https://github.com/facebook/rocksdb/pull/1823
      
      Differential Revision: D4492902
      
      Pulled By: siying
      
      fbshipit-source-id: c74cb11
      0a4cdde5
  34. 16 1月, 2017 1 次提交
  35. 10 1月, 2017 1 次提交
    • D
      Fix Windows environment issues · 3c233ca4
      Dmitri Smirnov 提交于
      Summary:
      Enable directIO on WritableFileImpl::Append
           with offset being current length of the file.
           Enable UniqueID tests on Windows, disable others but
           leeting them to compile. Unique tests are valuable to
           detect failures on different filesystems and upcoming
           ReFS.
           Clear output in WinEnv Getchildren.This is different from
           previous strategy, do not touch output on failure.
           Make sure DBTest.OpenWhenOpen works with windows error message
      Closes https://github.com/facebook/rocksdb/pull/1746
      
      Differential Revision: D4385681
      
      Pulled By: IslamAbdelRahman
      
      fbshipit-source-id: c07b702
      3c233ca4
  36. 23 12月, 2016 1 次提交
    • A
      direct io write support · 972f96b3
      Aaron Gao 提交于
      Summary:
      rocksdb direct io support
      
      ```
      [gzh@dev11575.prn2 ~/rocksdb] ./db_bench -benchmarks=fillseq --num=1000000
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      RocksDB:    version 5.0
      Date:       Wed Nov 23 13:17:43 2016
      CPU:        40 * Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz
      CPUCache:   25600 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      Prefix:    0 bytes
      Keys per prefix:    0
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Write rate: 0 bytes/second
      Compression: Snappy
      Memtablerep: skip_list
      Perf Level: 1
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Initializing RocksDB Options from the specified file
      Initializing RocksDB Options from command-line flags
      DB path: [/tmp/rocksdbtest-112628/dbbench]
      fillseq      :       4.393 micros/op 227639 ops/sec;   25.2 MB/s
      
      [gzh@dev11575.prn2 ~/roc
      Closes https://github.com/facebook/rocksdb/pull/1564
      
      Differential Revision: D4241093
      
      Pulled By: lightmark
      
      fbshipit-source-id: 98c29e3
      972f96b3
  37. 13 12月, 2016 1 次提交
    • A
      Return finer-granularity status from Env::GetChildren* · f0c509e2
      Andrew Kryczka 提交于
      Summary:
      It'd be nice to use the error status type to distinguish
      between user error and system error. For example, GetChildren can fail
      listing a backup directory's contents either because a bad path was provided
      (user error) or because an operation failed, e.g., a remote storage service
      call failed (system error). In the former case, we want to continue and treat
      the backup directory as empty; in the latter case, we want to immediately
      propagate the error to the caller.
      
      This diff uses NotFound to indicate user error and IOError to indicate
      system error. Previously IOError indicated both.
      Closes https://github.com/facebook/rocksdb/pull/1644
      
      Differential Revision: D4312157
      
      Pulled By: ajkr
      
      fbshipit-source-id: 51b4f24
      f0c509e2
  38. 14 10月, 2016 1 次提交
  39. 20 5月, 2016 1 次提交
    • D
      Split WinEnv into separate classes. (#1128) · 26adaad4
      Dmitri Smirnov 提交于
      For ease of reuse and customization as a library
        without wrapping.
        WinEnvThreads is a class for replacement.
        WintEnvIO is a class for reuse and behavior override.
        Added private virtual functions for custom override
        of fallocate pread for io classes.
      26adaad4
  40. 17 5月, 2016 1 次提交