Neon now supports read-only replicas which are streaming WAL from safekeeper.
So safekeeper has multiple subscribers and receives standby reply / hot-stanby feeback from all of them.
Right now safekeerp merge hot-standaby feedbacks:
let hs_feedback = standby_feedback.hs_feedback;
// doing Option math like op1.iter().chain(op2.iter()).min()
// would be nicer, but we serialize/deserialize this struct
// directly, so leave as is for now
if hs_feedback.xmin != INVALID_FULL_TRANSACTION_ID {
if agg.xmin != INVALID_FULL_TRANSACTION_ID {
agg.xmin = min(agg.xmin, hs_feedback.xmin);
} else {
agg.xmin = hs_feedback.xmin;
}
agg.ts = min(agg.ts, hs_feedback.ts);
}
But I failed to ind code where it is merging StandbyReply (write/commit/flush LSNs).
Looks like now safe keeper is forwarding all replies to master node.
It seems to e not correct, because some of RO replicas can proceed WAL faster than master pageserver.
But just taken min of all replies is also not a good solution, because in this case lagged replica can cause throttling of master compute node.
Steps to reproduce
Neon now supports read-only replicas which are streaming WAL from safekeeper. So safekeeper has multiple subscribers and receives standby reply / hot-stanby feeback from all of them. Right now safekeerp merge hot-standaby feedbacks:
But I failed to ind code where it is merging StandbyReply (write/commit/flush LSNs). Looks like now safe keeper is forwarding all replies to master node. It seems to e not correct, because some of RO replicas can proceed WAL faster than master pageserver. But just taken min of all replies is also not a good solution, because in this case lagged replica can cause throttling of master compute node.
Expected result
Actual result
Environment
Logs, links