1. 25 5月, 2017 1 次提交
  2. 24 5月, 2017 9 次提交
    • S
      Fix build errors in blob_dump_tool with GCC 4.8 · 02594b5f
      Sagar Vemuri 提交于
      Summary:
      Fixing the build errors seen with GCC 4.8.1.
      ```
      Makefile:105: Warning: Compiling in debug mode. Don't use the resulting binary in production
      utilities/blob_db/blob_dump_tool.cc: In member function ‘rocksdb::Status rocksdb::blob_db::BlobDumpTool::DumpBlobLogFooter(uint64_t, uint64_t*)’:
      utilities/blob_db/blob_dump_tool.cc:149:42: error: expected ‘)’ before ‘PRIu64’
         fprintf(stdout, "  Blob count     : %" PRIu64 "\n", footer.GetBlobCount());
                                                ^
      utilities/blob_db/blob_dump_tool.cc:149:76: error: spurious trailing ‘%’ in format [-Werror=format=]
         fprintf(stdout, "  Blob count     : %" PRIu64 "\n", footer.GetBlobCount());
                                                                                  ^
      utilities/blob_db/blob_dump_tool.cc:149:76: error: too many arguments for format [-Werror=format-extra-args]
      utilities/blob_db/blob_dump_tool.cc: In member function ‘rocksdb::Status rocksdb::blob_db::BlobDumpTool::DumpRecord(rocksdb::blob_db::BlobDumpTool::DisplayType, rocksdb::blob_db::BlobDumpTool::DisplayType, uint64_t*)’:
      utilities/blob_db/blob_dump_tool.cc:161:49: error: expected ‘)’ before ‘PRIx64’
         fprintf(stdout, "Read record with offset 0x%" PRIx64 " (%" PRIu64 "):\n",
                                                       ^
      utilities/blob_db/blob_dump_tool.cc:162:27: error: spurious trailing ‘%’ in format [-Werror=format=]
                 *offset, *offset);
                                 ^
      utilities/blob_db/blob_dump_tool.cc:162:27: error: too many arguments for format [-Werror=format-extra-args]
      utilities/blob_db/blob_dump_tool.cc:176:38: error: expected ‘)’ before ‘PRIu64’
         fprintf(stdout, "  blob size  : %" PRIu64 "\n", record.GetBlobSize());
                                            ^
      utilities/blob_db/blob_dump_tool.cc:176:71: error: spurious trailing ‘%’ in format [-Werror=format=]
         fprintf(stdout, "  blob size  : %" PRIu64 "\n", record.GetBlobSize());
                                                                             ^
      utilities/blob_db/blob_dump_tool.cc:176:71: error: too many arguments for format [-Werror=format-extra-args]
      utilities/blob_db/blob_dump_tool.cc:178:38: error: expected ‘)’ before ‘PRIu64’
         fprintf(stdout, "  time       : %" PRIu64 "\n", record.GetTimeVal());
                                            ^
      utilities/blob_db/blob_dump_tool.cc:178:70: error: spurious trailing ‘%’ in format [-Werror=format=]
         fprintf(stdout, "  time       : %" PRIu64 "\n", record.GetTimeVal());
                                                                            ^
      utilities/blob_db/blob_dump_tool.cc:178:70: error: too many arguments for format [-Werror=format-extra-args]
      utilities/blob_db/blob_dump_tool.cc:214:38: error: expected ‘)’ before ‘PRIu64’
         fprintf(stdout, "  sequence   : %" PRIu64 "\n", record.GetSN());
                                            ^
      utilities/blob_db/blob_dump_tool.cc:214:65: error: spurious trailing ‘%’ in format [-Werror=format=]
         fprintf(stdout, "  sequence   : %" PRIu64 "\n", record.GetSN());
      ```
      Closes https://github.com/facebook/rocksdb/pull/2359
      
      Differential Revision: D5117684
      
      Pulled By: sagar0
      
      fbshipit-source-id: 7480346bcd96205fcae890927c5e68cf004e87be
      02594b5f
    • I
      Fix column family seconds_up accounting · 52d9e5f7
      Igor Canadi 提交于
      Summary:
      `cf_stats_snapshot_.seconds_up` appears to be never updated, unlike `db_stats_snapshot_.seconds_up`, which is updated here: https://github.com/facebook/rocksdb/blob/master/db/internal_stats.cc#L883
      
      This leads to wrong information in the log, for example:
      ```
      ** Compaction Stats [default] **
      
      ....
      
      Uptime(secs): 85591.2 total, 85591.2 interval
      ```
      
      Even though DB's interval is correctly logged as 60 seconds:
      ```
      ** DB Stats **
      Uptime(secs): 85591.2 total, 637.8 interval
      ```
      Closes https://github.com/facebook/rocksdb/pull/2338
      
      Differential Revision: D5114131
      
      Pulled By: sagar0
      
      fbshipit-source-id: 85243a38213236ccbb601a7f7aaa8865eaa8083c
      52d9e5f7
    • S
      Fix errors in clang-analyzer builds · 7d8207f1
      Sagar Vemuri 提交于
      Summary:
      Fix build error in db_iter.cc when running clang-analyzer.
      ```
        CC       db/db_iter.o
      db/db_iter.cc:938:21: error: no matching constructor for initialization of 'rocksdb::ParsedInternalKey'
        ParsedInternalKey ikey(Slice(), 0, 0);
                          ^    ~~~~~~~~~~~~~
      ./db/dbformat.h:84:3: note: candidate constructor not viable: no known conversion from 'int' to 'rocksdb::ValueType' for 3rd argument
        ParsedInternalKey(const Slice& u, const SequenceNumber& seq, ValueType t)
        ^
      ./db/dbformat.h:78:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
      struct ParsedInternalKey {
             ^
      ./db/dbformat.h:78:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3 were provided
      ./db/dbformat.h:83:3: note: candidate constructor not viable: requires 0 arguments, but 3 were provided
        ParsedInternalKey() { }  // Intentionally left uninitialized (for speed)
        ^
      1 error generated.
      ```
      Closes https://github.com/facebook/rocksdb/pull/2354
      
      Differential Revision: D5115751
      
      Pulled By: sagar0
      
      fbshipit-source-id: b0e386d4e935e4725b07761c3ca5f7a8cbde3692
      7d8207f1
    • S
      Fix release build on Linux · 85b8569a
      Sagar Vemuri 提交于
      Summary:
      Release builds are failing on Linux with the error:
      ```
      tools/db_stress.cc: In function ‘int main(int, char**)’:
      tools/db_stress.cc:2365:12: error: ‘rocksdb::SyncPoint’ has not been declared
         rocksdb::SyncPoint::GetInstance()->SetCallBack(
                  ^
      tools/db_stress.cc:2370:12: error: ‘rocksdb::SyncPoint’ has not been declared
         rocksdb::SyncPoint::GetInstance()->SetCallBack(
                  ^
      tools/db_stress.cc:2375:12: error: ‘rocksdb::SyncPoint’ has not been declared
         rocksdb::SyncPoint::GetInstance()->EnableProcessing();
                  ^
      make[1]: *** [tools/db_stress.o] Error 1
      make[1]: Leaving directory `/data/sandcastle/boxes/trunk-git-rocksdb-public'
      make: *** [release] Error 2
      ```
      Closes https://github.com/facebook/rocksdb/pull/2355
      
      Differential Revision: D5113552
      
      Pulled By: sagar0
      
      fbshipit-source-id: 351df707277787da5633ba4a40e52edc7c895dc4
      85b8569a
    • G
      Allow SstFileWriter to use the rate limiter · 69ec8356
      Giuseppe Ottaviano 提交于
      Summary:
      The default IO priority of WritableFiles is IO_TOTAL, meaning that
      they will bypass the rate limiter if it's passed in the options.
      
      This change allows to pass an io priority in construction, so that by
      setting IO_LOW or IO_HIGH the rate limit will be honored.
      
      It also fixes a minor bug: SstFileWriter's copy and move constructor
      are not disabled and incorrect, as any copy/move will result in a
      double free. Switching to unique_ptr makes the object correctly
      movable and non-copyable as expected.
      
      Also fix minor style inconsistencies.
      Closes https://github.com/facebook/rocksdb/pull/2335
      
      Differential Revision: D5113260
      
      Pulled By: sagar0
      
      fbshipit-source-id: e084236e7ff0b50a56cbeceaa9fedd5e210bf9f8
      69ec8356
    • 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
    • Y
      Fix rocksdb.estimate-num-keys DB property underflow · 9d0a07ed
      Yi Wu 提交于
      Summary:
      rocksdb.estimate-num-keys is compute from `estimate_num_keys - 2 * estimate_num_deletes`. If  `2 * estimate_num_deletes > estimate_num_keys` it will underflow. Fixing it.
      Closes https://github.com/facebook/rocksdb/pull/2348
      
      Differential Revision: D5109272
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: e1bfb91346a59b7282a282b615002507e9d7c246
      9d0a07ed
    • Y
      Simple blob file dumper · 578fb0b1
      Yi Wu 提交于
      Summary:
      A simple blob file dumper.
      Closes https://github.com/facebook/rocksdb/pull/2242
      
      Differential Revision: D5097553
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: c6e00d949fcd3658f9f68da9352f06339fac418d
      578fb0b1
    • A
      Core-local statistics · ac39d6be
      Andrew Kryczka 提交于
      Summary:
      This diff changes `StatisticsImpl` from a thread-local approach to a core-local one. The goal is to perform faster aggregations, particularly for applications that have many threads. There should be no behavior change.
      Closes https://github.com/facebook/rocksdb/pull/2258
      
      Differential Revision: D5016258
      
      Pulled By: ajkr
      
      fbshipit-source-id: 7d4d165b4a91d8110f0409d113d1be91f22d31a9
      ac39d6be
  3. 23 5月, 2017 4 次提交
  4. 21 5月, 2017 1 次提交
  5. 20 5月, 2017 2 次提交
    • Y
      New WriteImpl to pipeline WAL/memtable write · 07bdcb91
      Yi Wu 提交于
      Summary:
      PipelineWriteImpl is an alternative approach to WriteImpl. In WriteImpl, only one thread is allow to write at the same time. This thread will do both WAL and memtable writes for all write threads in the write group. Pending writers wait in queue until the current writer finishes. In the pipeline write approach, two queue is maintained: one WAL writer queue and one memtable writer queue. All writers (regardless of whether they need to write WAL) will still need to first join the WAL writer queue, and after the house keeping work and WAL writing, they will need to join memtable writer queue if needed. The benefit of this approach is that
      1. Writers without memtable writes (e.g. the prepare phase of two phase commit) can exit write thread once WAL write is finish. They don't need to wait for memtable writes in case of group commit.
      2. Pending writers only need to wait for previous WAL writer finish to be able to join the write thread, instead of wait also for previous memtable writes.
      
      Merging #2056 and #2058 into this PR.
      Closes https://github.com/facebook/rocksdb/pull/2286
      
      Differential Revision: D5054606
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: ee5b11efd19d3e39d6b7210937b11cefdd4d1c8d
      07bdcb91
    • Y
      Suppress clang-analyzer false positive · d746aead
      Yi Wu 提交于
      Summary:
      Fixing two types of clang-analyzer false positives:
      * db is deleted and then reopen, and clang-analyzer thinks we are reusing the pointer after it has been deleted. Adding asserts to hint clang-analyzer the pointer is recreated.
      * ParsedInternalKey is (intentionally) uninitialized. Initialize the struct only when clang-analyzer is running.
      Closes https://github.com/facebook/rocksdb/pull/2334
      
      Differential Revision: D5093801
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: f51355382098eb3da5ab9f64e094c6d03e6bdf7d
      d746aead
  6. 19 5月, 2017 2 次提交
  7. 18 5月, 2017 10 次提交
  8. 17 5月, 2017 7 次提交
  9. 16 5月, 2017 4 次提交
    • fix log err · 4f9e69cc
      赵星宇 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/2206
      
      Differential Revision: D5054222
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: d8742bda1bf3e76d7b68eeb86df4608031b5cbc8
      4f9e69cc
    • N
      cross-platform compatibility improvements · 11c5d474
      Nikhil Benesch 提交于
      Summary:
      We've had a couple CockroachDB users fail to build RocksDB on exotic platforms, so I figured I'd try my hand at solving these issues upstream. The problems stem from a) `USE_SSE=1` being too aggressive about turning on SSE4.2, even on toolchains that don't support SSE4.2 and b) RocksDB attempting to detect support for thread-local storage based on OS, even though it can vary by compiler on the same OS.
      
      See the individual commit messages for details. Regarding SSE support, this PR should change virtually nothing for non-CMake based builds. `make`, `PORTABLE=1 make`, `USE_SSE=1 make`, and `PORTABLE=1 USE_SSE=1 make` function exactly as before, except that SSE support will be automatically disabled when a simple SSE4.2-using test program fails to compile, as it does on OpenBSD. (OpenBSD's ports GCC supports SSE4.2, but its binutils do not, so `__SSE_4_2__` is defined but an SSE4.2-using program will fail to assemble.) A warning is emitted in this case. The CMake build is modified to support the same set of options, except that `USE_SSE` is spelled `FORCE_SSE42` because `USE_SSE` is rather useless now that we can automatically detect SSE support, and I figure changing options in the CMake build is less disruptive than changing the non-CMake build.
      
      I've tested these changes on all the platforms I can get my hands on (macOS, Windows MSVC, Windows MinGW, and OpenBSD) and it all works splendidly. Let me know if there's anything you object to—I obviously don't mean to break any of your build pipelines in the process of fixing ours downstream.
      Closes https://github.com/facebook/rocksdb/pull/2199
      
      Differential Revision: D5054042
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 938e1fc665c049c02ae15698e1409155b8e72171
      11c5d474
    • J
      Put lib files into suitable path in RPM package · d0043330
      Jeff Li 提交于
      Summary:
      Currently, the RPM package will install the lib and header files into `/usr/package/lib` and `/usr/package/include` which is not in the default search paths. It is reasonable to install them under `/usr/lib` and `/usr/include` so that no extra configuration is required.
      Closes https://github.com/facebook/rocksdb/pull/2221
      
      Differential Revision: D5054030
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 1d23de5ff21f07e6738c9dfa04429acd7a839143
      d0043330
    • Y
      Fix build error with blob DB. · 86d54925
      Yi Wu 提交于
      Summary:
      snprintf is in <stdio.h> and not in namespace std.
      Closes https://github.com/facebook/rocksdb/pull/2287
      
      Reviewed By: anirbanr-fb
      
      Differential Revision: D5054752
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 356807ec38f3c7d95951cdb41f31a3d3ae0714d4
      86d54925