Skip to content

Commit adbae62

Browse files
committed
Rename SharedState.commit_lsn to notified_commit_lsn.
ref #682
1 parent 3127a4a commit adbae62

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

walkeeper/src/timeline.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct SharedState {
3232
sk: SafeKeeper<FileStorage>,
3333
/// For receiving-sending wal cooperation
3434
/// quorum commit LSN we've notified walsenders about
35-
commit_lsn: Lsn,
35+
notified_commit_lsn: Lsn,
3636
/// combined hot standby feedback from all replicas
3737
hs_feedback: HotStandbyFeedback,
3838
}
@@ -72,7 +72,7 @@ impl SharedState {
7272
};
7373

7474
Ok(Self {
75-
commit_lsn: Lsn(0),
75+
notified_commit_lsn: Lsn(0),
7676
sk: SafeKeeper::new(Lsn(flush_lsn), tli, storage, state),
7777
hs_feedback: HotStandbyFeedback {
7878
ts: 0,
@@ -186,7 +186,7 @@ impl Timeline {
186186
pub fn wait_for_lsn(&self, lsn: Lsn) -> Lsn {
187187
let mut shared_state = self.mutex.lock().unwrap();
188188
loop {
189-
let commit_lsn = shared_state.commit_lsn;
189+
let commit_lsn = shared_state.notified_commit_lsn;
190190
// This must be `>`, not `>=`.
191191
if commit_lsn > lsn {
192192
return commit_lsn;
@@ -198,8 +198,8 @@ impl Timeline {
198198
// Notify caught-up WAL senders about new WAL data received
199199
pub fn notify_wal_senders(&self, commit_lsn: Lsn) {
200200
let mut shared_state = self.mutex.lock().unwrap();
201-
if shared_state.commit_lsn < commit_lsn {
202-
shared_state.commit_lsn = commit_lsn;
201+
if shared_state.notified_commit_lsn < commit_lsn {
202+
shared_state.notified_commit_lsn = commit_lsn;
203203
self.cond.notify_all();
204204
}
205205
}

0 commit comments

Comments
 (0)