Skip to content

Commit

Permalink
[BACKPORT 2.18][#12853] DocDB: [PITR] Turn consistent_restore flag on…
Browse files Browse the repository at this point in the history
… by default

Summary:
Original commit: 4b167e7 / D26681
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: slingam, bogdan, ybase

Differential Revision: https://phorge.dev.yugabyte.com/D27748
  • Loading branch information
yamen-haddad committed Aug 14, 2023
1 parent 30da28e commit b7a8de0
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 b7a8de0

Please sign in to comment.