1. 26 2月, 2013 1 次提交
  2. 23 2月, 2013 1 次提交
  3. 22 2月, 2013 3 次提交
    • A
      Counters for bytes written and read. · ec77366e
      Abhishek Kona 提交于
      Summary:
      * Counters for bytes read and write.
      as a part of this diff, I want to=>
      * Measure compaction times. @dhruba can you point which function, should
      * I time to get Compaction-times. Was looking at CompactRange.
      
      Test Plan: db_test
      
      Reviewers: dhruba, emayanke
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8763
      ec77366e
    • V
      [Missed adding cmdline parsing for new flags added in D8685] · 6abb30d4
      Vamsi Ponnekanti 提交于
      Summary:
      I had added FLAGS_numdistinct and FLAGS_deletepercent for randomwithverify
      but forgot to add cmdline parsing for those flags.
      
      Test Plan:
      [nponnekanti@dev902 /data/users/nponnekanti/rocksdb] ./db_bench --benchmarks=randomwithverify --numdistinct=500
      LevelDB:    version 1.5
      Date:       Thu Feb 21 10:34:40 2013
      CPU:        24 * Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
      CPUCache:   12288 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Compression: snappy
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Created bg thread 0x7fbf90bff700
      randomwithverify :       4.693 micros/op 213098 ops/sec; ( get:900000 put:80000 del:20000 total:1000000 found:714556)
      
      [nponnekanti@dev902 /data/users/nponnekanti/rocksdb] ./db_bench --benchmarks=randomwithverify --deletepercent=5
      LevelDB:    version 1.5
      Date:       Thu Feb 21 10:35:03 2013
      CPU:        24 * Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
      CPUCache:   12288 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Compression: snappy
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Created bg thread 0x7fe14dfff700
      randomwithverify :       4.883 micros/op 204798 ops/sec; ( get:900000 put:50000 del:50000 total:1000000 found:443847)
      [nponnekanti@dev902 /data/users/nponnekanti/rocksdb]
      [nponnekanti@dev902 /data/users/nponnekanti/rocksdb] ./db_bench --benchmarks=randomwithverify --deletepercent=5 --numdistinct=500
      LevelDB:    version 1.5
      Date:       Thu Feb 21 10:36:18 2013
      CPU:        24 * Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
      CPUCache:   12288 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Compression: snappy
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Created bg thread 0x7fc31c7ff700
      randomwithverify :       4.920 micros/op 203233 ops/sec; ( get:900000 put:50000 del:50000 total:1000000 found:445522)
      
      Revert Plan: OK
      
      Task ID: #
      
      Reviewers: dhruba, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8769
      6abb30d4
    • V
      [Add randomwithverify benchmark option] · 945d2b59
      Vamsi Ponnekanti 提交于
      Summary: Added RandomWithVerify benchmark option.
      
      Test Plan:
      This whole diff is to test.
      [nponnekanti@dev902 /data/users/nponnekanti/rocksdb] ./db_bench --benchmarks=randomwithverify
      LevelDB:    version 1.5
      Date:       Tue Feb 19 17:50:28 2013
      CPU:        24 * Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
      CPUCache:   12288 KB
      Keys:       16 bytes each
      Values:     100 bytes each (50 bytes after compression)
      Entries:    1000000
      RawSize:    110.6 MB (estimated)
      FileSize:   62.9 MB (estimated)
      Compression: snappy
      WARNING: Assertions are enabled; benchmarks unnecessarily slow
      ------------------------------------------------
      Created bg thread 0x7fa9c3fff700
      randomwithverify :       5.004 micros/op 199836 ops/sec; ( get:900000 put:80000 del:20000 total:1000000 found:711992)
      
      Revert Plan: OK
      
      Task ID: #
      
      Reviewers: dhruba, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8685
      945d2b59
  4. 21 2月, 2013 2 次提交
    • A
      Fix for the weird behaviour encountered by ldb Get where it could read only the second-latest value · b2c50f1c
      amayank 提交于
      Summary:
      Changed the Get and Scan options with openForReadOnly mode to have access to the memtable.
      Changed the visibility of NewInternalIterator in db_impl from private to protected so that
      the derived class db_impl_read_only can call that in its NewIterator function for the
      scan case. The previous approach which changed the default for flush_on_destroy_ from false to true
      caused many problems in the unit tests due to empty sst files that it created. All
      unit tests pass now.
      
      Test Plan: make clean; make all check; ldb put and get and scans
      
      Reviewers: dhruba, heyongqiang, sheki
      
      Reviewed By: dhruba
      
      CC: kosievdmerwe, zshao, dilipj, kailiu
      
      Differential Revision: https://reviews.facebook.net/D8697
      b2c50f1c
    • A
      Introduce histogram in statistics.h · fe10200d
      Abhishek Kona 提交于
      Summary:
      * Introduce is histogram in statistics.h
      * stop watch to measure time.
      * introduce two timers as a poc.
      Replaced NULL with nullptr to fight some lint errors
      Should be useful for google.
      
      Test Plan:
      ran db_bench and check stats.
      make all check
      
      Reviewers: dhruba, heyongqiang
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8637
      fe10200d
  5. 19 2月, 2013 3 次提交
  6. 16 2月, 2013 1 次提交
    • A
      Fix for the weird behaviour encountered by ldb Get where it could read only the second-latest value · 4c696ed0
      amayank 提交于
      Summary:
      flush_on_destroy has a default value of false and the memtable is flushed
      in the dbimpl-destructor only when that is set to true. Because we want the memtable to be flushed everytime that
      the destructor is called(db is closed) and the cases where we work with the memtable only are very less
      it is a good idea to give this a default value of true. Thus the put from ldb
      wil have its data flushed to disk in the destructor and the next Get will be able to
      read it when opened with OpenForReadOnly. The reason that ldb could read the latest value when
      the db was opened in the normal Open mode is that the Get from normal Open first reads
      the memtable and directly finds the latest value written there and the Get from OpenForReadOnly
      doesn't have access to the memtable (which is correct because all its Put/Modify) are disabled
      
      Test Plan: make all; ldb put and get and scans
      
      Reviewers: dhruba, heyongqiang, sheki
      
      Reviewed By: heyongqiang
      
      CC: kosievdmerwe, zshao, dilipj, kailiu
      
      Differential Revision: https://reviews.facebook.net/D8631
      4c696ed0
  7. 05 2月, 2013 1 次提交
    • K
      Allow the logs to be purged by TTL. · b63aafce
      Kai Liu 提交于
      Summary:
      * Add a SplitByTTLLogger to enable this feature. In this diff I implemented generalized AutoSplitLoggerBase class to simplify the
      development of such classes.
      * Refactor the existing AutoSplitLogger and fix several bugs.
      
      Test Plan:
      * Added a unit tests for different types of "auto splitable" loggers individually.
      * Tested the composited logger which allows the log files to be splitted by both TTL and log size.
      
      Reviewers: heyongqiang, dhruba
      
      Reviewed By: heyongqiang
      
      CC: zshao, leveldb
      
      Differential Revision: https://reviews.facebook.net/D8037
      b63aafce
  8. 26 1月, 2013 1 次提交
    • C
      Fix poor error on num_levels mismatch and few other minor improvements · 0b83a831
      Chip Turner 提交于
      Summary:
      Previously, if you opened a db with num_levels set lower than
      the database, you received the unhelpful message "Corruption:
      VersionEdit: new-file entry."  Now you get a more verbose message
      describing the issue.
      
      Also, fix handling of compression_levels (both the run-over-the-end
      issue and the memory management of it).
      
      Lastly, unique_ptr'ify a couple of minor calls.
      
      Test Plan: make check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8151
      0b83a831
  9. 25 1月, 2013 2 次提交
    • C
      Stop continually re-creating build_version.c · 772f75b3
      Chip Turner 提交于
      Summary:
      We continually rebuilt build_version.c because we put the
      current date into it, but that's what __DATE__ already is.  This makes
      builds faster.
      
      This also fixes an issue with 'make clean FOO' not working properly.
      
      Also tweak the build rules to be more consistent, always have warnings,
      and add a 'make release' rule to handle flags for release builds.
      
      Test Plan: make, make clean
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D8139
      772f75b3
    • C
      Use fallocate to prevent excessive allocation of sst files and logs · 3dafdfb2
      Chip Turner 提交于
      Summary:
      On some filesystems, pre-allocation can be a considerable
      amount of space.  xfs in our production environment pre-allocates by
      1GB, for instance.  By using fallocate to inform the kernel of our
      expected file sizes, we eliminate this wasteage (that isn't recovered
      until the file is closed which, in the case of LOG files, can be a
      considerable amount of time).
      
      Test Plan:
      created an xfs loopback filesystem, mounted with
      allocsize=4M, and ran db_stress.  LOG file without this change was 4M,
      and with it it was 128k then grew to normal size.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: adsharma, leveldb
      
      Differential Revision: https://reviews.facebook.net/D7953
      3dafdfb2
  10. 24 1月, 2013 1 次提交
    • C
      Fix a number of object lifetime/ownership issues · 2fdf91a4
      Chip Turner 提交于
      Summary:
      Replace manual memory management with std::unique_ptr in a
      number of places; not exhaustive, but this fixes a few leaks with file
      handles as well as clarifies semantics of the ownership of file handles
      with log classes.
      
      Test Plan: db_stress, make check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: zshao, leveldb, heyongqiang
      
      Differential Revision: https://reviews.facebook.net/D8043
      2fdf91a4
  11. 18 1月, 2013 2 次提交
    • A
      Add counters to count gets and writes · 16903c35
      Abhishek Kona 提交于
      Summary: Add Tickers to count Write's and Get's
      
      Test Plan: make check
      
      Reviewers: dhruba, chip
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7977
      16903c35
    • K
      Fixed issues Valgrind found. · 3c3df740
      Kosie van der Merwe 提交于
      Summary:
      Found issues with `db_test` and `db_stress` when running valgrind.
      
      `DBImpl` had an issue where if an compaction failed then it will use the uninitialised file size of an output file is used. This manifested as the final call to output to the log in `DoCompactionWork()` branching on uninitialized memory (all the way down in printf's innards).
      
      Test Plan:
      Ran `valgrind --track_origins=yes ./db_test` and `valgrind ./db_stress` to see if issues disappeared.
      
      Ran `make check` to see if there were no regressions.
      
      Reviewers: vamsi, dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8001
      3c3df740
  12. 17 1月, 2013 1 次提交
    • A
      rollover manifest file. · 7d5a4383
      Abhishek Kona 提交于
      Summary:
      Check in LogAndApply if the file size is more than the limit set in
      Options.
      Things to consider : will this be expensive?
      
      Test Plan: make all check. Inputs on a new unit test?
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7701
      7d5a4383
  13. 16 1月, 2013 3 次提交
    • C
      Add optional clang compile mode · a2dcd79c
      Chip Turner 提交于
      Summary:
      clang is an alternate compiler based on llvm.  It produces
      nicer error messages and finds some bugs that gcc doesn't, such as the
      size_t change in this file (which caused some write return values to be
      misinterpreted!)
      
      Clang isn't the default; to try it, do "USE_CLANG=1 make" or "export
      USE_CLANG=1" then make as normal
      
      Test Plan: "make check" and "USE_CLANG=1 make check"
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D7899
      a2dcd79c
    • C
      Fix broken build · 9bbcab57
      Chip Turner 提交于
      Summary: Mis-merged from HEAD, had a duplicate declaration.
      
      Test Plan: make -j32 OPT=-g
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D7911
      9bbcab57
    • K
      Fixed bug with seek compactions on Level 0 · 28fe86c4
      Kosie van der Merwe 提交于
      Summary: Due to how the code handled compactions in Level 0 in `PickCompaction()` it could be the case that two compactions on level 0 ran that produced tables in level 1 that overlap. However, this case seems like it would only occur on a seek compaction which is unlikely on level 0. Furthermore, level 0 and level 1 had to have a certain arrangement of files.
      
      Test Plan:
      make check
      
      Reviewers: dhruba, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb, sheki
      
      Differential Revision: https://reviews.facebook.net/D7923
      28fe86c4
  14. 15 1月, 2013 1 次提交
    • C
      Various build cleanups/improvements · c0cb289d
      Chip Turner 提交于
      Summary:
      Specific changes:
      
      1) Turn on -Werror so all warnings are errors
      2) Fix some warnings the above now complains about
      3) Add proper dependency support so changing a .h file forces a .c file
      to rebuild
      4) Automatically use fbcode gcc on any internal machine rather than
      whatever system compiler is laying around
      5) Fix jemalloc to once again be used in the builds (seemed like it
      wasn't being?)
      6) Fix issue where 'git' would fail in build_detect_version because of
      LD_LIBRARY_PATH being set in the third-party build system
      
      Test Plan:
      make, make check, make clean, touch a header file, make sure
      rebuild is expected
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D7887
      c0cb289d
  15. 12 1月, 2013 1 次提交
  16. 11 1月, 2013 1 次提交
  17. 09 1月, 2013 2 次提交
  18. 08 1月, 2013 2 次提交
    • K
      Added clearer error message for failure to create db directory in DBImpl::Recover() · d6e873f2
      Kosie van der Merwe 提交于
      Summary:
      Changed CreateDir() to CreateDirIfMissing() so a directory that already exists now causes and error.
      
      Fixed CreateDirIfMissing() and added Env.DirExists()
      
      Test Plan:
      make check to test for regessions
      
      Ran the following to test if the error message is not about lock files not existing
      ./db_bench --db=dir/testdb
      
      After creating a file "testdb", ran the following to see if it failed with sane error message:
      ./db_bench --db=testdb
      
      Reviewers: dhruba, emayanke, vamsi, sheki
      
      Reviewed By: emayanke
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7707
      d6e873f2
    • M
      Add --seed, --read_range to db_bench · 4069f66c
      Mark Callaghan 提交于
      Summary:
      Adds the option --seed to db_bench to specify the base for the per-thread RNG.
      When not set each thread uses the same value across runs of db_bench which defeats
      IO stress testing.
      
      Adds the option --read_range. When set to a value > 1 an iterator is created and
      each query done for the randomread benchmark will do a range scan for that many
      rows. When not set or set to 1 the existing behavior (a point lookup) is done.
      
      Fixes a bug where a printf format string was missing.
      
      Test Plan: run db_bench
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7749
      4069f66c
  19. 04 1月, 2013 1 次提交
    • K
      Fixing and adding some comments · 8cd86a7b
      Kosie van der Merwe 提交于
      Summary:
      `MemTableList::Add()` neglected to mention that it took ownership of the reference held by its caller.
      
      The comment in `MemTable::Get()` was wrong in describing the format of the key.
      
      Test Plan: None
      
      Reviewers: dhruba, sheki, emayanke, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7755
      8cd86a7b
  20. 03 1月, 2013 1 次提交
  21. 20 12月, 2012 1 次提交
    • D
      Enhance ReadOnly mode to process the all committed transactions. · f4c2b7cf
      Dhruba Borthakur 提交于
      Summary:
      Leveldb has an api OpenForReadOnly() that opens the database
      in readonly mode. This call had an option to not process the
      transaction log.  This patch removes this option and always
      processes all transactions that had been committed. It has
      been done in such a way that it does not create/write to
      any new files in the process. The invariant of "no-writes"
      to the leveldb data directory is still true.
      
      This enhancement allows multiple threads to open the same database
      in readonly mode and access all trancations that were committed right
      upto the OpenForReadOnly call.
      
      I changed the public API to match the new semantics because
      there are no users who are currently using this api.
      
      Test Plan: make clean check
      
      Reviewers: sheki
      
      Reviewed By: sheki
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7479
      f4c2b7cf
  22. 18 12月, 2012 3 次提交
    • D
      Enhancements to rocksdb for better support for replication. · 3d1e92b0
      Dhruba Borthakur 提交于
      Summary:
      1. The OpenForReadOnly() call should not lock the db. This is useful
      so that multiple processes can open the same database concurrently
      for reading.
      2. GetUpdatesSince should not error out if the archive directory
      does not exist.
      3. A new constructor for WriteBatch that can takes a serialized
      string as a parameter of the constructor.
      
      Test Plan: make clean check
      
      Reviewers: sheki
      
      Reviewed By: sheki
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7449
      3d1e92b0
    • K
      Added meta-database support. · 62d48571
      Kosie van der Merwe 提交于
      Summary:
      Added kMetaDatabase for meta-databases in db/filename.h along with supporting
      fuctions.
      Fixed switch in DBImpl so that it also handles kMetaDatabase.
      Fixed DestroyDB() that it can handle destroying meta-databases.
      
      Test Plan: make check
      
      Reviewers: sheki, emayanke, vamsi, dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D7245
      62d48571
    • A
      Fix a bug. Where DestroyDB deletes a non-existant archive directory. · 2f0585fb
      Abhishek Kona 提交于
      Summary:
      C tests would fail sometimes as DestroyDB would return a Failure Status
      message when deleting an archival directory which was not created
      (WAL_ttl_seconds = 0).
      
      Fix: Ignore the Status returned on Deleting Archival Directory.
      
      Test Plan: * make check
      
      Reviewers: dhruba, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7395
      2f0585fb
  23. 17 12月, 2012 1 次提交
    • Z
      manifest_dump: Add --hex=1 option · c2809753
      Zheng Shao 提交于
      Summary: Without this option, manifest_dump does not print binary keys for files in a human-readable way.
      
      Test Plan:
      ./manifest_dump --hex=1 --verbose=0 --file=/data/users/zshao/fdb_comparison/leveldb/fbobj.apprequest-0_0_original/MANIFEST-000002
      manifest_file_number 589 next_file_number 590 last_sequence 2311567 log_number 543  prev_log_number 0
      --- level 0 --- version# 0 ---
       532:1300357['0000455BABE20000' @ 2183973 : 1 .. 'FFFCA5D7ADE20000' @ 2184254 : 1]
       536:1308170['000198C75CE30000' @ 2203313 : 1 .. 'FFFCF94A79E30000' @ 2206463 : 1]
       542:1321644['0002931AA5E50000' @ 2267055 : 1 .. 'FFF77B31C5E50000' @ 2270754 : 1]
       544:1286390['000410A309E60000' @ 2278592 : 1 .. 'FFFE470A73E60000' @ 2289221 : 1]
       538:1298778['0006BCF4D8E30000' @ 2217050 : 1 .. 'FFFD77DAF7E30000' @ 2220489 : 1]
       540:1282353['00090D5356E40000' @ 2231156 : 1 .. 'FFFFF4625CE40000' @ 2231969 : 1]
      --- level 1 --- version# 0 ---
       510:2112325['000007F9C2D40000' @ 1782099 : 1 .. '146F5B67B8D80000' @ 1905458 : 1]
       511:2121742['146F8A3023D60000' @ 1824388 : 1 .. '28BC8FBB9CD40000' @ 1777993 : 1]
       512:801631['28BCD396F1DE0000' @ 2080191 : 1 .. '3082DBE9ADDB0000' @ 1989927 : 1]
      
      Reviewers: dhruba, sheki, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7425
      c2809753
  24. 13 12月, 2012 1 次提交
    • A
      GetSequence API in write batch. · 2ba866e0
      Abhishek Kona 提交于
      Summary:
      WriteBatch is now used by the GetUpdatesSinceAPI. This API is external
      and will be used by the rocks server. Rocks Server and others will need
      to know about the Sequence Number in the WriteBatch. This public method
      will allow for that.
      
      Test Plan: make all check.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7293
      2ba866e0
  25. 12 12月, 2012 1 次提交
  26. 11 12月, 2012 2 次提交