From 2ce653fd79251583cba300a2dfc7b0c124d616b1 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Sat, 18 Jun 2022 11:19:02 -0400 Subject: [PATCH] Add checksum todos --- pageserver/src/basebackup.rs | 2 ++ pageserver/src/page_service.rs | 6 ++++++ test_runner/batch_others/test_import.py | 1 + 3 files changed, 9 insertions(+) diff --git a/pageserver/src/basebackup.rs b/pageserver/src/basebackup.rs index 0efd931284..ed300b3360 100644 --- a/pageserver/src/basebackup.rs +++ b/pageserver/src/basebackup.rs @@ -112,6 +112,8 @@ where } pub fn send_tarball(mut self) -> anyhow::Result<()> { + // TODO include checksum + // Create pgdata subdirs structure for dir in pg_constants::PGDATA_SUBDIRS.iter() { let header = new_tar_header_dir(*dir)?; diff --git a/pageserver/src/page_service.rs b/pageserver/src/page_service.rs index afe3b5ae53..8bc050ec73 100644 --- a/pageserver/src/page_service.rs +++ b/pageserver/src/page_service.rs @@ -570,6 +570,12 @@ impl PageServerHandler { let reader = CopyInReader::new(pgb); import_basebackup_from_tar(&mut datadir_timeline, reader, base_lsn)?; + // TODO check checksum + // Meanwhile you can verify client-side by taking fullbackup + // and checking that it matches in size with what was imported. + // It wouldn't work if base came from vanilla postgres though, + // since we discard some log files. + // Flush data to disk, then upload to s3 info!("flushing layers"); datadir_timeline.tline.checkpoint(CheckpointConfig::Flush)?; diff --git a/test_runner/batch_others/test_import.py b/test_runner/batch_others/test_import.py index 85509937f4..c2af77c8ba 100644 --- a/test_runner/batch_others/test_import.py +++ b/test_runner/batch_others/test_import.py @@ -179,4 +179,5 @@ def test_import_from_pageserver(test_output_dir, pg_bin, vanilla_pg, neon_env_bu new_tar_output_file = result_basepath + ".stdout" # Check it's the same as the first fullbackup + # TODO pageserver should be checking checksum assert os.path.getsize(tar_output_file) == os.path.getsize(new_tar_output_file)