From 6b11b4250e69e8f1c7230365808980fee8379bb5 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sat, 15 May 2021 01:41:18 +0300 Subject: [PATCH] Fix compilation with older rust version. Commit 9ece1e863d used `slice.fill`, which isn't available until Rust v1.50.0. I have 1.48.0 installed, so it was failing to compile for me. We haven't really standardized on any particular Rust version, and if there's a good feature we need in a recent version, let's bump up the minimum requirement. But this is simple enough to work around. --- pageserver/src/basebackup.rs | 2 +- pageserver/src/walredo.rs | 6 +++--- vendor/postgres | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pageserver/src/basebackup.rs b/pageserver/src/basebackup.rs index 1e02ef589a..6314c3586d 100644 --- a/pageserver/src/basebackup.rs +++ b/pageserver/src/basebackup.rs @@ -54,7 +54,7 @@ fn add_slru_segments( let segname = format!("{}/{:>04X}", path, curr_segno.unwrap()); let header = new_tar_header(&segname, SEG_SIZE as u64)?; ar.append(&header, &seg_buf[..])?; - seg_buf.fill(0); + seg_buf = [0u8; SEG_SIZE]; } curr_segno = Some(segno); let offs_start = (page % pg_constants::SLRU_PAGES_PER_SEGMENT) as usize diff --git a/pageserver/src/walredo.rs b/pageserver/src/walredo.rs index 1775748d97..5a7dde01e6 100644 --- a/pageserver/src/walredo.rs +++ b/pageserver/src/walredo.rs @@ -302,7 +302,7 @@ impl PostgresRedoManagerInternal { if xlogrec.xl_rmid == pg_constants::RM_CLOG_ID { let info = xlogrec.xl_info & !pg_constants::XLR_INFO_MASK; if info == pg_constants::CLOG_ZEROPAGE { - page.clone_from_slice(&ZERO_PAGE); + page.copy_from_slice(&ZERO_PAGE); } } else if xlogrec.xl_rmid == pg_constants::RM_XACT_ID { let info = xlogrec.xl_info & pg_constants::XLOG_XACT_OPMASK; @@ -368,9 +368,9 @@ impl PostgresRedoManagerInternal { } else if xlogrec.xl_rmid == pg_constants::RM_MULTIXACT_ID { let info = xlogrec.xl_info & pg_constants::XLOG_XACT_OPMASK; if info == pg_constants::XLOG_MULTIXACT_ZERO_OFF_PAGE { - page.fill(0); + page.copy_from_slice(&ZERO_PAGE); } else if info == pg_constants::XLOG_MULTIXACT_ZERO_MEM_PAGE { - page.fill(0); + page.copy_from_slice(&ZERO_PAGE); } else if info == pg_constants::XLOG_MULTIXACT_CREATE_ID { let xlrec = XlMultiXactCreate::decode(&mut buf); if tag.rel.forknum == pg_constants::PG_MXACT_OFFSETS_FORKNUM { diff --git a/vendor/postgres b/vendor/postgres index 42b16bde64..2a6c17f1e0 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit 42b16bde64d2304ac239531a9cb00b455eb8302e +Subproject commit 2a6c17f1e013ecb5a480ad3e9db24f6b2972b8b1