1. 15 4月, 2016 3 次提交
  2. 14 4月, 2016 7 次提交
  3. 13 4月, 2016 5 次提交
    • S
      BlockBasedTable::PrefixMayMatch: no need to find data block after full bloom checking · dff4c48e
      sdong 提交于
      Summary:
      Full block checking should be a good enough indication of prefix existance. No need to further check data block.
      This also fixes wrong results when using prefix bloom and reverse bitwise comparator.
      
      Test Plan: Will add a unit test.
      
      Reviewers: yhchiang, IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: hermanlee4, yoshinorim, yiwu, kradhakrishnan, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56625
      dff4c48e
    • K
      Propagate sandcastle run error to UI · 0353b853
      krad 提交于
      Summary:
      Currently the code does not propagate the sandcastle precommit test run
      error status to UI. This can confuse the developer when searching for errors.
      
      With this change, all success should be in green and all errors should be in red
      
      Test Plan: Submit the diff (and hopefully something will fail)
      
      Reviewers: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56595
      0353b853
    • I
      Parallelize travis jobs · b885f33a
      Islam AbdelRahman 提交于
      Summary:
      Update travis.yml to split the work into 3 sub jobs
      - running unittests
      - Building and testing java
      - building ROCKSDB_LITE
      
      Test Plan: https://travis-ci.org/facebook/rocksdb/builds/122433169
      
      Reviewers: sdong, yhchiang, andrewkr, kradhakrishnan
      
      Reviewed By: kradhakrishnan
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56607
      b885f33a
    • H
      Update db_bench_tool.cc (#1073) · 71303e04
      Hyunyoung Lee 提交于
      * Update db_bench_tool.cc
      
      I fixed the wrong letters, LevelDB -> rocksDB, because I thought of LevelDB as the wrong presentation.
      
      the following show my fix :
      
      fprintf(stderr, "LevelDB:    version %d.%d\n",
                  kMajorVersion, kMinorVersion);
      
      ----------------->
      fprintf(stderr, "rocksDB:    version %d.%d\n",
                  kMajorVersion, kMinorVersion);
      
      * Update db_bench_tool.cc
      
      * Update db_bench_tool.cc
      71303e04
    • S
      Fix option settable tests · 63cf15bb
      sdong 提交于
      Summary: In option settable tests, bytes for pointers are not all skipped, so that they may be the same as the special character and cause false positive.
      
      Test Plan: Run the test. Manually verify the issue is not there any more.
      
      Reviewers: IslamAbdelRahman, andrewkr
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: kradhakrishnan, yiwu, yhchiang, leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56553
      63cf15bb
  4. 12 4月, 2016 8 次提交
  5. 09 4月, 2016 5 次提交
    • A
      Add column family info to TableProperties::ToString() · 0e3cc2cf
      Andrew Kryczka 提交于
      Summary: This is used at least by `sst_dump --show_properties`
      
      Test Plan:
      - default CF
      
      ```
        $ ./sst_dump --show_properties --file=./tmp-db/000007.sst | grep 'column family'
        column family ID: 0
        column family name: default
      ```
      
      - custom CF
      
      ```
        $ ./sst_dump --show_properties --file=./tmp-db/000012.sst | grep 'column family'
        column family ID: 1
        column family name: col-fam-1
      ```
      
      - no CF
      
      ```
        $ ./sst_dump --show_properties --file=./tmp-db/000017.sst | grep 'column family'
        column family ID: N/A
        column family name: N/A
      ```
      
      Reviewers: IslamAbdelRahman
      
      Reviewed By: IslamAbdelRahman
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56499
      0e3cc2cf
    • J
      Make sure that if use_mmap_reads is on use_os_buffer is also on · 2448f803
      Jay Edgar 提交于
      Summary: The code assumes that if use_mmap_reads is on then use_os_buffer is also on.  This make sense as by using memory mapped files for reading you are expecting the OS to cache what it needs.  Add code to make sure the user does not turn off use_os_buffer when they turn on use_mmap_reads
      
      Test Plan: New test: DBTest.MMapAndBufferOptions
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56397
      2448f803
    • A
      Fix build errors for windows · 114a1b87
      Andrew Kryczka 提交于
      Summary:
      - Need to use unsigned long long for 64-bit literals on windows
      - Need size_t for backup meta-file length since clang doesn't let us assign size_t to int
      
      Test Plan: backupable_db_test and options_test
      
      Reviewers: IslamAbdelRahman, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56391
      114a1b87
    • I
      Improve sst_dump help message · 05229903
      Islam AbdelRahman 提交于
      Summary:
      Current Message
      
      ```
      sst_dump [--command=check|scan|none|raw] [--verify_checksum] --file=data_dir_OR_sst_file [--output_hex] [--input_key_hex] [--from=<user_key>] [--to=<user_key>] [--read_num=NUM] [--show_properties] [--show_compression_sizes] [--show_compression_sizes [--set_block_size=<block_size>]]
      ```
      New message
      
      ```
      sst_dump --file=<data_dir_OR_sst_file> [--command=check|scan|raw]
          --file=<data_dir_OR_sst_file>
            Path to SST file or directory containing SST files
      
          --command=check|scan|raw
              check: Iterate over entries in files but dont print anything except if an error is encounterd (default command)
              scan: Iterate over entries in files and print them to screen
              raw: Dump all the table contents to <file_name>_dump.txt
      
          --output_hex
            Can be combined with scan command to print the keys and values in Hex
      
          --from=<user_key>
            Key to start reading from when executing check|scan
      
          --to=<user_key>
            Key to stop reading at when executing check|scan
      
          --read_num=<num>
            Maximum number of entries to read when executing check|scan
      
          --verify_checksum
            Verify file checksum when executing check|scan
      
          --input_key_hex
            Can be combined with --from and --to to indicate that these values are encoded in Hex
      
          --show_properties
            Print table properties after iterating over the file
      
          --show_compression_sizes
            Independent command that will recreate the SST file using 16K block size with different
            compressions and report the size of the file using such compression
      
          --set_block_size=<block_size>
            Can be combined with --show_compression_sizes to set the block size that will be used
            when trying different compression algorithms
      ```
      
      Test Plan: none
      
      Reviewers: yhchiang, andrewkr, kradhakrishnan, yiwu, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56325
      05229903
    • S
      Update comments on include/rocksdb/perf_context.h · 0930e5e9
      sdong 提交于
      Summary: Some grammer mistakes in code comments in include/rocksdb/perf_context.h. Also polish it a liitlebit.
      
      Test Plan: Not needed
      
      Reviewers: IslamAbdelRahman, yhchiang, yiwu, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: leveldb, andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56307
      0930e5e9
  6. 08 4月, 2016 3 次提交
  7. 07 4月, 2016 2 次提交
    • A
      Embed column family name in SST file · 2391ef72
      Andrew Kryczka 提交于
      Summary:
      Added the column family name to the properties block. This property
      is omitted only if the property is unavailable, such as when RepairDB()
      writes SST files.
      
      In a next diff, I will change RepairDB to use this new property for
      deciding to which column family an existing SST file belongs. If this
      property is missing, it will add it to the "unknown" column family (same
      as its existing behavior).
      
      Test Plan:
      New unit test:
      
        $ ./db_table_properties_test --gtest_filter=DBTablePropertiesTest.GetColumnFamilyNameProperty
      
      Reviewers: IslamAbdelRahman, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D55605
      2391ef72
    • I
      Don't use version in the error message · ab4c6233
      Igor Canadi 提交于
      Summary: We use object `v` in the error message, which is not initialized if the edit is column family manipulation. This doesn't provide much useful info, so this diff is removing it. Instead, it dumps actual VersionEdit contents.
      
      Test Plan: compiles. would be great to get tests in version_set_test.cc that cover cases where a file write fails
      
      Reviewers: sdong, yhchiang, andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56349
      ab4c6233
  8. 05 4月, 2016 1 次提交
  9. 04 4月, 2016 1 次提交
  10. 02 4月, 2016 5 次提交
    • A
      No need to limit to 20 files in UpdateAccumulatedStats() if options.max_open_files=-1 · cc87075d
      Aaron Gao 提交于
      Summary:
      There is a hardcoded constraint in our statistics collection that prevents reading properties from more than 20 SST files. This means our statistics will be very inaccurate for databases with > 20 files since additional files are just ignored. The purpose of constraining the number of files used is to bound the I/O performed during statistics collection, since these statistics need to be recomputed every time the database reopened.
      
      However, this constraint doesn't take into account the case where option "max_open_files" is -1. In that case, all the file metadata has already been read, so MaybeInitializeFileMetaData() won't incur any I/O cost. so this diff gets rid of the 20-file constraint in case max_open_files == -1.
      
      Test Plan:
      write into unit test db/db_properties_test.cc - "ValidateSampleNumber".
      We generate 20 files with 2 rows and 10 files with 1 row.
      If max_open_files !=-1, the `rocksdb.estimate-num-keys` should be (10*1 + 10*2)/20 * 30 = 45. Otherwise, it should be the ground truth, 50.
      {F1089153}
      
      Reviewers: andrewkr
      
      Reviewed By: andrewkr
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56253
      cc87075d
    • I
      Eliminate std::deque initialization while iterating over merge operands · 8a1a603f
      Islam AbdelRahman 提交于
      Summary:
      This patch is similar to D52563, When we iterate over a DB with merge operands we keep creating std::queue to store the operands, optimize this by reusing merge_operands_ data member
      
      Before the patch
      
      ```
      ./db_bench --benchmarks="mergerandom,readseq,readseq,readseq,readseq" --db="/dev/shm/bench_merge_memcpy_on_the_fly/" --merge_operator="put" --merge_keys=10000 --num=10000
      
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      mergerandom  :       3.757 micros/op 266141 ops/sec;   29.4 MB/s ( updates:10000)
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.413 micros/op 2423538 ops/sec;  268.1 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.451 micros/op 2219071 ops/sec;  245.5 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.420 micros/op 2382039 ops/sec;  263.5 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.408 micros/op 2452017 ops/sec;  271.3 MB/s
      
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      mergerandom  :       3.947 micros/op 253376 ops/sec;   28.0 MB/s ( updates:10000)
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.441 micros/op 2266473 ops/sec;  250.7 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.471 micros/op 2122033 ops/sec;  234.8 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.440 micros/op 2271407 ops/sec;  251.3 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.429 micros/op 2331471 ops/sec;  257.9 MB/s
      ```
      
      with the patch
      
      ```
      ./db_bench --benchmarks="mergerandom,readseq,readseq,readseq,readseq" --db="/dev/shm/bench_merge_memcpy_on_the_fly/" --merge_operator="put" --merge_keys=10000 --num=10000
      
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      mergerandom  :       4.080 micros/op 245092 ops/sec;   27.1 MB/s ( updates:10000)
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.308 micros/op 3241843 ops/sec;  358.6 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.312 micros/op 3200408 ops/sec;  354.0 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.332 micros/op 3013962 ops/sec;  333.4 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.300 micros/op 3328017 ops/sec;  368.2 MB/s
      
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      mergerandom  :       3.973 micros/op 251705 ops/sec;   27.8 MB/s ( updates:10000)
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.320 micros/op 3123752 ops/sec;  345.6 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.335 micros/op 2986641 ops/sec;  330.4 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.339 micros/op 2950047 ops/sec;  326.4 MB/s
      DB path: [/dev/shm/bench_merge_memcpy_on_the_fly/]
      readseq      :       0.319 micros/op 3131565 ops/sec;  346.4 MB/s
      ```
      
      Test Plan: make check -j64
      
      Reviewers: yhchiang, andrewkr, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba
      
      Differential Revision: https://reviews.facebook.net/D56031
      8a1a603f
    • I
      WriteBatchWithIndex micro optimization · f38540b1
      Islam AbdelRahman 提交于
      Summary:
        - Put key offset and key size in WriteBatchIndexEntry
        - Use vector for comparators in WriteBatchEntryComparator
      
      I use a slightly modified version of @yoshinorim code to benchmark
      https://gist.github.com/IslamAbdelRahman/b120f4fba8d6ff7d58d2
      
      For Put I create a transaction that put a 1000000 keys and measure the time spent without commit.
      For GetForUpdate I read the keys that I added in the Put transaction.
      
      Original time:
      
      ```
       rm -rf /dev/shm/rocksdb-example/
       ./txn_bench put 1000000
       1000000 OK Ops | took      3.679 seconds
       ./txn_bench get_for_update 1000000
       1000000 OK Ops | took      3.940 seconds
      ```
      
      New Time
      
      ```
        rm -rf /dev/shm/rocksdb-example/
       ./txn_bench put 1000000
       1000000 OK Ops | took      2.727 seconds
       ./txn_bench get_for_update 1000000
       1000000 OK Ops | took      3.880 seconds
      ```
      
      It looks like there is no significant improvement in GetForUpdate() but we can see ~30% improvement in Put()
      
      Test Plan: unittests
      
      Reviewers: yhchiang, anthony, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, yoshinorim
      
      Differential Revision: https://reviews.facebook.net/D55539
      f38540b1
    • A
      Merge pull request #1053 from adamretter/benchmark-java-comparator · 20065406
      Adam Retter 提交于
      Benchmark Java comparator vs C++ comparator
      20065406
    • A
      Stderr info logger · f2c43a4a
      Andrew Kryczka 提交于
      Summary:
      Adapted a stderr logger from the option tests. Moved it to a separate
      header so we can reuse it, e.g., from ldb subcommands for faster debugging. This
      is especially useful to make errors/warnings more visible when running
      "ldb repair", which involves potential data loss.
      
      Test Plan:
      ran options_test and "ldb repair"
      
        $ ./ldb repair --db=./tmp/
        [WARN] **** Repaired rocksdb ./tmp/; recovered 1 files; 588bytes. Some data may have been lost. ****
        OK
      
      Reviewers: IslamAbdelRahman, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: andrewkr, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D56151
      f2c43a4a