fn replica_collection_sql(target: ReplicaTarget, cutoff: &str) -> StringExpand description
Returns SQL for the latest completed compute hydration episode and its process resource peaks.
Episodes are connected components of export hydration intervals. An export that has not hydrated keeps its component open: whether it is slow or permanently stuck is unobservable, so an open component is simply an in-progress episode, recorded when (if) it completes. It blocks only its own component: an unhydrated export installed at or before a completed component’s finish would extend that component, one installed later belongs to a later episode. The latest completed component disconnected from every open one is recorded. The monotonic history guard still admits an open episode once it completes, because its start lies after every recorded finish. Cross-process clock skew can break that ordering, in which case the guard suppresses the episode rather than misrecording it.
Collection also waits until every configured replica process has reported resource usage. The query itself narrates how each step works.