mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-29 19:10:38 +00:00
Add WAL offloading to s3 on safekeepers.
Separate task is launched for each timeline and stopped when timeline doesn't need offloading. Decision who offloads is done through etcd leader election; currently there is no pre condition for participating, that's a TODO. neon_local and tests infrastructure for remote storage in safekeepers added, along with the test itself. ref #1009 Co-authored-by: Anton Shyrabokau <ahtoxa@Antons-MacBook-Pro.local>
This commit is contained in:
@@ -26,6 +26,9 @@ impl Lsn {
|
||||
/// Maximum possible value for an LSN
|
||||
pub const MAX: Lsn = Lsn(u64::MAX);
|
||||
|
||||
/// Invalid value for InvalidXLogRecPtr, as defined in xlogdefs.h
|
||||
pub const INVALID: Lsn = Lsn(0);
|
||||
|
||||
/// Subtract a number, returning None on overflow.
|
||||
pub fn checked_sub<T: Into<u64>>(self, other: T) -> Option<Lsn> {
|
||||
let other: u64 = other.into();
|
||||
@@ -103,6 +106,12 @@ impl Lsn {
|
||||
pub fn is_aligned(&self) -> bool {
|
||||
*self == self.align()
|
||||
}
|
||||
|
||||
/// Return if the LSN is valid
|
||||
/// mimics postgres XLogRecPtrIsInvalid macro
|
||||
pub fn is_valid(self) -> bool {
|
||||
self != Lsn::INVALID
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u64> for Lsn {
|
||||
|
||||
Reference in New Issue
Block a user