node: Improve fetch logging
This commit is contained in:
parent
6ff4efebed
commit
e55c86f1ce
|
|
@ -957,7 +957,6 @@ where
|
||||||
return Err(TryFetchError::SessionCapacityReached);
|
return Err(TryFetchError::SessionCapacityReached);
|
||||||
}
|
}
|
||||||
|
|
||||||
let remotes = refs_at.len();
|
|
||||||
let fetching = fetching.or_insert(FetchState {
|
let fetching = fetching.or_insert(FetchState {
|
||||||
from,
|
from,
|
||||||
refs_at: refs_at.clone(),
|
refs_at: refs_at.clone(),
|
||||||
|
|
@ -965,11 +964,6 @@ where
|
||||||
});
|
});
|
||||||
self.outbox.fetch(session, rid, refs_at, timeout);
|
self.outbox.fetch(session, rid, refs_at, timeout);
|
||||||
|
|
||||||
debug!(
|
|
||||||
target: "service",
|
|
||||||
"Fetch initiated for {rid} with {} ({remotes} remote(s))..", session.id
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(fetching)
|
Ok(fetching)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1435,6 +1429,11 @@ where
|
||||||
|
|
||||||
// Update sync status of announcer for this repo.
|
// Update sync status of announcer for this repo.
|
||||||
if let Some(refs) = message.refs.iter().find(|r| &r.remote == self.nid()) {
|
if let Some(refs) = message.refs.iter().find(|r| &r.remote == self.nid()) {
|
||||||
|
debug!(
|
||||||
|
target: "service",
|
||||||
|
"Refs announcement of {announcer} for {} contains our own remote at {} (t={})",
|
||||||
|
message.rid, refs.at, message.timestamp
|
||||||
|
);
|
||||||
match self.db.seeds_mut().synced(
|
match self.db.seeds_mut().synced(
|
||||||
&message.rid,
|
&message.rid,
|
||||||
announcer,
|
announcer,
|
||||||
|
|
@ -1453,6 +1452,12 @@ where
|
||||||
remote: *announcer,
|
remote: *announcer,
|
||||||
at: refs.at,
|
at: refs.at,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
debug!(
|
||||||
|
target: "service",
|
||||||
|
"Sync status of {announcer} was not updated for {}",
|
||||||
|
message.rid,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
@ -1897,7 +1902,11 @@ where
|
||||||
// updated while the node was stopped.
|
// updated while the node was stopped.
|
||||||
// TODO: Move to `announce_own_refs`.
|
// TODO: Move to `announce_own_refs`.
|
||||||
if let Some(refs) = refs.iter().find(|r| r.remote == ann.node) {
|
if let Some(refs) = refs.iter().find(|r| r.remote == ann.node) {
|
||||||
info!(target: "service", "Announcing local refs for {rid} to peers ({})..", refs.at);
|
info!(
|
||||||
|
target: "service",
|
||||||
|
"Announcing own refs for {rid} to peers ({}) (t={})..",
|
||||||
|
refs.at, ann.timestamp()
|
||||||
|
);
|
||||||
|
|
||||||
if let Err(e) = self
|
if let Err(e) = self
|
||||||
.db
|
.db
|
||||||
|
|
|
||||||
|
|
@ -120,18 +120,28 @@ impl Outbox {
|
||||||
|
|
||||||
pub fn fetch(
|
pub fn fetch(
|
||||||
&mut self,
|
&mut self,
|
||||||
remote: &mut Session,
|
peer: &mut Session,
|
||||||
rid: RepoId,
|
rid: RepoId,
|
||||||
refs_at: Vec<RefsAt>,
|
refs_at: Vec<RefsAt>,
|
||||||
timeout: time::Duration,
|
timeout: time::Duration,
|
||||||
) {
|
) {
|
||||||
remote.fetching(rid);
|
peer.fetching(rid);
|
||||||
|
|
||||||
let refs_at = (!refs_at.is_empty()).then_some(refs_at);
|
let refs_at = (!refs_at.is_empty()).then_some(refs_at);
|
||||||
|
|
||||||
|
if let Some(refs_at) = &refs_at {
|
||||||
|
debug!(
|
||||||
|
target: "service",
|
||||||
|
"Fetch initiated for {rid} with {peer} ({} remote(s))..", refs_at.len()
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
debug!(target: "service", "Fetch initiated for {rid} with {peer} (all remotes)..");
|
||||||
|
}
|
||||||
|
|
||||||
self.io.push_back(Io::Fetch {
|
self.io.push_back(Io::Fetch {
|
||||||
rid,
|
rid,
|
||||||
refs_at,
|
refs_at,
|
||||||
remote: remote.id,
|
remote: peer.id,
|
||||||
timeout,
|
timeout,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue