1. 25 1月, 2014 1 次提交
    • K
      Add a make target for shared library · f131d4c2
      kailiu 提交于
      Summary:
      Previous we made `make release` also compile shared library. However it takes a long time to complete.
      
      To make our development process more efficient. I added a new make target shared_lib.
      
      User can of course run `make <library_name>` for direct compilation. However the <library_name> changed under certain condition. Thus we need `make shared_lib` to get rid of the memorization from users' side.
      
      Test Plan: make shared_lib
      
      Reviewers: igor, sdong, haobo, dhruba
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15309
      f131d4c2
  2. 15 1月, 2014 2 次提交
    • K
      Move the compilation of the shared libraries to "make release" · 481c77e5
      kailiu 提交于
      Compiling the shared libraries took a long time. Thus to speed up the development speed, it still makes sense to be separated from regular compilation.
      481c77e5
    • K
      A script that automatically reformat affected lines · d702d807
      Kai Liu 提交于
      Summary:
      Added a script that reformat only the affected lines in a given diff.
      
      I planned to make that file as pre-commit hook but looks it's a little bit more difficult than I thought. Since I don't want to spend too much time on this task right now, I eventually added a "make command" to achieve this with a few additional key strokes.
      
      Also make the clang-format solely inherited from Google's style -- there are still debates on some of the style issues, but we can address them later once we reach a consensus.
      
      Test Plan: Did some ugly format change and ran "make format", all affected lines are formatted as expected.
      
      Reviewers: igor, sdong, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15147
      d702d807
  3. 14 1月, 2014 1 次提交
    • K
      Compile dynamic library by default · ac2fe728
      kailiu 提交于
      Summary:
      Per request, some users need to use dynamic rocksdb library instead of static one.
      
      However currently the dynamic libraries have to be manually compiled by default, which is inconvenient. I made dymamic libraries to be compiled by default.
      
      Test Plan: make clean; make; make clean;
      
      Reviewers: haobo, sdong, dhruba, igor
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15117
      ac2fe728
  4. 02 1月, 2014 1 次提交
  5. 27 12月, 2013 1 次提交
    • K
      Implement autovector · c01676e4
      kailiu 提交于
      Summary:
      A vector that leverages pre-allocated stack-based array to achieve better
      performance for array with small amount of items.
      
      Test Plan:
      Added tests for both correctness and performance
      
      Here is the performance benchmark between vector and autovector
      
      Please note that in the test "Creation and Insertion Test", the test case were designed with the motivation described below:
      
      * no element inserted: internal array of std::vector may not really get
        initialize.
      * one element inserted: internal array of std::vector must have
        initialized.
      * kSize elements inserted. This shows the most time we'll spend if we
        keep everything in stack.
      * 2 * kSize elements inserted. The internal vector of
        autovector must have been initialized.
      
      Note: kSize is the capacity of autovector
      
        =====================================================
        Creation and Insertion Test
        =====================================================
        created 100000 vectors:
        	each was inserted with 0 elements
        	total time elapsed: 128000 (ns)
        created 100000 autovectors:
        	each was inserted with 0 elements
        	total time elapsed: 3641000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 0 elements
        	total time elapsed: 9896000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 1 elements
        	total time elapsed: 11089000 (ns)
        created 100000 autovectors:
        	each was inserted with 1 elements
        	total time elapsed: 5008000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 1 elements
        	total time elapsed: 24271000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 4 elements
        	total time elapsed: 39369000 (ns)
        created 100000 autovectors:
        	each was inserted with 4 elements
        	total time elapsed: 10121000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 4 elements
        	total time elapsed: 28473000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 8 elements
        	total time elapsed: 75013000 (ns)
        created 100000 autovectors:
        	each was inserted with 8 elements
        	total time elapsed: 18237000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 8 elements
        	total time elapsed: 42464000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 16 elements
        	total time elapsed: 102319000 (ns)
        created 100000 autovectors:
        	each was inserted with 16 elements
        	total time elapsed: 76724000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 16 elements
        	total time elapsed: 68285000 (ns)
        -----------------------------------
        =====================================================
        Sequence Access Test
        =====================================================
        performed 100000 sequence access against vector
        	size: 4
        	total time elapsed: 198000 (ns)
        performed 100000 sequence access against autovector
        	size: 4
        	total time elapsed: 306000 (ns)
        -----------------------------------
        performed 100000 sequence access against vector
        	size: 8
        	total time elapsed: 565000 (ns)
        performed 100000 sequence access against autovector
        	size: 8
        	total time elapsed: 512000 (ns)
        -----------------------------------
        performed 100000 sequence access against vector
        	size: 16
        	total time elapsed: 1076000 (ns)
        performed 100000 sequence access against autovector
        	size: 16
        	total time elapsed: 1070000 (ns)
        -----------------------------------
      
      Reviewers: dhruba, haobo, sdong, chip
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14655
      c01676e4
  6. 19 12月, 2013 1 次提交
  7. 10 12月, 2013 2 次提交
    • D
      Fix shared lib build · f6012ab8
      Doğan Çeçen 提交于
      f6012ab8
    • 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
  8. 20 11月, 2013 3 次提交
    • I
      Split asan_check into asan_check and asan_crash_test · 8906ab59
      Igor Canadi 提交于
      8906ab59
    • I
      make asan_check · 92d90502
      Igor Canadi 提交于
      Summary: Add asan_check rule to Makefile. After we add this, we will create Jenkins run that will check for asan errors!
      
      Test Plan: make asan_check
      
      Reviewers: dhruba, kailiu, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14205
      92d90502
    • 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
  9. 19 11月, 2013 1 次提交
    • I
      Move the compiler back to 4.8.1 + more small fixes · f611aba5
      Igor Canadi 提交于
      Summary:
      1. Moved the compiler back to 4.8.1 and uses Centos 5.2 binaries if OS is Centos 5.2.
      
      2. Fixes this issue: https://github.com/facebook/rocksdb/issues/7
      
      3. We use lot of c++11 features, so we can't pretend we can compile without them. Makes it a first class dependency.
      
      4. Fix blob_store_test, which failes on Ubuntu with "too many files opened" error
      
      5. Removed dependency on port/port_chromium.h, which does not even exist on our system
      
      Test Plan: make clean; make check
      
      Reviewers: dhruba, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14145
      f611aba5
  10. 17 11月, 2013 1 次提交
  11. 13 11月, 2013 3 次提交
  12. 06 11月, 2013 1 次提交
  13. 01 11月, 2013 1 次提交
  14. 29 10月, 2013 2 次提交
    • S
      Make "Table" pluggable · d4eec30e
      Siying Dong 提交于
      Summary: This patch makes Table and TableBuilder a abstract class and make all the implementation of the current table into BlockedBasedTable and BlockedBasedTable Builder.
      
      Test Plan: Make db_test.cc to work with block based table. Add a new test simple_table_db_test.cc where a different simple table format is implemented.
      
      Reviewers: dhruba, haobo, kailiu, emayanke, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13521
      d4eec30e
    • K
      Support user-defined table stats collector · 994575c1
      Kai Liu 提交于
      Summary:
      1. Added a new option that support user-defined table stats collection.
      2. Added a deleted key stats collector in `utilities`
      
      Test Plan:
      Added a unit test for newly added code.
      Also ran make check to make sure other tests are not broken.
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13491
      994575c1
  15. 24 10月, 2013 1 次提交
    • I
      BlobStore Benchmark · 7e2c1ba1
      Igor Canadi 提交于
      Summary:
      Finally, arc diff works again! This has been sitting in my repo for a while.
      
      I would like some comments on my BlobStore benchmark. We don't have to check this in.
      
      Also, I don't do any fsync in the BlobStore, so this is all extremely fast. I'm not sure what durability guarantees we need from the BlobStore.
      
      Test Plan: Nope
      
      Reviewers: dhruba, haobo, kailiu, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13527
      7e2c1ba1
  16. 23 10月, 2013 1 次提交
  17. 17 10月, 2013 1 次提交
    • I
      External Value Store · fc4616d8
      Igor Canadi 提交于
      Summary:
      Developing a capability for storing values on external backing file(s).
      
      This is just a highly unoptimized first pass - supports:
      1) Allocating some portion of external file to be used to store value
      2) Freeing the range, enabling it to be reused by other values
      
      As next steps, I plan to:
      1) Create some kind of stress testing. Once I can measure stuff, I can focus on optimizing.
      2) Optimize locking.
      3) Optimize freelist data structure. Currently we have O(n) for both freeing and allocation.
      4) Figure out how to do recovery.
      
      Test Plan: Created a unit test.
      
      Reviewers: dhruba, haobo, kailiu
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D13389
      fc4616d8
  18. 05 10月, 2013 1 次提交
  19. 23 8月, 2013 3 次提交
    • K
      Fix the gcov/lcov related issues · 4c6dc7a9
      Kai Liu 提交于
      Summary:
      
      Jenkin reports errors that:
      
      * Linking error on some machines. The error message shows it cannot find some gcov related symbols.
      * lcov error due to the version issues.
      
      Test Plan:
      
      run make in different platforms
      
      Reviewers:
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      4c6dc7a9
    • S
      Add APIs to query SST file metadata and to delete specific SST files · 60bf2b7d
      Simha Venkataramaiah 提交于
      Summary: An api to query the level, key ranges, size etc for each SST file and an api to delete a specific file from the db and all associated state in the bookkeeping datastructures.
      
      Notes: Editing the manifest version does not release the obsolete files right away. However deleting the file directly will mess up the iterator. We may need a more aggressive/timely file deletion api.
      
      I have used std::unique_ptr - will switch to boost:: since this is external. thoughts?
      
      Unit test is fragile right now as it expects the compaction at certain levels.
      
      Test Plan: unittest
      
      Reviewers: dhruba, vamsi, emayanke
      
      CC: zshao, leveldb, haobo
      
      Task ID: #
      
      Blame Rev:
      60bf2b7d
    • J
      Do not use relative paths in build system · bc8eed12
      Jim Paton 提交于
      Summary: Previously, RocksDB's build scripts used relative pathnames like ./build_detect_platform. This can cause problems if the user uses CDPATH. Also, it just doesn't seem right to me.
      
      Test Plan:
      make clean
      make -j32 check
      
      Reviewers: MarkCallaghan, dhruba, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12459
      bc8eed12
  20. 20 8月, 2013 1 次提交
    • D
      Merge operator fixes part 1. · e1346968
      Deon Nicholas 提交于
      Summary:
      -Added null checks and revisions to DBIter::MergeValuesNewToOld()
      -Added DBIter test to stringappend_test
      -Major fix with Merge and TTL
      More plans for fixes later.
      
      Test Plan:
      -make clean; make stringappend_test -j 32; ./stringappend_test
      -make all check;
      
      Reviewers: haobo, emayanke, vamsi, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12315
      e1346968
  21. 17 8月, 2013 2 次提交
  22. 16 8月, 2013 1 次提交
    • K
      Clean up the Makefile and the build scripts · 457dcc60
      Kai Liu 提交于
      Summary: As Aaron suggested, there are quite some problems with our Makefile and scripts. So in this diff I did some cleanup for them and revise some part of the scripts/makefile to help people better understand some mysterious parts.
      
      Test Plan:
      Ran make in several modes;
      Ran the updated scripts.
      
      Reviewers: dhruba, emayanke, akushner
      
      Differential Revision: https://reviews.facebook.net/D12285
      457dcc60
  23. 15 8月, 2013 2 次提交
    • J
      Implement log blobs · 0307c5fe
      Jim Paton 提交于
      Summary:
      This patch adds the ability for the user to add sequences of arbitrary data (blobs) to write batches. These blobs are saved to the log along with everything else in the write batch. You can add multiple blobs per WriteBatch and the ordering of blobs, puts, merges, and deletes are preserved.
      
      Blobs are not saves to SST files. RocksDB ignores blobs in every way except for writing them to the log.
      
      Before committing this patch, I need to add some test code. But I'm submitting it now so people can comment on the API.
      
      Test Plan: make -j32 check
      
      Reviewers: dhruba, haobo, vamsi
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D12195
      0307c5fe
    • H
      [RocksDB] Expose thread local perf counter for low overhead, per call level performance statistics. · d9dd2a19
      Haobo Xu 提交于
      Summary:
      As title. No locking/atomic is needed due to thread local. There is also no need to modify the existing client interface, in order to expose related counters.
      
      perf_context_test shows a simple example of retrieving the number of user key comparison done for each put and get call. More counters could be added later.
      
      Sample output
      ./perf_context_test 1000000
      ==== Test PerfContextTest.KeyComparisonCount
      Inserting 1000000 key/value pairs
      ...
      total user key comparison get: 43446523
      total user key comparison put: 8017877
      max user key comparison get: 88939
      avg user key comparison get:43
      
      Basically, the current skiplist does well on average, but could perform poorly in extreme cases.
      
      Test Plan: run perf_context_test <total number of entries to put/get>
      
      Reviewers: dhruba
      
      Differential Revision: https://reviews.facebook.net/D12225
      d9dd2a19
  24. 13 8月, 2013 1 次提交
  25. 06 8月, 2013 1 次提交
  26. 30 7月, 2013 1 次提交
    • J
      Use specific DB name in merge_test · abc90b06
      Jim Paton 提交于
      Summary: Currently, merge_test uses /tmp/testdb for the test database. It should really use something more specific to merge_test. Most of the other tests use test::TmpDir() + "/<test name>db". This patch implements such behavior for merge_test; it makes merge_test use test::TmpDir() + "/merge_testdb"
      
      Test Plan:
      make clean
      make -j32 merge_test
      ./merge_test
      
      Reviewers: dhruba, haobo
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D11877
      abc90b06
  27. 02 7月, 2013 1 次提交
  28. 27 6月, 2013 1 次提交
    • D
      Added stringappend_test back into the unit tests. · 34ef8732
      Deon Nicholas 提交于
      Summary:
      With the Makefile now updated to correctly update all .o files, this
      should fix the issues recompiling stringappend_test. This should also fix the
      "segmentation-fault" that we were getting earlier. Now, stringappend_test should
      be clean, and I have added it back to the unit-tests. Also made some minor updates
      to the tests themselves.
      
      Test Plan:
      1. make clean; make stringappend_test -j 32	(will test it by itself)
      2. make clean; make all check -j 32		(to run all unit tests)
      3. make clean; make release			(test in release mode)
      4. valgrind ./stringappend_test 		(valgrind tests)
      
      Reviewers: haobo, jpaton, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D11505
      34ef8732
  29. 26 6月, 2013 1 次提交
    • D
      Updated "make clean" to remove all .o files · 6894a50a
      Deon Nicholas 提交于
      Summary:
      The old Makefile did not remove ALL .o and .d files, but rather only
      those that happened to be in the root folder and one-level deep. This was causing
      issues when recompiling files in deeper folders. This fix now causes make clean
      to find ALL .o and .d files via a unix "find" command, and then remove them.
      
      Test Plan:
      make clean;
      make all -j 32;
      
      Reviewers: haobo, jpaton, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D11493
      6894a50a