Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use checkpoint to implement data snapshot when full replication #208

Merged
merged 11 commits into from
Mar 22, 2021
Prev Previous commit
Next Next commit
Set max share checkpoint time
ShooterIT committed Mar 18, 2021
commit a42bb154f3784170701b428ecfae62ea5325dc8e
1 change: 1 addition & 0 deletions src/storage.cc
Original file line number Diff line number Diff line change
@@ -624,6 +624,7 @@ Status Storage::ReplDataManager::GetFullReplDataInfo(Storage *storage, std::stri
// Replicas can share checkpiont to replication if the checkpoint existing
// time is less half of WAL ttl.
int64_t can_shared_time = storage->config_->RocksDB.WAL_ttl_seconds / 2;
if (can_shared_time > 60 * 60) can_shared_time = 60 * 60;
if (can_shared_time < 10 * 60) can_shared_time = 10 * 60;
if (std::time(nullptr) - storage->GetCheckpointCreateTime() > can_shared_time) {
LOG(WARNING) << "Can't use current checkpoint, waiting next checkpoint";