1. 19 2月, 2013 6 次提交
  2. 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
  3. 14 2月, 2013 1 次提交
  4. 08 2月, 2013 1 次提交
  5. 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
  6. 02 2月, 2013 1 次提交
  7. 01 2月, 2013 3 次提交
    • A
      Initialize all doubles to 0 in histogram.cc · 4dc02f7b
      Abhishek Kona 提交于
      Summary:
      The existing code did not initialize a few doubles in histogram.cc.
      Cropped up when I wrote a unit-test.
      
      Test Plan: make all check
      
      Reviewers: chip
      
      Reviewed By: chip
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8319
      4dc02f7b
    • A
      Performant util/histogram. · 009034cf
      Abhishek Kona 提交于
      Summary:
      Earlier way to record in histogram=>
      Linear search BucketLimit array to find the bucket and increment the
      counter
      Current way to record in histogram=>
      Store a HistMap statically which points the buckets of each value in the
      range [kFirstValue, kLastValue);
      
      In the proccess use vectors instead of array's and refactor some code to
      HistogramHelper class.
      
      Test Plan:
      run db_bench with histogram=1 and see a histogram being
      printed.
      
      Reviewers: dhruba, chip, heyongqiang
      
      Reviewed By: chip
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8265
      009034cf
    • K
      Fixed cache key for block cache · 4dcc0c89
      Kosie van der Merwe 提交于
      Summary:
      Added function to `RandomAccessFile` to generate an unique ID for that file. Currently only `PosixRandomAccessFile` has this behaviour implemented and only on Linux.
      
      Changed how key is generated in `Table::BlockReader`.
      
      Added tests to check whether the unique ID is stable, unique and not a prefix of another unique ID. Added tests to see that `Table` uses the cache more efficiently.
      
      Test Plan: make check
      
      Reviewers: chip, vamsi, dhruba
      
      Reviewed By: chip
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8145
      4dcc0c89
  8. 29 1月, 2013 2 次提交
  9. 26 1月, 2013 2 次提交
    • 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
    • D
      Cleanup TODO/NEWS/AUTHORS files · 16e96b12
      Dhruba Borthakur 提交于
      Summary:
      These files are not relevant anymore.
      
      Test Plan:
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      16e96b12
  10. 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
  11. 24 1月, 2013 2 次提交
    • 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
    • K
      Fixed didIO not being set with no block_cache · 88b79b24
      Kosie van der Merwe 提交于
      Summary:
      In `Table::BlockReader()` when there was no block cache `didIO` was not set.
      
      This didn't seem to matter as `didIO` is only used to trigger seek compactions. However, I would like it if someone else could check that is the case.
      
      Test Plan: `make check OPT="-g -O3"`
      
      Reviewers: dhruba, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8133
      88b79b24
  12. 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
  13. 17 1月, 2013 4 次提交
  14. 16 1月, 2013 5 次提交
  15. 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
  16. 12 1月, 2013 1 次提交
  17. 11 1月, 2013 2 次提交
  18. 10 1月, 2013 3 次提交
    • K
      Fixed wrong assumption in Table::Open() · 4e9d9d98
      Kosie van der Merwe 提交于
      Summary:
      `Table::Open()` assumes that `size` correctly describes the size of `file`, added a check that the footer is actually the right size and for good measure added assertions to `Footer::DecodeFrom()`.
      
      This was discovered by running `valgrind ./db_test` and seeing that `Footer::DecodeFrom()` was accessing uninitialized memory.
      
      Test Plan:
      make clean check
      
      ran `valgrind ./db_test` and saw DBTest.NoSpace no longer complains about a conditional jump being dependent on uninitialized memory.
      
      Reviewers: dhruba, vamsi, emayanke, sheki
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7815
      4e9d9d98
    • D
      Release 1.5.7.fb · f881d6f2
      Dhruba Borthakur 提交于
      Summary:
      
      Test Plan:
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      f881d6f2
    • A
      Remove unnecessary asserts in table/merger.cc · 2e1ad2c4
      Abhishek Kona 提交于
      Summary:
      The asserts introduced in https://reviews.facebook.net/D7629 are
      wrong.
      
      The direction of iteration is changed after the function call so they
      assert's fail.
      
      Test Plan: make clean check
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D7827
      2e1ad2c4