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
#include <assert.h> | |
#include <pthread.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
void* run_allocs(void* arg) { | |
uint64_t kSmallAllocSize = 32 << 10, kLargeAllocSize = 16 << 20; |
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
#include <assert.h> | |
#include <pthread.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
void* run_allocs(void* arg) { | |
uint64_t kSmallAllocSize = 32 << 10, kLargeAllocSize = 16 << 20; |
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
// First, create a DB using 6.14 with #7612 applied. | |
$ rm -rf ./tmp-db && ./ldb put a b --db=./tmp-db --create_if_missing | |
OK | |
// Second, update to version number to 6.15 and stop serializing the option. | |
$ git diff | |
diff --git a/include/rocksdb/version.h b/include/rocksdb/version.h | |
index bf963d917..f9055d651 100644 | |
--- a/include/rocksdb/version.h | |
+++ b/include/rocksdb/version.h |
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
#include <fcntl.h> | |
#include <linux/fs.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/ioctl.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
int main(int argc, char** argv) { |
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_compaction_test.cc b/db/db_compaction_test.cc | |
index 48a080446..a4dcb538f 100644 | |
--- a/db/db_compaction_test.cc | |
+++ b/db/db_compaction_test.cc | |
@@ -3646,9 +3646,20 @@ TEST_F(DBCompactionTest, NoCompactBottomLevelFilesWithDeletions) { | |
// just need to bump seqnum so ReleaseSnapshot knows the newest key in the SST | |
// files does not need to be preserved in case of a future snapshot. | |
ASSERT_OK(Put(Key(0), "val")); | |
- // release snapshot and no compaction should be triggered. | |
- db_->ReleaseSnapshot(snapshot); |
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/external_sst_file_test.cc b/db/external_sst_file_test.cc | |
index ebd6cb2b1..5e5c0527c 100644 | |
--- a/db/external_sst_file_test.cc | |
+++ b/db/external_sst_file_test.cc | |
@@ -2335,6 +2335,34 @@ TEST_F(ExternalSSTFileTest, SkipBloomFilter) { | |
} | |
} | |
+TEST_F(ExternalSSTFileTest, IngestMultipleFilesToL0) { | |
+ const int kNumLevels = 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
$ git diff | |
diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc | |
index ebd6cb2b1..5e5c0527c 100644 | |
--- a/db/external_sst_file_test.cc | |
+++ b/db/external_sst_file_test.cc | |
@@ -2335,6 +2335,34 @@ TEST_F(ExternalSSTFileTest, SkipBloomFilter) { | |
} | |
} | |
+TEST_F(ExternalSSTFileTest, IngestMultipleFilesToL0) { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
int main(int argc, char** argv) { | |
if (argc != 3) { | |
fprintf(stderr, "usage: %s <num blocks> <block size>\n", argv[0]); | |
exit(1); | |
} | |
int num_blocks = atoi(argv[1]); |
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
commands to build/run: | |
$ capnp compile -oc++ ./kv.capnp | |
$ g++ -std=c++14 ./kv.capnp.c++ ./kv-server.c++ -o ./kv-server -lkj -lkj-async -lcapnp-rpc -lcapnp -lrocksdb -lpthread -lsnappy -lz -ldl | |
$ g++ -std=c++14 ./kv.capnp.c++ ./kv-client.c++ -o ./kv-client -lkj -lkj-async -lcapnp-rpc -lcapnp | |
$ strace -fe writev ./kv-server localhost:12345 ./tmp-db/ | |
$ ./kv-client localhost:12345 a b |
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
$ echo "x ==> y" | ./ldb write_extern_sst --db=./tmp ./tmp.sst | |
external SST file written to ./tmp.sst | |
$ 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> |
NewerOlder