mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-31 12:00:42 +00:00
Prohibit branch creation and basebackup at out of scope lsns
Out of scope LSNs include pre initdb LSNs, and LSNs prior to latest_gc_cutoff. To get there there was also two cleanups: * Fix error handling in Execute message handler. This fixes behaviour when basebackup retured an error. Previously pageserver thread just died. * Remove "ancestor" file which previously contained ancestor id and branch lsn. Currently the same data can be obtained from metadata file. And just the way we handled ancestor file in the code introduced the case when branching fails timeline directory is created but there is no data in it except ancestor file. And this confused gc because it scans directories. So it is better to just remove ancestor file and clean up this timeline directory creation so it happens after all validity checks have passed
This commit is contained in:
committed by
Dmitry Rodionov
parent
d47f610606
commit
130184fee9
@@ -450,7 +450,21 @@ impl PostgresBackend {
|
||||
}
|
||||
|
||||
FeMessage::Execute(_) => {
|
||||
handler.process_query(self, unnamed_query_string.clone())?;
|
||||
trace!("got execute {:?}", unnamed_query_string);
|
||||
// xxx distinguish fatal and recoverable errors?
|
||||
if let Err(e) = handler.process_query(self, unnamed_query_string.clone()) {
|
||||
let errmsg = format!("{}", e);
|
||||
|
||||
warn!(
|
||||
"query handler for {:?} failed: {:#}",
|
||||
unnamed_query_string, e
|
||||
);
|
||||
self.write_message(&BeMessage::ErrorResponse(errmsg))?;
|
||||
}
|
||||
// NOTE there is no ReadyForQuery message. This handler is used
|
||||
// for basebackup and it uses CopyOut which doesnt require
|
||||
// ReadyForQuery message and backend just switches back to
|
||||
// processing mode after sending CopyDone or ErrorResponse.
|
||||
}
|
||||
|
||||
FeMessage::Sync => {
|
||||
|
||||
Reference in New Issue
Block a user