Skip to content

Commit

Permalink
Revert "Pick latest available lsn. Add more metrics"
Browse files Browse the repository at this point in the history
This reverts commit 1ecb908.
  • Loading branch information
ctring committed Oct 31, 2023
1 parent 9eb5035 commit e032268
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pageserver/src/http/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async fn build_timeline_info_common(
crate::tenant::debug_assert_current_span_has_tenant_and_timeline_id();
let last_record_lsn = timeline.get_last_record_lsn();
let (wal_source_connstr, last_received_msg_lsn, last_received_msg_ts) = {
let guard = timeline.last_received_wal.read().unwrap();
let guard = timeline.last_received_wal.lock().unwrap();
if let Some(info) = guard.as_ref() {
(
Some(format!("{:?}", info.wal_source_connconf)), // Password is hidden, but it's for statistics only.
Expand Down
4 changes: 2 additions & 2 deletions pageserver/src/tenant/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ pub struct Timeline {
/// Information about the last processed message by the WAL receiver,
/// or None if WAL receiver has not received anything for this timeline
/// yet.
pub last_received_wal: RwLock<Option<WalReceiverInfo>>,
pub last_received_wal: Mutex<Option<WalReceiverInfo>>,
pub walreceiver: Mutex<Option<WalReceiver>>,

/// Relation size cache
Expand Down Expand Up @@ -1467,7 +1467,7 @@ impl Timeline {
partitioning: Mutex::new((KeyPartitioning::new(), Lsn(0))),
repartition_threshold: 0,

last_received_wal: RwLock::new(None),
last_received_wal: Mutex::new(None),
rel_size_cache: RwLock::new(HashMap::new()),

download_all_remote_layers_task_info: RwLock::new(None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub(super) async fn handle_walreceiver_connection(
.expect("Received message time should be before UNIX EPOCH!")
.as_micros(),
};
*timeline.last_received_wal.write().unwrap() = Some(last_received_wal);
*timeline.last_received_wal.lock().unwrap() = Some(last_received_wal);

// Send the replication feedback message.
// Regular standby_status_update fields are put into this message.
Expand Down

0 comments on commit e032268

Please sign in to comment.