mirror of
https://github.com/neondatabase/neon.git
synced 2026-07-06 21:50:37 +00:00
some notes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user