Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
feat(dup): optimize time-lag by reducing repeat delay (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao committed Apr 30, 2020
1 parent cf0971c commit 966c04d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/dist/replication/lib/duplication/duplication_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ void load_mutation::run()
decree last_decree = _duplicator->progress().last_decree;
_start_decree = last_decree + 1;
if (_replica->private_log()->max_commit_on_disk() < _start_decree) {
// wait 10 seconds for next try if no mutation was added.
repeat(10_s);
// wait 100ms for next try if no mutation was added.
repeat(100_ms);
return;
}

Expand Down
6 changes: 2 additions & 4 deletions src/dist/replication/lib/duplication/load_from_private_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ class load_from_private_log : public replica_base,
bool will_fail_skip() const;
bool will_fail_fast() const;

void TEST_set_repeat_delay(std::chrono::milliseconds delay)
{
const_cast<std::chrono::milliseconds &>(_repeat_delay) = delay;
}
void TEST_set_repeat_delay(std::chrono::milliseconds delay) { _repeat_delay = delay; }

static constexpr int MAX_ALLOWED_BLOCK_REPEATS{3};
static constexpr int MAX_ALLOWED_FILE_REPEATS{10};

Expand Down

0 comments on commit 966c04d

Please sign in to comment.