This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ strace -ye openat,fsync ./ldb ingest_extern_sst --create_if_missing --db=./tmp ./tmp.sst |& grep -E 'fsync|O_CREAT.*sst' | |
fsync(4</home/andrew/rocksdb/tmp>) = 0 | |
fsync(16</home/andrew/rocksdb/tmp/OPTIONS-000122.dbtmp>) = 0 | |
openat(AT_FDCWD, "./tmp/000124.sst", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 17</home/andrew/rocksdb/tmp/000124.sst> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ strace -ye fsync,fdatasync ./ldb ingest_extern_sst --create_if_missing --db=./tmp ./tmp.sst | |
fdatasync(11</home/andrew/rocksdb/tmp/MANIFEST-000027>) = 0 | |
fdatasync(12</home/andrew/rocksdb/tmp/000027.dbtmp>) = 0 | |
fsync(4</home/andrew/rocksdb/tmp>) = 0 | |
fsync(13</home/andrew/rocksdb/tmp/OPTIONS-000029.dbtmp>) = 0 | |
fdatasync(11</home/andrew/rocksdb/tmp/MANIFEST-000027>) = 0 | |
fdatasync(14</home/andrew/rocksdb/tmp/000031.sst>) = 0 | |
fdatasync(11</home/andrew/rocksdb/tmp/MANIFEST-000027>) = 0 | |
external SST files ingested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <assert.h> | |
#include <fcntl.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
// compile: gcc ./tmp.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ benchcmp before.out after.out | |
benchmark old MB/s new MB/s speedup | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=1/valueSize=8-6 0.43 0.43 1.00x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=1/valueSize=64-6 3.41 3.41 1.00x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=1/valueSize=512-6 25.24 25.55 1.01x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=2/valueSize=8-6 0.41 0.40 0.98x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=2/valueSize=64-6 3.26 3.22 0.99x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=2/valueSize=512-6 12.44 12.49 1.00x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=10/valueSize=8-6 0.34 0.35 1.03x | |
BenchmarkMVCCReverseScan_RocksDB/rows=1/versions=10/valueSize=64-6 2.82 2.66 0.94x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/compaction_test.go b/compaction_test.go | |
index e1e4107..f703f3e 100644 | |
--- a/compaction_test.go | |
+++ b/compaction_test.go | |
@@ -747,14 +747,7 @@ func TestManualCompaction(t *testing.T) { | |
return b.String() | |
case "compact": | |
- if len(td.CmdArgs) != 1 { | |
- return fmt.Sprintf("%s expects 1 argument", td.Cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/compaction_test.go b/compaction_test.go | |
index e1e4107..f703f3e 100644 | |
--- a/compaction_test.go | |
+++ b/compaction_test.go | |
@@ -747,14 +747,7 @@ func TestManualCompaction(t *testing.T) { | |
return b.String() | |
case "compact": | |
- if len(td.CmdArgs) != 1 { | |
- return fmt.Sprintf("%s expects 1 argument", td.Cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+TEST_F(DBRangeDelTest, CompactionOutputFilesExactlyFilled) { | |
+ // regression test for exactly filled compaction output files. Previously | |
+ // another file would be generated containing all range deletions, which | |
+ // could invalidate the non-overlapping file boundary invariant. | |
+ const int kNumPerFile = 4, kNumFiles = 2, kFileBytes = 9 << 10; | |
+ Options options = CurrentOptions(); | |
+ options.disable_auto_compactions = true; | |
+ options.level0_file_num_compaction_trigger = kNumFiles; | |
+ options.memtable_factory.reset(new SpecialSkipListFactory(kNumPerFile)); | |
+ options.num_levels = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+TEST_F(DBRangeDelTest, ValidUniversalSubcompactionBoundaries) { | |
+ const int kNumPerFile = 100, kFilesPerLevel = 4, kNumLevels = 4; | |
+ Options options = CurrentOptions(); | |
+ options.compaction_options_universal.min_merge_width = kFilesPerLevel; | |
+ options.compaction_options_universal.max_merge_width = kFilesPerLevel; | |
+ options.compaction_options_universal.size_ratio = 10; | |
+ options.compaction_style = kCompactionStyleUniversal; | |
+ options.level0_file_num_compaction_trigger = kFilesPerLevel; | |
+ options.max_subcompactions = 4; | |
+ options.memtable_factory.reset(new SpecialSkipListFactory(kNumPerFile)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/db/db_range_del_test.cc b/db/db_range_del_test.cc | |
index 47f829a..486a05d 100644 | |
--- a/db/db_range_del_test.cc | |
+++ b/db/db_range_del_test.cc | |
@@ -188,6 +188,51 @@ TEST_F(DBRangeDelTest, CompactionRemovesCoveredKeys) { | |
} | |
} | |
+TEST_F(DBRangeDelTest, ValidLevelSubcompactionBoundaries) { | |
+ const int kNumPerFile = 100, kNumFiles = 4, kFileBytes = 100 << 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/db/db_range_del_test.cc | |
+++ b/db/db_range_del_test.cc | |
@@ -61,6 +61,46 @@ TEST_F(DBRangeDelTest, CompactionOutputHasOnlyRangeTombstone) { | |
db_->ReleaseSnapshot(snapshot); | |
} | |
+TEST_F(DBRangeDelTest, FlushRangeDelsSameStartKey) { | |
+ db_->Put(WriteOptions(), "b1", "val"); | |
+ ASSERT_OK(db_->DeleteRange(WriteOptions(), "a", "c")); | |
+ db_->Put(WriteOptions(), "b2", "val"); |
NewerOlder