Skip to content

Commit

Permalink
[#12853] DocDB: [PITR] Turn consistent_restore flag on by default
Browse files Browse the repository at this point in the history
Summary:
In order to provide consistency guarantees if PITR restore is executed concurrently with transactions updating the data, the recommendation is to stop application workloads before initiating the restore.

There is a `consistent_restore` flag (introduced in #8419) that provides these guarantees. However, the flag is not enabled by default as it needed to be thoroughly tested. Now that the flag has been validated by QA, this diff sets the default value of `consistent_restore` to true.
Jira: DB-2615

Test Plan:
QA has validated `consistent_restore` flag. Unit tests where the flags is enabled:

ybd --gtest_filter YbAdminSnapshotScheduleTest.ConsistentRestore
ybd --gtest_filter YbAdminSnapshotScheduleTest.ConsistentTxnRestore

Reviewers: zdrudi, skedia

Reviewed By: zdrudi

Subscribers: ybase, bogdan, slingam

Differential Revision: https://phorge.dev.yugabyte.com/D26681
  • Loading branch information
yamen-haddad committed Jul 11, 2023
1 parent 2206bed commit 4b167e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/yb/tablet/operations/snapshot_operation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

using std::string;

DEFINE_UNKNOWN_bool(consistent_restore, false,
"Whether to enable consistent restoration of snapshots");
DEFINE_UNKNOWN_bool(
consistent_restore, true, "Whether to enable consistent restoration of snapshots");

DEFINE_test_flag(bool, modify_flushed_frontier_snapshot_op, true,
"Whether to modify flushed frontier after "
Expand Down
8 changes: 1 addition & 7 deletions src/yb/tools/yb-admin-snapshot-schedule-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3223,9 +3223,7 @@ void YbAdminSnapshotScheduleTest::TestGCHiddenTables() {

class YbAdminSnapshotConsistentRestoreTest : public YbAdminSnapshotScheduleTest {
public:
virtual std::vector<std::string> ExtraTSFlags() {
return { "--consistent_restore=true", "--TEST_tablet_delay_restore_ms=0" };
}
virtual std::vector<std::string> ExtraTSFlags() { return {"--TEST_tablet_delay_restore_ms=0"}; }
};

Status WaitWrites(int num, std::atomic<int>* current) {
Expand Down Expand Up @@ -3490,10 +3488,6 @@ TEST_F_EX(YbAdminSnapshotScheduleTest, DDLsDuringRestore, YbAdminSnapshotConsist

class YbAdminSnapshotConsistentRestoreFailoverTest : public YbAdminSnapshotScheduleTest {
public:
std::vector<std::string> ExtraTSFlags() override {
return { "--consistent_restore=true" };
}

std::vector<std::string> ExtraMasterFlags() override {
return { "--TEST_skip_sending_restore_finished=true" };
}
Expand Down

0 comments on commit 4b167e7

Please sign in to comment.