Skip to content

Commit 9d3780b

Browse files
adiholdenromange
authored andcommitted
chore: Add extra debug log during replication
Signed-off-by: adi_holden <[email protected]>
1 parent 8acad6d commit 9d3780b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/server/engine_shard.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ static void RunFPeriodically(std::function<void()> f, std::chrono::milliseconds
369369

370370
int64_t now_ms = fb2::ProactorBase::GetMonotonicTimeNs() / 1000000;
371371
if (now_ms - 5 * period_ms.count() > last_heartbeat_ms) {
372-
VLOG(1) << "This " << error_msg << " step took " << now_ms - last_heartbeat_ms << "ms";
372+
VLOG(1) << "This " << error_msg << " step was stalled for " << now_ms - last_heartbeat_ms
373+
<< "ms";
373374
}
374375
f();
375376
last_heartbeat_ms = fb2::ProactorBase::GetMonotonicTimeNs() / 1000000;

src/server/journal/streamer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ void JournalStreamer::AsyncWrite(bool force_send) {
293293
v[i] = IoVec(io::Bytes(uptr, cur_buf.buf[i].size()));
294294
}
295295

296+
DVLOG(3) << "calling AsyncWrite with buff size:" << v.size();
296297
dest_->AsyncWrite(v.data(), v.size(),
297298
[this, len = in_flight_bytes_](std::error_code ec) { OnCompletion(ec, len); });
298299
}

src/server/replica.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ void DflyShardReplica::StableSyncDflyReadFb(ExecutionState* cntx) {
984984
acks_fb_ = fb2::Fiber("shard_acks", &DflyShardReplica::StableSyncDflyAcksFb, this, cntx);
985985
std::optional<TransactionData> tx_data;
986986
while ((tx_data = tx_reader.NextTxData(&reader, cntx))) {
987-
DVLOG(3) << "Lsn: " << tx_data->lsn;
987+
DVLOG(3) << "Lsn: " << tx_data->lsn << " flowid: " << flow_id_;
988988

989989
last_io_time_ = Proactor()->GetMonotonicTimeNs();
990990
if (tx_data->opcode == journal::Op::LSN) {
@@ -1060,7 +1060,8 @@ void DflyShardReplica::StableSyncDflyAcksFb(ExecutionState* cntx) {
10601060
// Handle ACKs with the master. PING opcodes from the master mean we should immediately
10611061
// answer.
10621062
current_offset = journal_rec_executed_.load(std::memory_order_relaxed);
1063-
VLOG(1) << "Sending an ACK with offset=" << current_offset << " forced=" << force_ping_;
1063+
VLOG(1) << "Sending an ACK with offset=" << current_offset << " forced=" << force_ping_
1064+
<< " flowid=" << flow_id_;
10641065
ack_cmd = absl::StrCat("REPLCONF ACK ", current_offset);
10651066
force_ping_ = false;
10661067
next_ack_tp = std::chrono::steady_clock::now() + ack_time_max_interval;

tests/dragonfly/replication_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,7 @@ async def delayed_takeover():
13081308

13091309
@pytest.mark.exclude_epoll
13101310
@pytest.mark.parametrize("master_threads, replica_threads", take_over_cases)
1311-
async def test_take_over_seeder(
1312-
request, df_factory, df_seeder_factory, master_threads, replica_threads
1313-
):
1311+
async def test_take_over_seeder(df_factory, df_seeder_factory, master_threads, replica_threads):
13141312
master = df_factory.create(
13151313
proactor_threads=master_threads, dbfilename=f"dump_{tmp_file_name()}", admin_port=ADMIN_PORT
13161314
)

0 commit comments

Comments
 (0)