Add walsenders_keep_horizon option (#6860)

Add `--walsenders-keep-horizon` argument to safekeeper cmdline. It will
prevent deleting WAL segments from disk if they are needed by the active
START_REPLICATION connection.

This is useful for sharding. Without this option, if one of the shard
falls behind, it starts to read WAL from S3, which is much slower than
disk. This can result in huge shard lagging.
This commit is contained in:
Arthur Petukhovsky
2024-02-21 19:09:40 +00:00
committed by GitHub
parent 60e5a56a5a
commit 03f8a42ed9
6 changed files with 67 additions and 19 deletions

View File

@@ -175,6 +175,7 @@ pub fn run_server(os: NodeOs, disk: Arc<SafekeeperDisk>) -> Result<()> {
pg_tenant_only_auth: None,
http_auth: None,
current_thread_runtime: false,
walsenders_keep_horizon: false,
};
let mut global = GlobalMap::new(disk, conf.clone())?;