]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Dbid feature 2.5.fb v2.5
authorMayank Agarwal <amayank@fb.com>
Fri, 18 Oct 2013 21:50:54 +0000 (14:50 -0700)
committerMayank Agarwal <amayank@fb.com>
Tue, 22 Oct 2013 19:23:34 +0000 (12:23 -0700)
commit9b50106f9ae1163c2da55b479bc01035964ac392
treeb596f1bd0007d4bffa65c0faa83b1a9435c4faf8
parentae8e0770b47cfc11b6d8ea901b2d5aa8347249cb
Dbid feature

Summary:
Create a new type of file on startup if it doesn't already exist called DBID.
This will store a unique number generated from boost library's uuid header file.
The use-case is to identify the case of a db losing all its data and coming back up either empty or from an image(backup/live replica's recovery)
the key point to note is that DBID is not stored in a backup or db snapshot
It's preferable to use Boost for uuid because:
1) A non-standard way of generating uuid is not good
2) /proc/sys/kernel/random/uuid generates a uuid but only on linux environments and the solution would not be clean
3) c++ doesn't have any direct way to get a uuid
4) Boost is a very good library that was already having linkage in rocksdb from third-party
Note: I had to update the TOOLCHAIN_REV in build files to get latest verison of boost from third-party as the older version had a bug.
I had to put Wno-uninitialized in Makefile because boost-1.51 has an unitialized variable and rocksdb would not comiple otherwise. Latet open-source for boost is 1.54 but is not there in third-party. I have notified the concerned people in fbcode about it.
@kailiu : While releasing to third-party, an additional dependency will need to be created for boost in TARGETS file. I can help identify.

Test Plan:
Expand db_test to test 2 cases
1) Restarting db with Id file present - verify that no change to Id
2)Restarting db with Id file deleted - verify that a different Id is there after reopen
Also run make all check

Reviewers: dhruba, haobo, kailiu, sdong

Reviewed By: dhruba

CC: leveldb
Differential Revision: https://reviews.facebook.net/D13587
build_tools/build_detect_platform
build_tools/fbcode.clang31.sh
build_tools/fbcode.gcc471.sh
db/db_impl.cc
db/db_test.cc
db/deletefile_test.cc
db/filename.cc
db/filename.h
include/rocksdb/env.h
util/env_posix.cc