mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 00:42:54 +00:00
some code reading notes
This commit is contained in:
@@ -858,7 +858,7 @@ where
|
||||
///
|
||||
/// Note: it is assumed that 'WAL we have is from the right term' check has
|
||||
/// already been done outside.
|
||||
async fn update_commit_lsn(&mut self, mut candidate: Lsn) -> Result<()> {
|
||||
async fn update_commit_lsn(&mut self, mut candidate: Lsn) -> Result<()> { // updates to inmem.commit_lsn go through here
|
||||
// Both peers and walproposer communicate this value, we might already
|
||||
// have a fresher (higher) version.
|
||||
candidate = max(candidate, self.state.inmem.commit_lsn);
|
||||
|
||||
@@ -468,7 +468,7 @@ impl SafekeeperPostgresHandler {
|
||||
&mut self,
|
||||
pgb: &mut PostgresBackend<IO>,
|
||||
start_pos: Lsn,
|
||||
term: Option<Term>,
|
||||
term: Option<Term>, // none for pageserver
|
||||
tli: WalResidentTimeline,
|
||||
) -> Result<(), CopyStreamHandlerEnd> {
|
||||
let appname = self.appname.clone();
|
||||
|
||||
@@ -227,7 +227,7 @@ where
|
||||
}
|
||||
|
||||
// keep in memory values up to date
|
||||
self.inmem.commit_lsn = s.commit_lsn;
|
||||
self.inmem.commit_lsn = s.commit_lsn; // and here?
|
||||
self.inmem.backup_lsn = s.backup_lsn;
|
||||
self.inmem.peer_horizon_lsn = s.peer_horizon_lsn;
|
||||
self.inmem.remote_consistent_lsn = s.remote_consistent_lsn;
|
||||
|
||||
@@ -124,6 +124,7 @@ impl Drop for WriteGuardSharedState<'_> {
|
||||
}
|
||||
});
|
||||
|
||||
// this here wakes `send_wal`
|
||||
let _ = self.tli.commit_lsn_watch_tx.send_if_modified(|old| {
|
||||
if *old != commit_lsn {
|
||||
*old = commit_lsn;
|
||||
|
||||
Reference in New Issue
Block a user