]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Reunite checkpoint and backup core logic
authorAndrew Kryczka <andrewkr@fb.com>
Mon, 24 Apr 2017 21:57:27 +0000 (14:57 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 24 Apr 2017 22:06:46 +0000 (15:06 -0700)
commite5e545a021542f95712039b67b9863175433a88b
tree898950364208dbe27c4c99a5bdb3e501e39118b2
parent72c21fb3f2f3ec0b3156d04c95f36b30ca292c97
Reunite checkpoint and backup core logic

Summary:
These code paths forked when checkpoint was introduced by copy/pasting the core backup logic. Over time they diverged and bug fixes were sometimes applied to one but not the other (like fix to include all relevant WALs for 2PC), or it required extra effort to fix both (like fix to forge CURRENT file). This diff reunites the code paths by extracting the core logic into a function, CreateCustomCheckpoint(), that is customizable via callbacks to implement both checkpoint and backup.

Related changes:

- flush_before_backup is now forcibly enabled when 2PC is enabled
- Extracted CheckpointImpl class definition into a header file. This is so the function, CreateCustomCheckpoint(), can be called by internal rocksdb code but not exposed to users.
- Implemented more functions in DummyDB/DummyLogFile (in backupable_db_test.cc) that are used by CreateCustomCheckpoint().
Closes https://github.com/facebook/rocksdb/pull/1932

Differential Revision: D4622986

Pulled By: ajkr

fbshipit-source-id: 157723884236ee3999a682673b64f7457a7a0d87
CMakeLists.txt
TARGETS
include/rocksdb/utilities/backupable_db.h
src.mk
utilities/backupable/backupable_db.cc
utilities/backupable/backupable_db_test.cc
utilities/checkpoint/checkpoint.cc [deleted file]
utilities/checkpoint/checkpoint_impl.cc [new file with mode: 0644]
utilities/checkpoint/checkpoint_impl.h [new file with mode: 0644]