Set MAX_SEND_SIZE to 1MB

This commit is contained in:
John Spray
2024-07-20 23:24:34 +01:00
parent 6162506162
commit a56bef7d9c
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ pub const RELSEG_SIZE: u32 = 1024 * 1024 * 1024 / (BLCKSZ as u32);
pub const XLOG_BLCKSZ: usize = 8192;
pub const WAL_SEGMENT_SIZE: usize = 16 * 1024 * 1024;
pub const MAX_SEND_SIZE: usize = XLOG_BLCKSZ * 16;
pub const MAX_SEND_SIZE: usize = XLOG_BLCKSZ * 128;
// Export some version independent functions that are used outside of this mod
pub use v14::xlog_utils::encode_logical_message;
+3 -2
View File
@@ -456,7 +456,7 @@ impl SafekeeperPostgresHandler {
// not synchronized with sends, so this avoids deadlocks.
let reader = pgb.split().context("START_REPLICATION split")?;
let mut sender = WalSender {
let mut sender = Box::new(WalSender {
pgb,
// should succeed since we're already holding another guard
tli: tli.wal_residence_guard().await?,
@@ -468,7 +468,7 @@ impl SafekeeperPostgresHandler {
ws_guard: ws_guard.clone(),
wal_reader,
send_buf: [0; MAX_SEND_SIZE],
};
});
let mut reply_reader = ReplyReader {
reader,
ws_guard: ws_guard.clone(),
@@ -586,6 +586,7 @@ impl<IO: AsyncRead + AsyncWrite + Unpin> WalSender<'_, IO> {
}
let send_size = (chunk_end_pos.0 - self.start_pos.0) as usize;
let send_buf = &mut self.send_buf[..send_size];
let send_size: usize;
{
// If uncommitted part is being pulled, check that the term is