1. 04 3月, 2014 1 次提交
    • I
      [CF] Fix CF bugs in WriteBatch · f9b2f0ad
      Igor Canadi 提交于
      Summary:
      This diff fixes two bugs:
      * Increase sequence number even if WriteBatch fails. This is important because WriteBatches in WAL logs have implictly increasing sequence number, even if one update in a write batch fails. This caused some writes to get lost in my CF stress testing
      * Tolerate 'invalid column family' errors on recovery. When a column family is dropped, processing WAL logs can have some WriteBatches that still refer to the dropped column family. In recovery environment, we want to ignore those errors. In client's Write() code path, however, we want to return the failure to the client if he's trying to add data to invalid column family.
      
      Test Plan: db_stress's verification works now
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16533
      f9b2f0ad
  2. 01 3月, 2014 3 次提交
    • I
      [CF] Rething LogAndApply for column families · 8ea21a77
      Igor Canadi 提交于
      Summary:
      I though I might get away with as little changes to LogAndApply() as possible. It turns out this is not the case.
      
      This diff introduces different behavior of LogAndApply() for three cases:
      1. column family add
      2. column family drop
      3. no-column family manipulation
      
      (1) and (2) don't support group commit yet.
      
      There were a lot of problems with old version od LogAndApply, detected by db_stress. The biggest was non-atomicity of manifest writes and metadata changes (i.e. if column family add is in manifest, it also has to be in in-memory data structure).
      
      Test Plan: db_stress
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16491
      8ea21a77
    • I
      f6a257b6
    • I
      [CF] CreateColumnFamily fix · 510f84b6
      Igor Canadi 提交于
      Summary:
      This fixes few bugs with CreateColumnFamily
      * We first have to LogAndApply and then call VersionSet::CreateColumnFamily. Otherwise, WriteSnapshot might be invoked, writing out column family add inside of LogAndApply, even though it's not really committed
      * Fix LogAndApplyHelper() to not apply log number to column_family_data, which is in case of column family add, just a dummy (default) column family
      * Create SuperVerion when creating column family
      
      Test Plan: column_family_test
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16443
      510f84b6
  3. 28 2月, 2014 2 次提交
  4. 27 2月, 2014 5 次提交
    • I
      [CF] Test fixes and speedup · 4c422012
      Igor Canadi 提交于
      4c422012
    • I
      [CF] DifferentMergeOperators and DifferentCompactionStyles tests · 343c32be
      Igor Canadi 提交于
      Summary:
      Two new column family tests:
      * DifferentMergeOperators -- three column families, one without merge operator, one with add operator and one with append operator. verify that operations work as expected.
      * DifferentCompactionStyles -- three column families, two with level compactions and one with universal compaction. trigger the compactions and verify they work as expected.
      
      Test Plan: nope
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16377
      343c32be
    • I
      [CF] More tests · 6e7cae77
      Igor Canadi 提交于
      Summary: New unit tests for column families
      
      Test Plan: this is a test
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16359
      6e7cae77
    • I
      [CF] Fix lint errors in CF code · 9bce2b2a
      Igor Canadi 提交于
      Summary: Big CF diff uncovered some lint errors. This diff fixes some of them. Not much to see here
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16347
      9bce2b2a
    • I
      [CF] Handle failure in WriteBatch::Handler · 8b7ab995
      Igor Canadi 提交于
      Summary:
      * Add ColumnFamilyHandle::GetID() function. Client needs to know column family's ID to be able to construct WriteBatch
      * Handle WriteBatch::Handler failure gracefully. Since WriteBatch is not a very smart function (it takes raw CF id), client can add data to WriteBatch for column family that doesn't exist. In that case, we need to gracefully return failure status from DB::Write(). To do that, I added a return Status to WriteBatch functions PutCF, DeleteCF and MergeCF.
      
      Test Plan: Added test to column_family_test
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16323
      8b7ab995
  5. 26 2月, 2014 3 次提交
    • I
      [CF] Log deletion in column families · 5ad7ee03
      Igor Canadi 提交于
      Summary:
      * Added unit test that verifies that obsolete files are deleted.
      * Advance log number for empty column family when cutting log file.
      * MinLogNumber() bug fix! (caught by the new unit test)
      
      Test Plan: unit test
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16311
      5ad7ee03
    • 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
    • I
      [CF] Better handling of memtable logs · b69e7d99
      Igor Canadi 提交于
      Summary: DBImpl now keeps a list of alive_log_files_. On every FindObsoleteFiles, it deletes all alive log files that are smaller than versions_->MinLogNumber()
      
      Test Plan:
      make check passes
      no specific unit tests yet, will add
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16293
      b69e7d99
  6. 25 2月, 2014 1 次提交
  7. 20 2月, 2014 1 次提交
  8. 15 2月, 2014 2 次提交
    • I
      Fix table properties · 422bb09c
      Igor Canadi 提交于
      Summary: Adapt table properties to column family world
      
      Test Plan: make check
      
      Reviewers: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16161
      422bb09c
    • I
      [CF] DB test to run on non-default column family · c67d48c8
      Igor Canadi 提交于
      Summary:
      This is a huge diff and it was hectic, but the idea is actually quite simple. Every operation (Put, Get, etc.) done on default column family in DBTest is now forwarded to non-default ("pikachu"). The good news is that we had zero test failures! Column families look stable so far.
      
      One interesting test that I adapted for column families is MultiThreadedTest. I replaced every Put() with a WriteBatch writing to all column families concurrently. Every Put in the write batch contains unique_id. Instead of Get() I do a multiget across all column families with the same key. If atomicity holds, I expect to see the same unique_id in all column families.
      
      Test Plan: This is a test!
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16149
      c67d48c8
  9. 14 2月, 2014 1 次提交
  10. 13 2月, 2014 5 次提交
    • S
      Add more black-box tests for PlainTable and explicitly support total order mode · f3ae3d07
      Siying Dong 提交于
      Summary:
      1. Add some more implementation-aware tests for PlainTable
      2. move from a hard-coded one index per 16 rows in one prefix to a configurable number. Also, make hash table ratio = 0  means binary search only. Also fixes some divide 0 risks.
      3. Explicitly support total order (only use binary search)
      4. some code cleaning up.
      
      Test Plan: make all check
      
      Reviewers: haobo, kailiu
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16023
      f3ae3d07
    • I
      [CF] Rethinking ColumnFamilyHandle and fix to dropping column families · b06840aa
      Igor Canadi 提交于
      Summary:
      The change to the public behavior:
      * When opening a DB or creating new column family client gets a ColumnFamilyHandle.
      * As long as column family handle is alive, client can do whatever he wants with it, even drop it
      * Dropped column family can still be read from (using the column family handle)
      * Added a new call CloseColumnFamily(). Client has to close all column families that he has opened before deleting the DB
      * As soon as column family is closed, any calls to DB using that column family handle will fail (also any outstanding calls)
      
      Internally:
      * Ref-counting ColumnFamilyData
      * New thread-safety for ColumnFamilySet
      * Dropped column families are now completely dropped and their memory cleaned-up
      
      Test Plan: added some tests to column_family_test
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16101
      b06840aa
    • I
      CompactionContext to include is_manual_compaction · ca5f1a22
      Igor Canadi 提交于
      Summary: Added a bit more information to compaction context, requested by internal team at FB.
      
      Test Plan: Modified CompactionFilter test to make sure is_manual_compaction is properly set.
      
      Reviewers: haobo
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16095
      ca5f1a22
    • L
      IOError cleanup · 994c327b
      Lei Jin 提交于
      Summary: Clean up IOErrors so that it only indicates errors talking to device.
      
      Test Plan: make all check
      
      Reviewers: igor, haobo, dhruba, emayanke
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15831
      994c327b
    • L
      preload table handle on Recover() when max_open_files == -1 · 5fbf2ef4
      Lei Jin 提交于
      Summary: This covers existing table files before DB open happens and avoids contention on table cache
      
      Test Plan: db_test
      
      Reviewers: haobo, sdong, igor, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16089
      5fbf2ef4
  11. 11 2月, 2014 1 次提交
  12. 08 2月, 2014 2 次提交
  13. 07 2月, 2014 3 次提交
    • I
      Flushes should always go to HIGH priority thread pool · 0b4ccf76
      Igor Canadi 提交于
      Summary:
      This is not column-family related diff. It is in columnfamily branch because the change is significant and we want to push it with next major release (3.0).
      
      It removes the leveldb notion of one thread pool and expands it to two thread pools by default (HIGH and LOW). Flush process is removed from compaction process and all flush threads are executed on HIGH thread pool, since we don't want long-running compactions to influence flush latency.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15987
      0b4ccf76
    • I
      [CF] Thread-safety guarantees for ColumnFamilySet · f8d5443e
      Igor Canadi 提交于
      Summary: Revised thread-safety guarantees and implemented a way to spinlock the object.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, sdong, kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15975
      f8d5443e
    • I
      [CF] Propagate correct options to WriteBatch::InsertInto · 8fa8a708
      Igor Canadi 提交于
      Summary:
      WriteBatch can have multiple column families in one batch. Every column family has different options. So we have to add a way for write batch to get options for an arbitrary column family.
      
      This required a bit more acrobatics since lots of interfaces had to be changed.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, sdong, kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15957
      8fa8a708
  14. 06 2月, 2014 3 次提交
    • I
      Fixed a bug introduced by previous commit · b4f441f4
      Igor Canadi 提交于
      b4f441f4
    • I
      [CF] Options -> DBOptions · f276e0e5
      Igor Canadi 提交于
      Summary: Replaced most of occurrences of Options with more specific DBOptions. This brings us very close to supporting different configuration options for each column family.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15933
      f276e0e5
    • I
      [CF] Rethink table cache · c24d8c4e
      Igor Canadi 提交于
      Summary:
      Adapting table cache to column families is interesting. We want table cache to be global LRU, so if some column families are use not as often as others, we want them to be evicted from cache. However, current TableCache object also constructs tables on its own. If table is not found in the cache, TableCache automatically creates new table. We want each column family to be able to specify different table factory.
      
      To solve the problem, we still have a single LRU, but we provide the LRUCache object to TableCache on construction. We have one TableCache per column family, but the underyling cache is shared by all TableCache objects.
      
      This allows us to have a global LRU, but still be able to support different table factories for different column families. Also, in the future it will also be able to support different directories for different column families.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15915
      c24d8c4e
  15. 05 2月, 2014 2 次提交
    • I
      [CF] Move InternalStats to ColumnFamilyData · 7b9f1349
      Igor Canadi 提交于
      Summary: InternalStats is a messy thing, keeping both DB data and column family data. However, it's better off living in ColumnFamilyData than in DBImpl. For now, at least.
      
      Test Plan: make check
      
      Reviewers: dhruba, kailiu, haobo, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15879
      7b9f1349
    • I
      [CF] Split SanitizeOptions into two · 73f62255
      Igor Canadi 提交于
      Summary:
      There are three SanitizeOption-s now : one for DBOptions, one for ColumnFamilyOptions and one for Options (which just calls the other two)
      
      I have also reshuffled some options -- table_cache options and info_log should live in DBOptions, for example.
      
      Test Plan: make check doesn't complain
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15873
      73f62255
  16. 04 2月, 2014 5 次提交