Additional missing tracing spans on state_res::resolve components.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -24,6 +24,7 @@ use crate::utils::stream::{IterStream, ReadyExt};
|
|||||||
/// ## Returns
|
/// ## Returns
|
||||||
///
|
///
|
||||||
/// Outputs the event IDs that are not present in all the auth chains.
|
/// Outputs the event IDs that are not present in all the auth chains.
|
||||||
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
pub(super) fn auth_difference<'a, AuthSets, Id>(auth_sets: AuthSets) -> impl Stream<Item = Id>
|
pub(super) fn auth_difference<'a, AuthSets, Id>(auth_sets: AuthSets) -> impl Stream<Item = Id>
|
||||||
where
|
where
|
||||||
AuthSets: Stream<Item = AuthSet<Id>>,
|
AuthSets: Stream<Item = AuthSet<Id>>,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ struct Local {
|
|||||||
stack: Vec<Vec<OwnedEventId>>,
|
stack: Vec<Vec<OwnedEventId>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(name = "conflicted_subgraph", level = "debug", skip_all)]
|
||||||
pub(super) fn conflicted_subgraph_dfs<ConflictedEventIds, Fetch, Fut, Pdu>(
|
pub(super) fn conflicted_subgraph_dfs<ConflictedEventIds, Fetch, Fut, Pdu>(
|
||||||
conflicted_event_ids: ConflictedEventIds,
|
conflicted_event_ids: ConflictedEventIds,
|
||||||
fetch: &Fetch,
|
fetch: &Fetch,
|
||||||
@@ -65,6 +66,15 @@ where
|
|||||||
.flatten_stream()
|
.flatten_stream()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(
|
||||||
|
name = "descent",
|
||||||
|
level = "trace",
|
||||||
|
skip_all,
|
||||||
|
fields(
|
||||||
|
event_id = %conflicted_event_id,
|
||||||
|
event_ids = conflicted_event_ids.len(),
|
||||||
|
)
|
||||||
|
)]
|
||||||
async fn subgraph_descent<Fetch, Fut, Pdu>(
|
async fn subgraph_descent<Fetch, Fut, Pdu>(
|
||||||
state: Arc<Global>,
|
state: Arc<Global>,
|
||||||
conflicted_event_id: OwnedEventId,
|
conflicted_event_id: OwnedEventId,
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ where
|
|||||||
|
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
name = "check",
|
name = "check",
|
||||||
level = "debug",
|
level = "trace",
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(
|
fields(
|
||||||
%event_id,
|
%event_id,
|
||||||
%state_key,
|
?state_key,
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
async fn auth_check<Fetch, Fut, Pdu>(
|
async fn auth_check<Fetch, Fut, Pdu>(
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ where
|
|||||||
/// Add the event with the given event ID and all the events in its auth chain
|
/// Add the event with the given event ID and all the events in its auth chain
|
||||||
/// that are in the full conflicted set to the graph.
|
/// that are in the full conflicted set to the graph.
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
|
name = "auth_chain",
|
||||||
level = "trace",
|
level = "trace",
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(
|
fields(
|
||||||
@@ -182,6 +183,7 @@ where
|
|||||||
/// Returns the power level of the sender of the event or an `Err(_)` if one of
|
/// Returns the power level of the sender of the event or an `Err(_)` if one of
|
||||||
/// the auth events if malformed.
|
/// the auth events if malformed.
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
|
name = "sender_power",
|
||||||
level = "trace",
|
level = "trace",
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(
|
fields(
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ use crate::validated;
|
|||||||
/// ## Returns
|
/// ## Returns
|
||||||
///
|
///
|
||||||
/// Returns an `(unconflicted_state, conflicted_states)` tuple.
|
/// Returns an `(unconflicted_state, conflicted_states)` tuple.
|
||||||
|
#[tracing::instrument(name = "split", level = "debug", skip_all)]
|
||||||
pub(super) async fn split_conflicted_state<'a, Maps, Id>(
|
pub(super) async fn split_conflicted_state<'a, Maps, Id>(
|
||||||
state_maps: Maps,
|
state_maps: Maps,
|
||||||
) -> (StateMap<Id>, StateMap<Vec<Id>>)
|
) -> (StateMap<Id>, StateMap<Vec<Id>>)
|
||||||
|
|||||||
@@ -13,7 +13,14 @@ use tuwunel_core::{
|
|||||||
use crate::rooms::state_compressor::CompressedState;
|
use crate::rooms::state_compressor::CompressedState;
|
||||||
|
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
#[tracing::instrument(name = "resolve", level = "debug", skip_all)]
|
#[tracing::instrument(
|
||||||
|
name = "state",
|
||||||
|
level = "debug",
|
||||||
|
skip_all,
|
||||||
|
fields(
|
||||||
|
incoming = ?incoming_state.len()
|
||||||
|
),
|
||||||
|
)]
|
||||||
pub async fn resolve_state(
|
pub async fn resolve_state(
|
||||||
&self,
|
&self,
|
||||||
room_id: &RoomId,
|
room_id: &RoomId,
|
||||||
@@ -64,7 +71,7 @@ pub async fn resolve_state(
|
|||||||
|
|
||||||
trace!("Resolving state");
|
trace!("Resolving state");
|
||||||
let state = self
|
let state = self
|
||||||
.state_resolution(room_version, fork_states, auth_chain_sets)
|
.state_resolution(room_id, room_version, fork_states, auth_chain_sets)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
trace!("State resolution done.");
|
trace!("State resolution done.");
|
||||||
@@ -96,8 +103,15 @@ pub async fn resolve_state(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
|
#[tracing::instrument(
|
||||||
|
name = "resolve",
|
||||||
|
level = "debug",
|
||||||
|
skip_all,
|
||||||
|
fields(%room_id),
|
||||||
|
)]
|
||||||
pub(super) async fn state_resolution<StateSets, AuthSets>(
|
pub(super) async fn state_resolution<StateSets, AuthSets>(
|
||||||
&self,
|
&self,
|
||||||
|
room_id: &RoomId,
|
||||||
room_version: &RoomVersionId,
|
room_version: &RoomVersionId,
|
||||||
state_sets: StateSets,
|
state_sets: StateSets,
|
||||||
auth_chains: AuthSets,
|
auth_chains: AuthSets,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use crate::rooms::short::ShortStateHash;
|
|||||||
// TODO: if we know the prev_events of the incoming event we can avoid the
|
// TODO: if we know the prev_events of the incoming event we can avoid the
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
// request and build the state from a known point and resolve if > 1 prev_event
|
// request and build the state from a known point and resolve if > 1 prev_event
|
||||||
#[tracing::instrument(name = "state", level = "debug", skip_all)]
|
#[tracing::instrument(name = "state1", level = "debug", skip_all)]
|
||||||
pub(super) async fn state_at_incoming_degree_one<Pdu>(
|
pub(super) async fn state_at_incoming_degree_one<Pdu>(
|
||||||
&self,
|
&self,
|
||||||
incoming_pdu: &Pdu,
|
incoming_pdu: &Pdu,
|
||||||
@@ -96,7 +96,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[implement(super::Service)]
|
#[implement(super::Service)]
|
||||||
#[tracing::instrument(name = "state", level = "debug", skip_all)]
|
#[tracing::instrument(name = "stateN", level = "debug", skip_all)]
|
||||||
pub(super) async fn state_at_incoming_resolved<Pdu>(
|
pub(super) async fn state_at_incoming_resolved<Pdu>(
|
||||||
&self,
|
&self,
|
||||||
incoming_pdu: &Pdu,
|
incoming_pdu: &Pdu,
|
||||||
@@ -149,7 +149,7 @@ where
|
|||||||
|
|
||||||
trace!("Resolving state");
|
trace!("Resolving state");
|
||||||
let Ok(new_state) = self
|
let Ok(new_state) = self
|
||||||
.state_resolution(room_version, fork_states, auth_chain_sets)
|
.state_resolution(room_id, room_version, fork_states, auth_chain_sets)
|
||||||
.inspect_ok(|_| trace!("State resolution done."))
|
.inspect_ok(|_| trace!("State resolution done."))
|
||||||
.await
|
.await
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user