Merge pull request #84 from zenithdb/embedded_wal_proposer

Enable wal proposer test
This commit is contained in:
Konstantin Knizhnik
2021-04-30 19:50:27 +03:00
committed by GitHub
3 changed files with 4 additions and 19 deletions

View File

@@ -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");

View File

@@ -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);
}
///