Skip to content

Commit e3b4ae0

Browse files
w41terdwdwqfwe
authored andcommitted
[chore](cloud) Disable auto snapshot by default (apache#57285)
1 parent 1eeca6c commit e3b4ae0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cloud/src/meta-service/meta_service_resource.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,9 +1852,10 @@ std::pair<MetaServiceCode, std::string> handle_snapshot_switch(const std::string
18521852
LOG(INFO) << "Set default snapshot_interval_seconds to "
18531853
<< config::snapshot_min_interval_seconds << " for instance " << instance_id;
18541854
}
1855-
if (!instance->has_max_reserved_snapshot() || instance->max_reserved_snapshot() == 0) {
1856-
instance->set_max_reserved_snapshot(1);
1857-
LOG(INFO) << "Set default max_reserved_snapshots to 1 for instance " << instance_id;
1855+
if (!instance->has_max_reserved_snapshot()) {
1856+
instance->set_max_reserved_snapshot(0);
1857+
// Disable auto snapshot by default
1858+
LOG(INFO) << "Set default max_reserved_snapshots to 0 for instance " << instance_id;
18581859
}
18591860
} else {
18601861
instance->set_snapshot_switch_status(SNAPSHOT_SWITCH_OFF);

cloud/test/meta_service_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12111,7 +12111,7 @@ TEST(MetaServiceTest, SnapshotDefaultValuesTest) {
1211112111
const auto& instance = res.instance();
1211212112
ASSERT_EQ(instance.snapshot_switch_status(), SnapshotSwitchStatus::SNAPSHOT_SWITCH_ON);
1211312113
ASSERT_EQ(instance.snapshot_interval_seconds(), config::snapshot_min_interval_seconds);
12114-
ASSERT_EQ(instance.max_reserved_snapshot(), 1);
12114+
ASSERT_EQ(instance.max_reserved_snapshot(), 0);
1211512115
}
1211612116
}
1211712117

0 commit comments

Comments
 (0)