1. 01 3月, 2014 5 次提交
    • K
      Fix the unit test failure in devbox · ff151132
      Kai Liu 提交于
      Summary:
      My last diff was developed in MacOS but in devserver environment error occurs.
      
      I dug into the problem and found the way we calcuate approximate data size is pretty out-of-date. We can use table properties to get more accurate results.
      
      Test Plan: ran ./table_test and passed
      
      Reviewers: igor, dhruba, haobo, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16509
      ff151132
    • K
      Make the block-based table's index pluggable · 74939a9e
      kailiu 提交于
      Summary:
      This patch introduced a new table options that allows us to make
      block-based table's index pluggable.
      
      To support that new features:
      
      * Code has been refacotred to be more flexible and supports this option well.
      * More documentation is added for the existing obsecure functionalities.
      * Big surgeon on DataBlockReader(), where the logic was really convoluted.
      * Other small code cleanups.
      
      The pluggablility will mostly affect development of internal modules
      and won't change frequently, as a result I intentionally avoid
      heavy-weight patterns (like factory) and try to make it simple.
      
      Test Plan: make all check
      
      Reviewers: haobo, sdong
      
      Reviewed By: sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16395
      74939a9e
    • K
      Remove the terrible hack in for flush_block_policy_factory · bf86af51
      kailiu 提交于
      Summary:
      Previous code is too convoluted and I must be drunk for letting
      such code to be written without a second thought.
      
      Thanks to the discussion with @sdong, I added the `Options` when
      generating the flusher, thus avoiding the tricks.
      
      Just FYI: I resisted to add Options in flush_block_policy.h since I
      wanted to avoid cyclic dependencies: FlushBlockPolicy dpends on Options
      and Options also depends FlushBlockPolicy... While I appreciate my
      effort to prevent it, the old design turns out creating more troubles than
      it tried to avoid.
      
      Test Plan: ran ./table_test
      
      Reviewers: sdong
      
      Reviewed By: sdong
      
      CC: sdong, leveldb
      
      Differential Revision: https://reviews.facebook.net/D16503
      bf86af51
    • I
      Make Log::Reader more robust · 58ca641d
      Igor Canadi 提交于
      Summary:
      This diff does two things:
      (1) Log::Reader does not report a corruption when the last record in a log or manifest file is truncated (meaning that log writer died in the middle of the write). Inherited the code from LevelDB: https://code.google.com/p/leveldb/source/detail?r=269fc6ca9416129248db5ca57050cd5d39d177c8#
      (2) Turn off mmap writes for all writes to log and manifest files
      
      (2) is necessary because if we use mmap writes, the last record is not truncated, but is actually filled with zeros, making checksum fail. It is hard to recover from checksum failing.
      
      Test Plan:
      Added unit tests from LevelDB
      Actually recovered a "corrupted" MANIFEST file.
      
      Reviewers: dhruba, haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16119
      58ca641d
    • Y
      Add ReadOptions to TransactionLogIterator. · a77527f2
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add an optional input parameter ReadOptions to DB::GetUpdateSince(),
      which allows the verification of checksums to be disabled by setting
      ReadOptions::verify_checksums to false.
      
      Test Plan: Tests are done off-line and will not be included in the regular unit test.
      
      Reviewers: igor
      
      Reviewed By: igor
      
      CC: leveldb, xjin, dhruba
      
      Differential Revision: https://reviews.facebook.net/D16305
      a77527f2
  2. 28 2月, 2014 4 次提交
  3. 27 2月, 2014 4 次提交
    • K
      Make sure logger is safely released in `InfoLogLevel` · e41c060a
      kailiu 提交于
      Summary: fix the memory leak that was captured by jenkin build.
      
      Test Plan: ran the valgrind test locally
      
      Reviewers: yhchiang
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16389
      e41c060a
    • K
      Fix inconsistent code format · 444cafc2
      kailiu 提交于
      Summary:
      Found some function follows camel style. When naming funciton, we have two styles:
      
      Trivially expose internal data in readonly mode: `all_lower_case()`
      Regular function: `CapitalizeFirstLetter()`
      
      I renames these functions.
      
      Test Plan: make -j32
      
      Reviewers: haobo, sdong, dhruba, igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16383
      444cafc2
    • S
      PlainTable::Next() should pass the error message from ReadKey() · a04dbf6e
      sdong 提交于
      Summary:
      PlainTable::Next() should pass the error message from ReadKey(). Now it would return a wrong error message.
      Also improve the messages of status when failing to read
      
      Test Plan: make all check
      
      Reviewers: ljin, kailiu, haobo
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16365
      a04dbf6e
    • Y
      Enable log info with different levels. · ccaedd16
      Yueh-Hsuan Chiang 提交于
      Summary:
      * Now each Log related function has a variant that takes an additional
        argument indicating its log level, which is one of the following:
       - DEBUG, INFO, WARN, ERROR, FATAL.
      
      * To ensure backward-compatibility, old version Log functions are kept
        unchanged.
      
      * Logger now has a member variable indicating its log level.  Any incoming
        Log request which log level is lower than Logger's log level will not
        be output.
      
      * The output of the newer version Log will be prefixed by its log level.
      
      Test Plan:
      Add a LogType test in auto_roll_logger_test.cc
      
       = Sample log output =
          2014/02/11-00:03:07.683895 7feded179840 [DEBUG] this is the message to be written to the log file!!
          2014/02/11-00:03:07.683898 7feded179840 [INFO] this is the message to be written to the log file!!
          2014/02/11-00:03:07.683900 7feded179840 [WARN] this is the message to be written to the log file!!
          2014/02/11-00:03:07.683903 7feded179840 [ERROR] this is the message to be written to the log file!!
          2014/02/11-00:03:07.683906 7feded179840 [FATAL] this is the message to be written to the log file!!
      
      Reviewers: dhruba, xjin, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16071
      ccaedd16
  4. 26 2月, 2014 5 次提交
    • L
      thread local pointer storage · b2795b79
      Lei Jin 提交于
      Summary:
      This is not a generic thread local implementation in the sense that it
      only takes pointer. But it does support multiple instances per thread
      and lets user plugin function to perform cleanup when thread exits or an
      instance gets destroyed.
      
      Test Plan: unit test for now
      
      Reviewers: haobo, igor, sdong, dhruba
      
      Reviewed By: igor
      
      CC: leveldb, kailiu
      
      Differential Revision: https://reviews.facebook.net/D16131
      b2795b79
    • I
      Schedule flush when waiting on flush · 42095163
      Igor Canadi 提交于
      Summary:
      This will also help with avoiding the deadlock. If a flush failed and we're waiting for a memtable to be flushed, we should schedule a new flush and hope a new one succeedes.
      
      If paranoid_checks = false, Wait() will still hang on ENOSPC, but at least it will automatically continue when the space frees up. Current behavior both hangs and deadlocks.
      
      Also, I renamed some 'compaction' to 'flush'. 'compaction' was leveldb way of saying things.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, ljin
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16281
      42095163
    • L
      expose wal_dir in db_bench · dea894ef
      Lei Jin 提交于
      Summary: as title
      
      Test Plan: ran db_bench
      
      Reviewers: dhruba, haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16269
      dea894ef
    • I
      Merge pull request #90 from alberts/morecapi · a8c1f297
      Igor Canadi 提交于
      A few more C API functions.
      a8c1f297
    • A
      A few more C API functions. · 72aacf6b
      Albert Strasheim 提交于
      72aacf6b
  5. 25 2月, 2014 5 次提交
  6. 24 2月, 2014 2 次提交
  7. 21 2月, 2014 2 次提交
  8. 20 2月, 2014 4 次提交
  9. 19 2月, 2014 1 次提交
    • K
      Improve the check for header guard · 83e7842f
      kailiu 提交于
      Summary:
      cpplint.py only recognize `#ifdef HEADER_GUARD` as header guard.
      This patch enables the check for `#pragma once`.
      
      Test Plan: New arc lint exclude the false alarm for `#pragma once`.
      
      Reviewers: dhruba, sdong, igor, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16227
      83e7842f
  10. 15 2月, 2014 2 次提交
  11. 14 2月, 2014 5 次提交
    • K
      Improve/fix bugs for the cpp linter · 46812f68
      kailiu 提交于
      Summary:
      Previous our new `arc lint` has two annoying bugs:
      
      * Keeping sending false alarm that we'd put c++ system files first -- even though we've already done that.
        - this problem is caused by our linter, which doesn't give the underlying cpplint.py right file path (it gives "-" as file name), making cpplint.py work incorrectly.
      * Only works in rocksdb's root dir; Otherwise it'll throw exception saying "cannot find cpplint.py".
      
      I copied open source ArcanistCpplintLinter and modifiy it for our use.
      
      Test Plan: Ran arc lint and made sure the above-mentioned problem won't occur.
      
      Reviewers: haobo, sdong, igor, ljin, yhchiang, dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16137
      46812f68
    • K
      Expose the table properties to application · 63690625
      kailiu 提交于
      Summary: Provide a public API for users to access the table properties for each SSTable.
      
      Test Plan: Added a unit tests to test the function correctness under differnet conditions.
      
      Reviewers: haobo, dhruba, sdong
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16083
      63690625
    • K
      Followup code refactor on plain table · b2e7ee8b
      Kai Liu 提交于
      Summary:
      Fixed most comments in https://reviews.facebook.net/D15429.
      Still have some remaining comments left.
      
      Test Plan: make all check
      
      Reviewers: sdong, haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15885
      b2e7ee8b
    • K
      Put *.out to the ignore list (for MacOS) · 85c0545f
      Kai Liu 提交于
      85c0545f
    • K
      Benchmark table reader wiht nanoseconds · 59cffe02
      Kai Liu 提交于
      Summary: nanosecnods gave us better view of the performance, especially when some operations are fast so that micro seconds may only reveal less informative results.
      
      Test Plan:
      sample output:
      
          ./table_reader_bench --plain_table --time_unit=nanosecond
          =======================================================================================================
          InMemoryTableSimpleBenchmark:           PlainTable   num_key1:   4096   num_key2:   512   non_empty
          =======================================================================================================
          Histogram (unit: nanosecond):
          Count: 6291456  Average: 475.3867  StdDev: 556.05
          Min: 135.0000  Median: 400.1817  Max: 33370.0000
          Percentiles: P50: 400.18 P75: 530.02 P99: 887.73 P99.9: 8843.26 P99.99: 9941.21
          ------------------------------------------------------
          [     120,     140 )        2   0.000%   0.000%
          [     140,     160 )      452   0.007%   0.007%
          [     160,     180 )    13683   0.217%   0.225%
          [     180,     200 )    54353   0.864%   1.089%
          [     200,     250 )   101004   1.605%   2.694%
          [     250,     300 )   729791  11.600%  14.294% ##
          [     300,     350 )   616070   9.792%  24.086% ##
          [     350,     400 )  1628021  25.877%  49.963% #####
          [     400,     450 )   647220  10.287%  60.250% ##
          [     450,     500 )   577206   9.174%  69.424% ##
          [     500,     600 )  1168585  18.574%  87.999% ####
          [     600,     700 )   506875   8.057%  96.055% ##
          [     700,     800 )   147878   2.350%  98.406%
          [     800,     900 )    42633   0.678%  99.083%
          [     900,    1000 )    16304   0.259%  99.342%
          [    1000,    1200 )     7811   0.124%  99.466%
          [    1200,    1400 )     1453   0.023%  99.490%
          [    1400,    1600 )      307   0.005%  99.494%
          [    1600,    1800 )       81   0.001%  99.496%
          [    1800,    2000 )       18   0.000%  99.496%
          [    2000,    2500 )        8   0.000%  99.496%
          [    2500,    3000 )        6   0.000%  99.496%
          [    3500,    4000 )        3   0.000%  99.496%
          [    4000,    4500 )      116   0.002%  99.498%
          [    4500,    5000 )     1144   0.018%  99.516%
          [    5000,    6000 )     1087   0.017%  99.534%
          [    6000,    7000 )     2403   0.038%  99.572%
          [    7000,    8000 )     9840   0.156%  99.728%
          [    8000,    9000 )    12820   0.204%  99.932%
          [    9000,   10000 )     3881   0.062%  99.994%
          [   10000,   12000 )      135   0.002%  99.996%
          [   12000,   14000 )      159   0.003%  99.998%
          [   14000,   16000 )       58   0.001%  99.999%
          [   16000,   18000 )       30   0.000% 100.000%
          [   18000,   20000 )       14   0.000% 100.000%
          [   20000,   25000 )        2   0.000% 100.000%
          [   25000,   30000 )        2   0.000% 100.000%
          [   30000,   35000 )        1   0.000% 100.000%
      
      Reviewers: haobo, dhruba, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16113
      59cffe02
  12. 13 2月, 2014 1 次提交