Compare commits

...

1 Commits

Author SHA1 Message Date
Christian Schwarz
5d5763d46a some notes 2025-02-19 23:53:22 +01:00
3 changed files with 7 additions and 2 deletions

View File

@@ -1019,6 +1019,8 @@ impl<IO: AsyncRead + AsyncWrite + Unpin> ReplyReader<IO> {
self.ws_guard
.walsenders
.record_ps_feedback(self.ws_guard.id, &ps_feedback);
// This here is the principal spot that updates remote_consistent_lsn.
// The other spot where it's updated from peers will go away.
self.tli
.update_remote_consistent_lsn(ps_feedback.remote_consistent_lsn)
.await;

View File

@@ -222,11 +222,13 @@ impl StateSK {
state.inmem.backup_lsn = max(Lsn(sk_info.backup_lsn), state.inmem.backup_lsn);
sync_control_file |= state.backup_lsn + wal_seg_size < state.inmem.backup_lsn;
// This will go away in the new world.
state.inmem.remote_consistent_lsn = max(
Lsn(sk_info.remote_consistent_lsn),
state.inmem.remote_consistent_lsn,
);
sync_control_file |=
// WTF is this criteria?
state.remote_consistent_lsn + wal_seg_size < state.inmem.remote_consistent_lsn;
state.inmem.peer_horizon_lsn =

View File

@@ -503,7 +503,8 @@ impl Manager {
) {
let is_active = is_wal_backup_required
|| num_computes > 0
|| state.remote_consistent_lsn < state.commit_lsn;
// state.remote_consistent_lsn is the inmemo remote consistent lsn
|| state.remote_consistent_lsn < state.commit_lsn; // this here changes with the design;
// update the broker timeline set
if self.tli_broker_active.set(is_active) {
@@ -516,7 +517,7 @@ impl Manager {
MANAGER_ACTIVE_CHANGES.inc();
}
// update the state in Arc<Timeline>
// update the state in Arc<Timeline> (which is only used for informational APIs)
self.tli
.broker_active
.store(is_active, std::sync::atomic::Ordering::Relaxed);