Ignore zero sized cluster size in pageserver feedback.

To take into account that non zero shards send 0 size. Generally we should make
reporting sharding aware, but for now this will avoid breaking size limit after
https://github.com/neondatabase/neon/pull/6567
This commit is contained in:
Arseny Sher
2024-02-01 16:58:14 +03:00
parent 221531c9db
commit 6d71a4fd31
2 changed files with 21 additions and 5 deletions

View File

@@ -265,9 +265,9 @@ impl WalSendersShared {
/// Update aggregated pageserver feedback. LSNs (last_received,
/// disk_consistent, remote_consistent) and reply timestamp are just
/// maximized; timeline_size if taken from feedback with highest
/// last_received lsn. This is generally reasonable, but we might want to
/// implement other policies once multiple pageservers start to be actively
/// used.
/// last_received lsn except when it is 0 (sent from non zero shards). This
/// is generally reasonable, but we might want to implement other policies
/// once multiple pageservers start to be actively used.
fn update_ps_feedback(&mut self) {
let init = PageserverFeedback::empty();
let acc =
@@ -276,7 +276,9 @@ impl WalSendersShared {
.flatten()
.fold(init, |mut acc, ws_state| match ws_state.feedback {
ReplicationFeedback::Pageserver(feedback) => {
if feedback.last_received_lsn > acc.last_received_lsn {
if feedback.current_timeline_size != 0
&& feedback.last_received_lsn > acc.last_received_lsn
{
acc.current_timeline_size = feedback.current_timeline_size;
}
acc.last_received_lsn =