1. 19 2月, 2015 1 次提交
    • V
      Managed iterator · 7d817268
      Venkatesh Radhakrishnan 提交于
      Summary:
      This is a diff for managed iterator. A managed iterator
      is a wrapper around an iterator which saves the options for that
      iterator as well as the current key/value so that the underlying iterator
      and its associated memory can be released when it is aged out
      automatically or on the request of the user. Will provide the automatic release as a follow-up diff.
      
      Test Plan: Managed* tests in db_test and XF tests for managed iterator
      
      Reviewers: igor, yhchiang, anthony, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D31401
      7d817268
  2. 07 2月, 2015 1 次提交
    • I
      Fix deleting obsolete files · 2a979822
      Igor Canadi 提交于
      Summary:
      This diff basically reverts D30249 and also adds a unit test that was failing before this patch.
      
      I have no idea how I didn't catch this terrible bug when writing a diff, sorry about that :(
      
      I think we should redesign our system of keeping track of and deleting files. This is already a second bug in this critical piece of code. I'll think of few ideas.
      
      BTW this diff is also a regression when running lots of column families. I plan to revisit this separately.
      
      Test Plan: added a unit test
      
      Reviewers: yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D33045
      2a979822
  3. 04 2月, 2015 1 次提交
  4. 06 1月, 2015 1 次提交
    • I
      Deprecating skip_log_error_on_recovery · 62ad0a9b
      Igor Canadi 提交于
      Summary:
      Since https://reviews.facebook.net/D16119, we ignore partial tailing writes. Because of that, we no longer need skip_log_error_on_recovery.
      
      The documentation says "Skip log corruption error on recovery (If client is ok with losing most recent changes)", while the option actually ignores any corruption of the WAL (not only just the most recent changes). This is very dangerous and can lead to DB inconsistencies. This was originally set up to ignore partial tailing writes, which we now do automatically (after D16119). I have digged up old task t2416297 which confirms my findings.
      
      Test Plan: There was actually no tests that verified correct behavior of skip_log_error_on_recovery.
      
      Reviewers: yhchiang, rven, dhruba, sdong
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D30603
      62ad0a9b
  5. 03 12月, 2014 1 次提交
    • J
      Enforce write buffer memory limit across column families · a14b7873
      Jonah Cohen 提交于
      Summary:
      Introduces a new class for managing write buffer memory across column
      families.  We supplement ColumnFamilyOptions::write_buffer_size with
      ColumnFamilyOptions::write_buffer, a shared pointer to a WriteBuffer
      instance that enforces memory limits before flushing out to disk.
      
      Test Plan: Added SharedWriteBuffer unit test to db_test.cc
      
      Reviewers: sdong, rven, ljin, igor
      
      Reviewed By: igor
      
      Subscribers: tnovak, yhchiang, dhruba, xjin, MarkCallaghan, yoshinorim
      
      Differential Revision: https://reviews.facebook.net/D22581
      a14b7873
  6. 21 11月, 2014 1 次提交
  7. 14 11月, 2014 1 次提交
  8. 08 11月, 2014 1 次提交
    • Y
      CompactFiles, EventListener and GetDatabaseMetaData · 28c82ff1
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff adds three sets of APIs to RocksDB.
      
      = GetColumnFamilyMetaData =
      * This APIs allow users to obtain the current state of a RocksDB instance on one column family.
      * See GetColumnFamilyMetaData in include/rocksdb/db.h
      
      = EventListener =
      * A virtual class that allows users to implement a set of
        call-back functions which will be called when specific
        events of a RocksDB instance happens.
      * To register EventListener, simply insert an EventListener to ColumnFamilyOptions::listeners
      
      = CompactFiles =
      * CompactFiles API inputs a set of file numbers and an output level, and RocksDB
        will try to compact those files into the specified level.
      
      = Example =
      * Example code can be found in example/compact_files_example.cc, which implements
        a simple external compactor using EventListener, GetColumnFamilyMetaData, and
        CompactFiles API.
      
      Test Plan:
      listener_test
      compactor_test
      example/compact_files_example
      export ROCKSDB_TESTS=CompactFiles
      db_test
      export ROCKSDB_TESTS=MetaData
      db_test
      
      Reviewers: ljin, igor, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: MarkCallaghan, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D24705
      28c82ff1
  9. 28 10月, 2014 1 次提交
    • L
      dynamic inplace_update options · f1841985
      Lei Jin 提交于
      Summary:
      Make inplace_update_support and inplace_update_num_locks dynamic.
      inplace_callback becomes immutable
      We are almost free of references to cfd->options() in db_impl
      
      Test Plan: unit test
      
      Reviewers: igor, yhchiang, rven, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D25293
      f1841985
  10. 02 10月, 2014 1 次提交
    • L
      make compaction related options changeable · 5ec53f3e
      Lei Jin 提交于
      Summary:
      make compaction related options changeable. Most of changes are tedious,
      following the same convention: grabs MutableCFOptions at the beginning
      of compaction under mutex, then pass it throughout the job and register
      it in SuperVersion at the end.
      
      Test Plan: make all check
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D23349
      5ec53f3e
  11. 25 9月, 2014 1 次提交
  12. 24 9月, 2014 1 次提交
  13. 23 9月, 2014 1 次提交
  14. 20 9月, 2014 1 次提交
  15. 09 9月, 2014 3 次提交
  16. 05 9月, 2014 2 次提交
    • L
      fix more compile warnings · bb6ae0f8
      liuhuahang 提交于
      N/A
      
      Change-Id: I5b6f9c70aea7d3f3489328834fed323d41106d9f
      Signed-off-by: Nliuhuahang <liuhuahang@zerus.co>
      bb6ae0f8
    • L
      introduce ImmutableOptions · 5665e5e2
      Lei Jin 提交于
      Summary:
      As a preparation to support updating some options dynamically, I'd like
      to first introduce ImmutableOptions, which is a subset of Options that
      cannot be changed during the course of a DB lifetime without restart.
      
      ColumnFamily will keep both Options and ImmutableOptions. Any component
      below ColumnFamily should only take ImmutableOptions in their
      constructor. Other options should be taken from APIs, which will be
      allowed to adjust dynamically.
      
      I am yet to make changes to memtable and other related classes to take
      ImmutableOptions in their ctor. That can be done in a seprate diff as
      this one is already pretty big.
      
      Test Plan: make all check
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb, dhruba
      
      Differential Revision: https://reviews.facebook.net/D22545
      5665e5e2
  17. 27 8月, 2014 1 次提交
  18. 26 8月, 2014 2 次提交
  19. 14 8月, 2014 1 次提交
  20. 13 8月, 2014 1 次提交
  21. 29 7月, 2014 1 次提交
    • L
      make statistics forward-able · 40fa8a4c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      40fa8a4c
  22. 15 7月, 2014 1 次提交
    • I
      Remove stats logger · 20c05630
      Igor Canadi 提交于
      Summary: Browsing through the code, looks like StatsLogger is not used at all!
      
      Test Plan: compiles
      
      Reviewers: ljin, sdong, yhchiang, dhruba
      
      Reviewed By: dhruba
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D19827
      20c05630
  23. 09 7月, 2014 1 次提交
    • L
      integrate rate limiter into rocksdb · 534357ca
      Lei Jin 提交于
      Summary:
      Add option and plugin rate limiter for PosixWritableFile. The rate
      limiter only applies to flush and compaction. WAL and MANIFEST are
      excluded from this enforcement.
      
      Test Plan: db_test
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19425
      534357ca
  24. 03 7月, 2014 1 次提交
  25. 26 6月, 2014 2 次提交
  26. 20 6月, 2014 1 次提交
    • I
      Remove seek compaction · d4a84233
      Igor Canadi 提交于
      Summary:
      As discussed in our internal group, we don't get much use of seek compaction at the moment, while it's making code more complicated and slower in some cases.
      
      This diff removes seek compaction and (hopefully) all code that was introduced to support seek compaction.
      
      There is one test case that relied on didIO information. I'll try to find another way to implement it.
      
      Test Plan: make check
      
      Reviewers: sdong, haobo, yhchiang, ljin, dhruba
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D19161
      d4a84233
  27. 07 6月, 2014 1 次提交
    • I
      Create Missing Column Families · a0191c9d
      Igor Canadi 提交于
      Summary: Provide an convenience option to create column families if they are missing from the DB. Task #4460490
      
      Test Plan: added unit test. also, stress test for some time
      
      Reviewers: sdong, haobo, dhruba, ljin, yhchiang
      
      Reviewed By: yhchiang
      
      Subscribers: yhchiang, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18951
      a0191c9d
  28. 04 6月, 2014 1 次提交
  29. 22 5月, 2014 1 次提交
    • I
      FIFO compaction style · 6de6a066
      Igor Canadi 提交于
      Summary:
      Introducing new compaction style -- FIFO.
      
      FIFO compaction style has write amplification of 1 (+1 for WAL) and it deletes the oldest files when the total DB size exceeds pre-configured values.
      
      FIFO compaction style is suited for storing high-frequency event logs.
      
      Test Plan: Added a unit test
      
      Reviewers: dhruba, haobo, sdong
      
      Reviewed By: dhruba
      
      Subscribers: alberts, leveldb
      
      Differential Revision: https://reviews.facebook.net/D18765
      6de6a066
  30. 14 5月, 2014 1 次提交
    • I
      TablePropertiesCollectorFactory · 26f5dd9a
      Igor Canadi 提交于
      Summary:
      This diff addresses task #4296714 and rethinks how users provide us with TablePropertiesCollectors as part of Options.
      
      Here's description of task #4296714:
             I'm debugging #4295529 and noticed that our count of user properties kDeletedKeys is wrong. We're sharing one single InternalKeyPropertiesCollector with all Table Builders. In LOG Files, we're outputting number of kDeletedKeys as connected with a single table, while it's actually the total count of deleted keys since creation of the DB.
      
             For example, this table has 3155 entries and 1391828 deleted keys.
      
      The problem with current approach that we call methods on a single TablePropertiesCollector for all the tables we create. Even worse, we could do it from multiple threads at the same time and TablePropertiesCollector has no way of knowing which table we're calling it for.
      
      Good part: Looks like nobody inside Facebook is using Options::table_properties_collectors. This means we should be able to painfully change the API.
      
      In this change, I introduce TablePropertiesCollectorFactory. For every table we create, we call `CreateTablePropertiesCollector`, which creates a TablePropertiesCollector for a single table. We then use it sequentially from a single thread, which means it doesn't have to be thread-safe.
      
      Test Plan:
      Added a test in table_properties_collector_test that fails on master (build two tables, assert that kDeletedKeys count is correct for the second one).
      Also, all other tests
      
      Reviewers: sdong, dhruba, haobo, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18579
      26f5dd9a
  31. 11 5月, 2014 1 次提交
    • I
      Make it easier to start using RocksDB · 038a477b
      Igor Canadi 提交于
      Summary:
      This diff is addressing multiple things with a single goal -- to make RocksDB easier to use:
      * Add some functions to Options that make RocksDB easier to tune.
      * Add example code for both simple RocksDB and RocksDB with Column Families.
      * Rewrite our README.md
      
      Regarding Options, I took a stab at something we talked about for a long time:
      * https://www.facebook.com/groups/rocksdb.dev/permalink/563169950448190/
      
      I added functions:
      * IncreaseParallelism() -- easy, increases the thread pool and max_background_compactions
      * OptimizeLevelStyleCompaction(memtable_memory_budget) -- the easiest way to optimize rocksdb for less stalls with level style compaction. This is very likely not ideal configuration. Feel free to suggest improvements. I used some of Mark's suggestions from here: https://github.com/facebook/rocksdb/issues/54
      * OptimizeUniversalStyleCompaction(memtable_memory_budget) -- optimize for universal compaction.
      
      Test Plan: compiled rocksdb. ran examples.
      
      Reviewers: dhruba, MarkCallaghan, haobo, sdong, yhchiang
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18621
      038a477b
  32. 05 5月, 2014 1 次提交
  33. 04 5月, 2014 1 次提交
  34. 01 5月, 2014 2 次提交
    • I
      Flush stale column families · df700476
      Igor Canadi 提交于
      Summary:
      Added a new option `max_total_wal_size`. Once the total WAL size goes over that, we make an attempt to flush all column families that still have data in the earliest WAL file.
      
      By default, I calculate `max_total_wal_size` dynamically, that should be good-enough for non-advanced customers.
      
      Test Plan: Added a test
      
      Reviewers: dhruba, haobo, sdong, ljin, yhchiang
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18345
      df700476
    • S
      Allow allocating dynamic bloom, plain table indexes and hash linked list from huge page TLB · 7dafa3a1
      sdong 提交于
      Summary: Add an option to allocate a piece of memory from huge page TLB. Add options to trigger it in dynamic bloom, plain table indexes andhash linked list hash table.
      
      Test Plan: make all check
      
      Reviewers: haobo, ljin
      
      Reviewed By: haobo
      
      CC: nkg-, dhruba, leveldb, igor, yhchiang
      
      Differential Revision: https://reviews.facebook.net/D18357
      7dafa3a1