1. 13 12月, 2017 2 次提交
  2. 12 12月, 2017 8 次提交
    • S
      Fix memory issue introduced by 2f1a3a4d · a9c8d4ef
      Siying Dong 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3256
      
      Differential Revision: D6541714
      
      Pulled By: siying
      
      fbshipit-source-id: 40efd89b68587a9d58cfe6f4eebd771c2d9f1542
      a9c8d4ef
    • Z
      exclude DynamicUniversalCompactionOptions from ROCKSDB_LITE · bb5ed4b1
      Zhongyi Xie 提交于
      Summary:
      since [SetOptions](https://github.com/facebook/rocksdb/blob/master/db/db_impl.cc#L494) is not supported in ROCKSDB_LITE
      Right now unit test under lite is broken
      Closes https://github.com/facebook/rocksdb/pull/3253
      
      Differential Revision: D6539428
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 13172b8ecbd75682330726498ea198969bc3e637
      bb5ed4b1
    • S
      Switch version to 5.10 · 0d5692e0
      Siying Dong 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3252
      
      Differential Revision: D6539373
      
      Pulled By: siying
      
      fbshipit-source-id: ce7c3d3fe625852179055295da9cf7bc80755025
      0d5692e0
    • S
      Refactor ReadBlockContents() · 2f1a3a4d
      Siying Dong 提交于
      Summary:
      Divide ReadBlockContents() to multiple sub-functions. Maintaining the input and intermediate data in a new class BlockFetcher.
      I hope in general it makes the code easier to maintain.
      Another motivation to do it is to clearly divide the logic before file reading and after file reading. The refactor will help us evaluate how can we make I/O async in the future.
      Closes https://github.com/facebook/rocksdb/pull/3244
      
      Differential Revision: D6520983
      
      Pulled By: siying
      
      fbshipit-source-id: 338d90bc0338472d46be7a7682028dc9114b12e9
      2f1a3a4d
    • Y
      Fix drop column family data race · 9a27ac5d
      Yi Wu 提交于
      Summary:
      A data race is caught by tsan_crash test between compaction and DropColumnFamily:
      https://gist.github.com/yiwu-arbug/5a2b4baae05eeb99ae1719b650f30a44 Compaction checks if the column family has been dropped on each key input, while user can issue DropColumnFamily which updates cfd->dropped_, causing the data race. Fixing it by making cfd->dropped_ an atomic.
      Closes https://github.com/facebook/rocksdb/pull/3250
      
      Differential Revision: D6535991
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 5571df020beae7fa7db6fff5ad0d598f49962895
      9a27ac5d
    • Z
      Make Universal compaction options dynamic · fcc8a657
      Zhongyi Xie 提交于
      Summary:
      Let me know if more test coverage is needed
      Closes https://github.com/facebook/rocksdb/pull/3213
      
      Differential Revision: D6457165
      
      Pulled By: miasantreble
      
      fbshipit-source-id: 3f944abff28aa7775237f1c4f61c64ccbad4eea9
      fcc8a657
    • Y
      BlobDB: refactor DB open logic · 250a51a3
      Yi Wu 提交于
      Summary:
      Refactor BlobDB open logic. List of changes:
      
      Major:
      * On reopen, mark blob files found as immutable, do not use them for writing new keys.
      * Not to scan the whole file to find file footer. Instead just seek to the end of the file and try to read footer.
      
      Minor:
      * Move most of the real logic from blob_db.cc to blob_db_impl.cc.
      * Not to hold shared_ptr of event listeners in global maps in blob_db.cc
      * Some changes to BlobFile interface.
      * Improve logging and error handling.
      Closes https://github.com/facebook/rocksdb/pull/3246
      
      Differential Revision: D6526147
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 9dc4cdd63359a2f9b696af817086949da8d06952
      250a51a3
    • P
      Fix coverity issues compaction_job, compaction_picker · 6a183d1a
      Prashant D 提交于
      Summary:
      db/compaction_job.cc:
        ReportStartedCompaction(compaction);
      
      CID 1419863 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      2. uninit_member: Non-static class member bottommost_level_ is not initialized in this constructor nor in any functions that it calls.
      
      db/compaction_picker_universal.cc:
      7struct InputFileInfo {
         	2. uninit_member: Non-static class member level is not initialized in this constructor nor in any functions that it calls.
      
      CID 1405355 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      4. uninit_member: Non-static class member index is not initialized in this constructor nor in any functions that it calls.
       38  InputFileInfo() : f(nullptr) {}
      
      db/dbformat.h:
       ParsedInternalKey()
       84      : sequence(kMaxSequenceNumber)  // Make code analyzer happy
      
      CID 1168095 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      2. uninit_member: Non-static class member type is not initialized in this constructor nor in any functions that it calls.
       85  {}  // Intentionally left uninitialized (for speed)
      Closes https://github.com/facebook/rocksdb/pull/3091
      
      Differential Revision: D6534558
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 5ada975956196d267b3f149386842af71eda7553
      6a183d1a
  3. 08 12月, 2017 5 次提交
    • A
      revert fbcode build behavior · e3814a86
      Andrew Kryczka 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3242
      
      Differential Revision: D6514255
      
      Pulled By: ajkr
      
      fbshipit-source-id: c39fa8e745866b052649d02bf339e794d77e96a3
      e3814a86
    • D
      Fix a race condition in WindowsThread (port::Thread) · fe608e32
      Dmitri Smirnov 提交于
      Summary:
      Fix a race condition when we create a thread and immediately destroy
       This case should be supported.
        What happens is that the thread function needs the Data instance
        to actually run but has no shared ownership and must rely on the
        WindowsThread instance to continue existing.
        To address this we change unique_ptr to shared_ptr and then
        acquire an additional refcount for the threadproc which destroys it
        just before the thread exit.
        We choose to allocate shared_ptr instance on the heap as this allows
        the original thread to continue w/o waiting for the new thread to start
        running.
      Closes https://github.com/facebook/rocksdb/pull/3240
      
      Differential Revision: D6511324
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 4633ff7996daf4d287a9fe34f60c1dd28cf4ff36
      fe608e32
    • P
      Fix coverity issues version, write_batch · 34aa245d
      Prashant D 提交于
      Summary:
      db/version_builder.cc:
      117        base_vstorage_->InternalComparator();
      
      CID 1351713 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      2. uninit_member: Non-static class member field level_zero_cmp_.internal_comparator is not initialized in this constructor nor in any functions that it calls.
      
      db/version_edit.h:
      145  FdWithKeyRange()
      146      : fd(),
      147        smallest_key(),
      148        largest_key() {
      
      CID 1418254 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      2. uninit_member: Non-static class member file_metadata is not initialized in this constructor nor in any functions that it calls.
      149  }
      
      db/version_set.cc:
      120    }
      
      CID 1322789 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      4. uninit_member: Non-static class member curr_file_level_ is not initialized in this constructor nor in any functions that it calls.
      121  }
      
      db/write_batch.cc:
       939    assert(cf_mems_);
      
      CID 1419862 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      3. uninit_member: Non-static class member rebuilding_trx_seq_ is not initialized in this constructor nor in any functions that it calls.
       940  }
      Closes https://github.com/facebook/rocksdb/pull/3092
      
      Differential Revision: D6505666
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: fd2c68948a0280772691a419d72ac7e190951d86
      34aa245d
    • P
      table: Fix coverity issues · baff91c1
      Prashant D 提交于
      Summary:
      table/block.cc:
      420  }
      
      CID 1396127 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      7. uninit_member: Non-static class member restart_offset_ is not initialized in this constructor nor in any functions that it calls.
      421}
      
      table/block_based_table_builder.cc:
      
      CID 1418259 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      7. uninit_member: Non-static class member compressed_cache_key_prefix_size is not initialized in this constructor nor in any functions that it calls.
      
      table/block_based_table_reader.h:
         	3. uninit_member: Non-static class member index_type is not initialized in this constructor nor in any functions that it calls.
      
      CID 1396147 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      5. uninit_member: Non-static class member hash_index_allow_collision is not initialized in this constructor nor in any functions that it calls.
      413        global_seqno(kDisableGlobalSequenceNumber) {}
      414
      
      table/cuckoo_table_reader.cc:
       55  if (hash_funs == user_props.end()) {
       56    status_ = Status::Corruption("Number of hash functions not found");
         	5. uninit_member: Non-static class member is_last_level_ is not initialized in this constructor nor in any functions that it calls.
         	7. uninit_member: Non-static class member identity_as_first_hash_ is not initialized in this constructor nor in any functions that it calls.
         	9. uninit_member: Non-static class member use_module_hash_ is not initialized in this constructor nor in any functions that it calls.
         	11. uninit_member: Non-static class member num_hash_func_ is not initialized in this constructor nor in any functions that it calls.
         	13. uninit_member: Non-static class member key_length_ is not initialized in this constructor nor in any functions that it calls.
         	15. uninit_member: Non-static class member user_key_length_ is not initialized in this constructor nor in any functions that it calls.
         	17. uninit_member: Non-static class member value_length_ is not initialized in this constructor nor in any functions that it calls.
         	19. uninit_member: Non-static class member bucket_length_ is not initialized in this constructor nor in any functions that it calls.
         	21. uninit_member: Non-static class member cuckoo_block_size_ is not initialized in this constructor nor in any functions that it calls.
         	23. uninit_member: Non-static class member cuckoo_block_bytes_minus_one_ is not initialized in this constructor nor in any functions that it calls.
      
      CID 1322785 (#2 of 2): Uninitialized scalar field (UNINIT_CTOR)
      25. uninit_member: Non-static class member table_size_ is not initialized in this constructor nor in any functions that it calls.
       57    return;
      
      table/plain_table_index.h:
         	2. uninit_member: Non-static class member index_size_ is not initialized in this constructor nor in any functions that it calls.
      
      CID 1322801 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      4. uninit_member: Non-static class member sub_index_size_ is not initialized in this constructor nor in any functions that it calls.
      128        huge_page_tlb_size_(huge_page_tlb_size) {}
      129
      Closes https://github.com/facebook/rocksdb/pull/3113
      
      Differential Revision: D6505719
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: 38f44d8f9dfefb4c2e25d83b8df25a5201c75618
      baff91c1
    • A
      fix ASAN for DeleteFilesInRange test case · 2e3a0098
      Andrew Kryczka 提交于
      Summary:
      error message was
      
      ```
      ==3095==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffd18216c40 at pc 0x0000005edda1 bp 0x7ffd18215550 sp 0x7ffd18214d00
      ...
      Address 0x7ffd18216c40 is located in stack of thread T0 at offset 1952 in frame
           #0 internal_repo_rocksdb/db_compaction_test.cc:1520 rocksdb::DBCompactionTest_DeleteFileRangeFileEndpointsOverlapBug_Test::TestBody()
      ```
      
      It was unsafe to have slices referring to the temporary string objects' buffers, as those strings were destroyed before the slices were used. Fixed it by assigning the strings returned by `Key()` to local variables.
      Closes https://github.com/facebook/rocksdb/pull/3238
      
      Differential Revision: D6507864
      
      Pulled By: ajkr
      
      fbshipit-source-id: dd07de1a0070c6748c1ab4f3d7bd31f9a81889d0
      2e3a0098
  4. 07 12月, 2017 10 次提交
  5. 06 12月, 2017 2 次提交
  6. 04 12月, 2017 1 次提交
  7. 02 12月, 2017 2 次提交
    • A
      gflags in cmake on linux · 57056bb6
      Andrew Kryczka 提交于
      Summary:
      We should use it if available otherwise the tools builds never work. Thanks to #3212, we can set -DGFLAGS=1 and it'll be independent of the namespace with which gflags was compiled.
      Closes https://github.com/facebook/rocksdb/pull/3214
      
      Differential Revision: D6462214
      
      Pulled By: ajkr
      
      fbshipit-source-id: db4e5f1b905322e3119554a9d01b57532c499384
      57056bb6
    • A
      fix gflags namespace · 63f1c0a5
      Andrew Kryczka 提交于
      Summary:
      I started adding gflags support for cmake on linux and got frustrated that I'd need to duplicate the build_detect_platform logic, which determines namespace based on attempting compilation. We can do it differently -- use the GFLAGS_NAMESPACE macro if available, and if not, that indicates it's an old gflags version without configurable namespace so we can simply hardcode "google".
      Closes https://github.com/facebook/rocksdb/pull/3212
      
      Differential Revision: D6456973
      
      Pulled By: ajkr
      
      fbshipit-source-id: 3e6d5bde3ca00d4496a120a7caf4687399f5d656
      63f1c0a5
  8. 01 12月, 2017 4 次提交
    • M
      WritePrepared Txn: PreReleaseCallback · 18dcf7f9
      Maysam Yabandeh 提交于
      Summary:
      Add PreReleaseCallback to be called at the end of WriteImpl but before publishing the sequence number. The callback is used in WritePrepareTxn to i) update the commit map, ii) update the last published sequence number in the 2nd write queue. It also ensures that all the commits will go to the 2nd queue.
      These changes will ensure that the commit map is updated before the sequence number is published and used by reading snapshots. If we use two write queues, the snapshots will use the seq number published by the 2nd queue. If we use one write queue (the default, the snapshots will use the last seq number in the memtable, which also indicates the last published seq number.
      Closes https://github.com/facebook/rocksdb/pull/3205
      
      Differential Revision: D6438959
      
      Pulled By: maysamyabandeh
      
      fbshipit-source-id: f8b6c434e94bc5f5ab9cb696879d4c23e2577ab9
      18dcf7f9
    • N
      add missing config checks to CMakeLists.txt · 3e40a5e8
      Nikhil Benesch 提交于
      Summary:
      Bring CMakeLists.txt back up to parity with build_detect_platform.
      Closes https://github.com/facebook/rocksdb/pull/3211
      
      Differential Revision: D6452908
      
      Pulled By: ajkr
      
      fbshipit-source-id: 93f5f336ad7eff6ecf65dec47bfaf114dd24cfb2
      3e40a5e8
    • A
      Remove `import` use from TARGETS · fad14050
      Andres Suarez 提交于
      Summary:
      We're moving away from `import`. The equivalent internal construct that
      gets the directory from `fbcode/` is `package_name()`. This is a
      Skylark friendly wrapper around [`get_base_path`].
      
      The additional whitespace change is from running `python ./buckifier/buckify_rocksdb.py`.
      
      [`get_base_path`]: https://buckbuild.com/function/get_base_path.html
      Closes https://github.com/facebook/rocksdb/pull/3210
      
      Reviewed By: yiwu-arbug
      
      Differential Revision: D6451242
      
      Pulled By: zertosh
      
      fbshipit-source-id: 445757261de0ec89d5d332c1ba9af097086326dc
      fad14050
    • Y
      TARGETS file not include tests in opt mode · 54095d33
      Yi Wu 提交于
      Summary:
      Do not build the tests in opt mode, since SyncPoint and other test code will not be included.
      Closes https://github.com/facebook/rocksdb/pull/3204
      
      Differential Revision: D6431154
      
      Pulled By: yiwu-arbug
      
      fbshipit-source-id: c404ef042c1a6f679e5c1dc57600b3d8cb52fc28
      54095d33
  9. 30 11月, 2017 1 次提交
  10. 29 11月, 2017 5 次提交
    • A
      improve ldb CLI option support · ed3af9ef
      Andrew Kryczka 提交于
      Summary:
      - Made CLI arguments take precedence over options file when both are provided. Note some of the CLI args are not settable via options file, like `--compression_max_dict_bytes`, so it's necessary to allow both ways of providing options simultaneously.
      - Changed `PrepareOptionsForOpenDB` to update the proper `ColumnFamilyOptions` if one exists for the user's `--column_family_name` argument. I supported this only in the base class, `LDBCommand`, so it works for the general arguments. Will defer adding support for subcommand-specific arguments.
      - Made the command fail if `--try_load_options` is provided and loading options file returns NotFound. I found the previous behavior of silently continuing confusing.
      Closes https://github.com/facebook/rocksdb/pull/3144
      
      Differential Revision: D6270544
      
      Pulled By: ajkr
      
      fbshipit-source-id: 7c2eac9f9b38720523d74466fb9e78db53561367
      ed3af9ef
    • A
      convert null terminator in ascii dump · c85f8ccc
      Andrew Kryczka 提交于
      Summary:
      The ASCII output is almost always useless to me as the first '\0' byte in the key or value causes it to stop printing. Since all characters are already surrounded by spaces, "\ 0" (how we display a backslash followed by a zero) and "\0" (how this PR displays a null terminator) are distinguishable. My assumption is the value of seeing all the bytes outweighs the value of the alignment we had before, where we always had one character followed by one space.
      Closes https://github.com/facebook/rocksdb/pull/3203
      
      Differential Revision: D6428651
      
      Pulled By: ajkr
      
      fbshipit-source-id: aafc978a51e9ea029cfe3e763e2bb0e1751b9ccf
      c85f8ccc
    • P
      tools: Fix coverity issues · c1ed005a
      Prashant D 提交于
      Summary:
      tools/ldb_cmd.cc:
      ```
      310  ignore_unknown_options_ = IsFlagPresent(flags, ARG_IGNORE_UNKNOWN_OPTIONS);
      
      CID 1322798 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      5. uninit_member: Non-static class member db_ttl_ is not initialized in this constructor nor in any functions that it calls.
      311}
      ```
      Closes https://github.com/facebook/rocksdb/pull/3122
      
      Differential Revision: D6428576
      
      Pulled By: sagar0
      
      fbshipit-source-id: d77f04dd201f7f1d9f59ef88a215ee7ad7b934e9
      c1ed005a
    • P
      utilities/backupable : Fix coverity issues · 81cf262f
      Prashant D 提交于
      Summary:
      1. Class BackupMeta
      ```
      52      : timestamp_(0), size_(0), meta_filename_(meta_filename),
      
      CID 1168103 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      2. uninit_member: Non-static class member sequence_number_ is not initialized in this constructor nor in any functions that it calls.
      153        file_infos_(file_infos), env_(env) {}
      ```
      2. class BackupEngineImpl
      ```
      513  }
              7. uninit_member: Non-static class member latest_backup_id_ is not initialized in this constructor nor in any functions that it calls.
      
      CID 1322803 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      9. uninit_member: Non-static class member latest_valid_backup_id_ is not initialized in this constructor nor in any functions that it calls.
      514}
      ```
      3. struct BackupAfterCopyOrCreateWorkItem
      ```
      368  struct BackupAfterCopyOrCreateWorkItem {
      369    std::future<CopyOrCreateResult> result;
              1. member_decl: Class member declaration for shared.
      370    bool shared;
              3. member_decl: Class member declaration for needed_to_copy.
      371    bool needed_to_copy;
              5. member_decl: Class member declaration for backup_env.
      372    Env* backup_env;
      373    std::string dst_path_tmp;
      374    std::string dst_path;
      375    std::string dst_relative;
              2. uninit_member: Non-static class member shared is not initialized in this constructor nor in any functions that it calls.
              4. uninit_member: Non-static class member needed_to_copy is not initialized in this constructor nor in any functions that it calls.
      
      CID 1396122 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      6. uninit_member: Non-static class member backup_env is not initialized in this constructor nor in any functions that it calls.
      376    BackupAfterCopyOrCreateWorkItem() {}
      ```
      4. struct CopyOrCreateWorkItem
      ```
      318  struct CopyOrCreateWorkItem {
      319    std::string src_path;
      320    std::string dst_path;
      321    std::string contents;
              1. member_decl: Class member declaration for src_env.
      322    Env* src_env;
              3. member_decl: Class member declaration for dst_env.
      323    Env* dst_env;
              5. member_decl: Class member declaration for sync.
      324    bool sync;
              7. member_decl: Class member declaration for rate_limiter.
      325    RateLimiter* rate_limiter;
              9. member_decl: Class member declaration for size_limit.
      326    uint64_t size_limit;
      327    std::promise<CopyOrCreateResult> result;
      328    std::function<void()> progress_callback;
      329
              2. uninit_member: Non-static class member src_env is not initialized in this constructor nor in any functions that it calls.
              4. uninit_member: Non-static class member dst_env is not initialized in this constructor nor in any functions that it calls.
              6. uninit_member: Non-static class member sync is not initialized in this constructor nor in any functions that it calls.
              8. uninit_member: Non-static class member rate_limiter is not initialized in this constructor nor in any functions that it calls.
      
      CID 1396123 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
      10. uninit_member: Non-static class member size_limit is not initialized in this constructor nor in any functions that it calls.
      330    CopyOrCreateWorkItem() {}
      ```
      5. struct RestoreAfterCopyOrCreateWorkItem
      ```
      struct RestoreAfterCopyOrCreateWorkItem {
      410    std::future<CopyOrCreateResult> result;
              1. member_decl: Class member declaration for checksum_value.
      411    uint32_t checksum_value;
      
      CID 1396153 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
      2. uninit_member: Non-static class member checksum_value is not initialized in this constructor nor in any functions that it calls.
      412    RestoreAfterCopyOrCreateWorkItem() {}
      ```
      Closes https://github.com/facebook/rocksdb/pull/3131
      
      Differential Revision: D6428556
      
      Pulled By: sagar0
      
      fbshipit-source-id: a86675444543eff028e3cae6942197a143a112c4
      81cf262f
    • K
      C API: Add some block based table options · 75d57a5d
      kapitan-k 提交于
      Summary: Closes https://github.com/facebook/rocksdb/pull/3159
      
      Differential Revision: D6428220
      
      Pulled By: sagar0
      
      fbshipit-source-id: 60508d09b5281f54b907a1c40e9631fc08343131
      75d57a5d