some code reading notes

This commit is contained in:
Christian Schwarz
2025-01-23 18:58:38 +01:00
parent 3702ec889f
commit c378ce736d
4 changed files with 4 additions and 3 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;