From f82c3eb5e23e80c8ff35b7536e0765b4edf55106 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 30 Apr 2021 15:18:32 +0300 Subject: [PATCH 1/2] Enable wal proposer test --- integration_tests/tests/test_wal_acceptor.rs | 2 +- vendor/postgres | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/tests/test_wal_acceptor.rs b/integration_tests/tests/test_wal_acceptor.rs index 25c2ca54c5..5a4a2074d2 100644 --- a/integration_tests/tests/test_wal_acceptor.rs +++ b/integration_tests/tests/test_wal_acceptor.rs @@ -13,7 +13,7 @@ use std::{thread, time}; const DOWNTIME: u64 = 2; #[test] -#[ignore] +//#[ignore] fn test_embedded_wal_proposer() { let local_env = local_env::test_env("test_embedded_wal_proposer"); diff --git a/vendor/postgres b/vendor/postgres index eb52f7f49f..c2409039d6 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit eb52f7f49f7ea0b7abc39ba27bce309bef3e3a86 +Subproject commit c2409039d60bb04b867246ef32091ae32e5e8b30 From 651a8139f5ac437c5785a974e53fb8fc81f9af4a Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 30 Apr 2021 19:24:00 +0300 Subject: [PATCH 2/2] Fix bug in transaction_id_set_status_bit --- pageserver/src/walredo.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pageserver/src/walredo.rs b/pageserver/src/walredo.rs index dbb23d6547..1648f39825 100644 --- a/pageserver/src/walredo.rs +++ b/pageserver/src/walredo.rs @@ -201,26 +201,11 @@ impl WalRedoManagerInternal { let byteno: usize = ((xid as u32 % pg_constants::CLOG_XACTS_PER_PAGE as u32) / pg_constants::CLOG_XACTS_PER_BYTE) as usize; - let byteptr = &mut page[byteno..byteno + 1]; let bshift: u8 = ((xid % pg_constants::CLOG_XACTS_PER_BYTE) * pg_constants::CLOG_BITS_PER_XACT as u32) as u8; - let mut curval = byteptr[0]; - curval = (curval >> bshift) & pg_constants::CLOG_XACT_BITMASK; - - let mut byteval = [0]; - byteval[0] = curval; - byteval[0] &= !(((1 << pg_constants::CLOG_BITS_PER_XACT as u8) - 1) << bshift); - byteval[0] |= status << bshift; - - byteptr.copy_from_slice(&byteval); - trace!( - "xid {} byteno {} curval {} byteval {}", - xid, - byteno, - curval, - byteval[0] - ); + page[byteno] = + (page[byteno] & !(pg_constants::CLOG_XACT_BITMASK << bshift)) | (status << bshift); } ///