Compare commits

...

4 Commits

Author SHA1 Message Date
Konstantin Knizhnik
2831a17bfa Limit number of AUX files deltas to reduce reconstruct time 2024-02-22 08:57:09 +02:00
Konstantin Knizhnik
55574da76d Bump Postgres version 2024-02-21 21:32:14 +02:00
Konstantin Knizhnik
997093b7cd Bu,p postgres versions 2024-02-21 21:30:46 +02:00
Konstantin Knizhnik
98f51df0b1 Flush logical messages with snapshots and replication origin 2024-02-21 21:30:46 +02:00
5 changed files with 22 additions and 16 deletions

View File

@@ -36,6 +36,8 @@ use tracing::{debug, trace, warn};
use utils::bin_ser::DeserializeError;
use utils::{bin_ser::BeSer, lsn::Lsn};
const MAX_AUX_FILE_DELTAS: usize = 1024;
#[derive(Debug)]
pub enum LsnForTimestamp {
/// Found commits both before and after the given timestamp
@@ -1403,16 +1405,20 @@ impl<'a> DatadirModification<'a> {
let dir = if let Some(mut dir) = self.pending_aux_files.take() {
// We already updated aux files in `self`: emit a delta and update our latest value
self.put(
AUX_FILES_KEY,
Value::WalRecord(NeonWalRecord::AuxFile {
file_path: file_path.clone(),
content: content.clone(),
}),
);
dir.upsert(file_path, content);
dir.upsert(file_path.clone(), content.clone());
if dir.files.len() % MAX_AUX_FILE_DELTAS == 0 {
self.put(
AUX_FILES_KEY,
Value::Image(Bytes::from(
AuxFilesDirectory::ser(&dir).context("serialize")?,
)),
);
} else {
self.put(
AUX_FILES_KEY,
Value::WalRecord(NeonWalRecord::AuxFile { file_path, content }),
);
}
dir
} else {
// Check if the AUX_FILES_KEY is initialized

View File

@@ -1,5 +1,5 @@
{
"postgres-v16": "9c37a4988463a97d9cacb321acf3828b09823269",
"postgres-v15": "ca2def999368d9df098a637234ad5a9003189463",
"postgres-v14": "9dd9956c55ffbbd9abe77d10382453757fedfcf5"
"postgres-v16": "dc40299045a377ec3b302c900134468a1b0f58ee",
"postgres-v15": "0baccce15a3b0446af5c403d2e869a04541b63c4",
"postgres-v14": "17101190de8a54b95e0831c66c3da426ed33db34"
}