Flush layers

This commit is contained in:
Bojan Serafimov
2022-06-17 13:18:51 -04:00
parent ba79946af1
commit 4fff237f00

View File

@@ -564,6 +564,13 @@ impl PageServerHandler {
// TODO leave clean state on error
// Flush data to disk, then upload to s3
info!("flushing layers");
datadir_timeline.tline.checkpoint(CheckpointConfig::Flush)?;
// TODO Wait for s3 upload to complete
// info!("uploading layers");
// Import basebackup provided via CopyData
info!("importing basebackup");
pgb.write_message(&BeMessage::CopyInResponse)?;
@@ -602,6 +609,13 @@ impl PageServerHandler {
let reader = CopyInReader::new(pgb);
import_wal_from_tar(&mut datadir_timeline, reader, start_lsn, end_lsn)?;
// Flush data to disk, then upload to s3
info!("flushing layers");
datadir_timeline.tline.checkpoint(CheckpointConfig::Flush)?;
// TODO Wait for s3 upload to complete
// info!("uploading layers");
info!("done");
Ok(())
}