1. 12 12月, 2013 3 次提交
  2. 11 12月, 2013 2 次提交
  3. 10 12月, 2013 2 次提交
    • D
      Rename leveldb to rocksdb in C api · 6c4e110c
      Doğan Çeçen 提交于
      6c4e110c
    • I
      [RocksDB] BackupableDB · fb9fce4f
      Igor Canadi 提交于
      Summary:
      In this diff I present you BackupableDB v1. You can easily use it to backup your DB and it will do incremental snapshots for you.
      Let's first describe how you would use BackupableDB. It's inheriting StackableDB interface so you can easily construct it with your DB object -- it will add a method RollTheSnapshot() to the DB object. When you call RollTheSnapshot(), current snapshot of the DB will be stored in the backup dir. To restore, you can just call RestoreDBFromBackup() on a BackupableDB (which is a static method) and it will restore all files from the backup dir. In the next version, it will even support automatic backuping every X minutes.
      
      There are multiple things you can configure:
      1. backup_env and db_env can be different, which is awesome because then you can easily backup to HDFS or wherever you feel like.
      2. sync - if true, it *guarantees* backup consistency on machine reboot
      3. number of snapshots to keep - this will keep last N snapshots around if you want, for some reason, be able to restore from an earlier snapshot. All the backuping is done in incremental fashion - if we already have 00010.sst, we will not copy it again. *IMPORTANT* -- This is based on assumption that 00010.sst never changes - two files named 00010.sst from the same DB will always be exactly the same. Is this true? I always copy manifest, current and log files.
      4. You can decide if you want to flush the memtables before you backup, or you're fine with backing up the log files -- either way, you get a complete and consistent view of the database at a time of backup.
      5. More things you can find in BackupableDBOptions
      
      Here is the directory structure I use:
      
         backup_dir/CURRENT_SNAPSHOT - just 4 bytes holding the latest snapshot
                     0, 1, 2, ... - files containing serialized version of each snapshot - containing a list of files
                     files/*.sst - sst files shared between snapshots - if one snapshot references 00010.sst and another one needs to backup it from the DB, it will just reference the same file
                     files/ 0/, 1/, 2/, ... - snapshot directories containing private snapshot files - current, manifest and log files
      
      All the files are ref counted and deleted immediatelly when they get out of scope.
      
      Some other stuff in this diff:
      1. Added GetEnv() method to the DB. Discussed with @haobo and we agreed that it seems right thing to do.
      2. Fixed StackableDB interface. The way it was set up before, I was not able to implement BackupableDB.
      
      Test Plan:
      I have a unittest, but please don't look at this yet. I just hacked it up to help me with debugging. I will write a lot of good tests and update the diff.
      
      Also, `make asan_check`
      
      Reviewers: dhruba, haobo, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb, haobo
      
      Differential Revision: https://reviews.facebook.net/D14295
      fb9fce4f
  4. 06 12月, 2013 2 次提交
  5. 05 12月, 2013 1 次提交
  6. 04 12月, 2013 4 次提交
    • M
      Add compression options to db_bench · 97aa401e
      Mark Callaghan 提交于
      Summary:
      This adds 2 options for compression to db_bench:
      * universal_compression_size_percent
      * compression_level - to set zlib compression level
      It also logs compression_size_percent at startup in LOG
      
      Task ID: #
      
      Blame Rev:
      
      Test Plan:
      make check, run db_bench
      
      Revert Plan:
      
      Database Impact:
      
      Memcache Impact:
      
      Other Notes:
      
      EImportant:
      
      - begin *PUBLIC* platform impact section -
      Bugzilla: #
      - end platform impact -
      
      Reviewers: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14439
      97aa401e
    • S
      [rocksdb] statistics counters for memtable hits and misses · 28a1b9b9
      Sajal Jain 提交于
      Summary:
      added counters
      rocksdb.memtable.hit - for memtable hit
      rocksdb.memtable.miss - for memtable miss
      
      Test Plan: db_bench tests
      
      Reviewers: igor, dhruba, haobo
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D14433
      28a1b9b9
    • I
      Killing Transform Rep · eb12e47e
      Igor Canadi 提交于
      Summary:
      Let's get rid of TransformRep and it's children. We have confirmed that HashSkipListRep works better with multifeed, so there is no benefit to keeping this around.
      
      This diff is mostly just deleting references to obsoleted functions. I also have a diff for fbcode that we'll need to push when we switch to new release.
      
      I had to expose HashSkipListRepFactory in the client header files because db_impl.cc needs access to GetTransform() function for SanitizeOptions.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14397
      eb12e47e
    • I
      Get rid of some shared_ptrs · 043fc14c
      Igor Canadi 提交于
      Summary:
      I went through all remaining shared_ptrs and removed the ones that I found not-necessary. Only GenerateCachePrefix() is called fairly often, so don't expect much perf wins.
      
      The ones that are left are accessed infrequently and I think we're fine with keeping them.
      
      Test Plan: make asan_check
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14427
      043fc14c
  7. 02 12月, 2013 1 次提交
  8. 29 11月, 2013 1 次提交
  9. 28 11月, 2013 1 次提交
  10. 26 11月, 2013 6 次提交
  11. 22 11月, 2013 3 次提交
  12. 21 11月, 2013 1 次提交
    • H
      [RocksDB] fix prefix_test · a617227a
      Haobo Xu 提交于
      Summary: user comparator needs to work if either input is prefix only.
      
      Test Plan: ./prefix_test --write_buffer_size=100000 --total_prefixes=10000 --items_per_prefix=10
      
      Reviewers: dhruba, igor
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14241
      a617227a
  13. 20 11月, 2013 2 次提交
    • K
      Move flush_block_policy from Options to TableFactory · 6eb56498
      kailiu 提交于
      Summary:
      Previously we introduce a `flush_block_policy_factory` in Options, however, that options is strongly releated to Table based tables.
      It will make more sense to move it to block based table's own factory class.
      
      Test Plan: make check to pass existing tests
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14211
      6eb56498
    • K
      Improve the "table stats" · 1415f882
      kailiu 提交于
      Summary:
      The primary motivation of the changes is to make it easier to figure out the inside of the tables.
      
      * rename "table stats" to "table properties" since now we have more than "integers" to store in the property block.
      * Add filter block size to the basic table properties.
      * Whenever a table is built, we'll log the table properties (the sample output is in Test Plan).
      * Make an api to expose deleted keys.
      
      Test Plan:
      Passed all existing test. and the sample output of table stats:
      
          ==================================================================
              Basic Properties
          ------------------------------------------------------------------
                        # data blocks: 1
                            # entries: 1
      
                         raw key size: 9
                 raw average key size: 9
                       raw value size: 9
               raw average value size: 0
      
                      data block size: 25
                     index block size: 27
                    filter block size: 18
               (estimated) table size: 70
      
                        filter policy: rocksdb.BuiltinBloomFilter
          ==================================================================
              User collected properties: InternalKeyPropertiesCollector
          ------------------------------------------------------------------
                          kDeletedKeys: 1
          ==================================================================
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14187
      1415f882
  14. 18 11月, 2013 2 次提交
    • I
      Include <unistd.h> in db_test · fc614282
      Igor Canadi 提交于
      Summary: This is the only compile issue in Ubuntu. It might be better to include <unistd.h> only in env_posix and add Truncate function to Env, but since we use truncate only in db_test, I don't think it makes much sense.
      
      Test Plan: Rocksdb now compiles on Ubuntu!
      
      Reviewers: dhruba, kailiu
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14127
      fc614282
    • I
      Upgrading compiler to gcc4.8.1 · de9ce7d4
      Igor Canadi 提交于
      Summary:
      Finally did it - the trick was in using --dynamic-linker option. This is first step to running ASAN.
      
      All of our code seems to compile just fine on 4.8.1. However, I still left fbcode.471.sh in the 'build_tools/' just in case.
      
      Test Plan: make clean; make
      
      Reviewers: dhruba, haobo, kailiu, emayanke, sdong
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14109
      de9ce7d4
  15. 17 11月, 2013 2 次提交
    • K
      Change the logic in KeyMayExist() · 75df72f2
      Kai Liu 提交于
      Summary:
      Previously in KeyMayExist(), if DB::Get() returns non-Status::OK(), we assumes key may not exist.
      However, as if index block is not in block cache, Status::Incomplete() will return. Worse still, if
      options::filter_delete is enabled, we may falsely ignore the "delete" operation:
      
        https://github.com/facebook/rocksdb/blob/master/db/write_batch.cc#L217-L220
      
      This diff fixes this bug and will let crash-test pass.
      
      Test Plan:
      Ran:
      
        ./db_stress --test_batches_snapshots=1 --ops_per_thread=1000000 --threads=32 --write_buffer_size=4194304 --destroy_db_initially=1 --reopen=0 --readpercent=5 --prefixpercent=45 --writepercent=35 --delpercent=5 --iterpercent=10 --db=/home/kailiu/local/newer --max_key=100000000 --disable_seek_compaction=0 --mmap_read=0 --block_size=16384 --cache_size=1048576 --open_files=500000 --verify_checksum=1 --sync=0 --disable_wal=0 --disable_data_sync=0 --target_file_size_base=2097152
      --target_file_size_multiplier=2 --max_write_buffer_number=3 --max_background_compactions=20 --max_bytes_for_level_base=10485760 --filter_deletes=1
      
      Previously we'll see crash happens very soon.
      
      Reviewers: igor, dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14115
      75df72f2
    • K
      make util/env_posix.cc work under mac · 97d8e573
      kailiu 提交于
      Summary: This diff invoves some more complicated issues in the posix environment.
      
      Test Plan: works under mac os. will need to verify dev box.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14061
      97d8e573
  16. 16 11月, 2013 2 次提交
    • P
      Fixed typos · 443e04e6
      Pascal Borreli 提交于
      443e04e6
    • I
      Start DeleteFileTest with clean plate · 21905dd4
      Igor Canadi 提交于
      Summary:
      Remove all the files from the test dir before the test. The test failed when there were some old files still in the directory, since it checks the file counts.
      This is what caused jenkins' test failures. It was running fine on my machine so it was hard to repro.
      
      Test Plan:
      1. create an extra 000001.log file in the test directory
      2. run a ./deletefile_test - test failes
      3. patch ./deletefile_test with this
      4. test succeeds
      
      Reviewers: haobo, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14097
      21905dd4
  17. 15 11月, 2013 3 次提交
  18. 14 11月, 2013 1 次提交
  19. 13 11月, 2013 1 次提交
    • K
      Add the index/filter block cache · 88ba331c
      Kai Liu 提交于
      Summary: This diff leverage the existing block cache and extend it to cache index/filter block.
      
      Test Plan:
      Added new tests in db_test and table_test
      
      The correctness is checked by:
      
      1. make check
      2. make valgrind_check
      
      Performance is test by:
      
      1. 10 times of build_tools/regression_build_test.sh on two versions of rocksdb before/after the code change. Test results suggests no significant difference between them. For the two key operatons `overwrite` and `readrandom`, the average iops are both 20k and ~260k, with very small variance).
      2. db_stress.
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      CC: leveldb, haobo, xjin
      
      Differential Revision: https://reviews.facebook.net/D13167
      88ba331c