mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 00:42:54 +00:00
WIP
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1640,6 +1640,7 @@ dependencies = [
|
||||
"hyper",
|
||||
"itertools",
|
||||
"lazy_static",
|
||||
"libloading",
|
||||
"metrics",
|
||||
"nix",
|
||||
"once_cell",
|
||||
|
||||
@@ -62,6 +62,7 @@ postgres_ffi = { path = "../libs/postgres_ffi" }
|
||||
metrics = { path = "../libs/metrics" }
|
||||
utils = { path = "../libs/utils" }
|
||||
workspace_hack = { version = "0.1", path = "../workspace_hack" }
|
||||
libloading = "0.7.0"
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.3"
|
||||
|
||||
4
pageserver/src/bin/linked_redo.rs
Normal file
4
pageserver/src/bin/linked_redo.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
fn main() {
|
||||
pageserver::walredo::linked_redo().unwrap();
|
||||
}
|
||||
@@ -163,6 +163,23 @@ pub enum WalRedoError {
|
||||
InvalidRecord,
|
||||
}
|
||||
|
||||
pub fn linked_redo(
|
||||
// key: Key,
|
||||
// lsn: Lsn,
|
||||
// base_img: Option<Bytes>,
|
||||
// records: Vec<(Lsn, ZenithWalRecord)>,
|
||||
) -> Result<Bytes, WalRedoError> {
|
||||
unsafe {
|
||||
let pg_path = "/home/bojan/src/neondatabase/neon/tmp_install/bin/postgres";
|
||||
let pg_lib = libloading::Library::new(pg_path).expect("failed loading pg");
|
||||
// TODO add stringinfo arg
|
||||
let apply_record_fn: libloading::Symbol<unsafe extern fn()> =
|
||||
pg_lib.get(b"ApplyRecord").expect("failed loading ApplyRecord fn");
|
||||
}
|
||||
// TODO actually return something
|
||||
Ok(Bytes::new())
|
||||
}
|
||||
|
||||
///
|
||||
/// Public interface of WAL redo manager
|
||||
///
|
||||
@@ -185,6 +202,8 @@ impl WalRedoManager for PostgresRedoManager {
|
||||
return Err(WalRedoError::InvalidRequest);
|
||||
}
|
||||
|
||||
// return linked_redo(key, lsn, base_img, records);
|
||||
|
||||
let mut img: Option<Bytes> = base_img;
|
||||
let mut batch_zenith = can_apply_in_zenith(&records[0].1);
|
||||
let mut batch_start = 0;
|
||||
|
||||
Reference in New Issue
Block a user