feat(server): Save on shutdown (#1086)

* feat(server): Save snapshot on shutdown

* CR

* Change save on shutdown to be conditional on --dbfilename.

* Support SHUTDOWN [NO]SAVE and fix unit test

* Better wait for DB loading

* Fix DF format loading state bug

* Fix some fallout from auto save
This commit is contained in:
Roy Jacobson 2023-04-20 07:30:42 +03:00 committed by GitHub
parent dd97b36965
commit 246f6093db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 37 deletions

View file

@ -38,18 +38,21 @@ namespace dfly {
class RdbTest : public BaseFamilyTest {
protected:
static void SetUpTestSuite();
void TearDown();
void SetUp();
io::FileSource GetSource(string name);
};
void RdbTest::SetUpTestSuite() {
BaseFamilyTest::SetUpTestSuite();
void RdbTest::SetUp() {
SetFlag(&FLAGS_dbfilename, "rdbtestdump");
BaseFamilyTest::SetUp();
}
void RdbTest::TearDown() {
// Disable save on shutdown
SetFlag(&FLAGS_dbfilename, "");
auto rdb_files = io::StatFiles("rdbtestdump*");
CHECK(rdb_files);
for (const auto& fl : *rdb_files) {