Skip to content

Commit 2256a57

Browse files
authored
safekeeper: use WAL_SEGMENT_SIZE for empty timeline state (#9734)
## Problem `TimelinePersistentState::empty()`, used for tests and benchmarks, had a hardcoded 16 MB WAL segment size. This caused confusion when attempting to change the global segment size. ## Summary of changes Inherit from `WAL_SEGMENT_SIZE` in `TimelinePersistentState::empty()`.
1 parent 3f80af8 commit 2256a57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

safekeeper/src/state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use std::{cmp::max, ops::Deref};
55

66
use anyhow::{bail, Result};
7+
use postgres_ffi::WAL_SEGMENT_SIZE;
78
use safekeeper_api::models::TimelineTermBumpResponse;
89
use serde::{Deserialize, Serialize};
910
use utils::{
@@ -144,7 +145,7 @@ impl TimelinePersistentState {
144145
ServerInfo {
145146
pg_version: 170000, /* Postgres server version (major * 10000) */
146147
system_id: 0, /* Postgres system identifier */
147-
wal_seg_size: 16 * 1024 * 1024,
148+
wal_seg_size: WAL_SEGMENT_SIZE as u32,
148149
},
149150
vec![],
150151
Lsn::INVALID,

0 commit comments

Comments
 (0)