mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-19 01:24:20 +01:00
fix merge conflicts
This commit is contained in:
@@ -3334,7 +3334,7 @@ impl BTreeCursor {
|
|||||||
curr_page: sibling_count_new,
|
curr_page: sibling_count_new,
|
||||||
sibling_count_new,
|
sibling_count_new,
|
||||||
},
|
},
|
||||||
Ok(CursorResult::Ok(())),
|
Ok(IOResult::Done(())),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
WriteState::BalanceFreePages {
|
WriteState::BalanceFreePages {
|
||||||
@@ -3358,7 +3358,7 @@ impl BTreeCursor {
|
|||||||
curr_page: curr_page + 1,
|
curr_page: curr_page + 1,
|
||||||
sibling_count_new,
|
sibling_count_new,
|
||||||
},
|
},
|
||||||
Ok(CursorResult::Ok(())),
|
Ok(IOResult::Done(())),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1087,7 +1087,7 @@ impl Pager {
|
|||||||
// Providing a page is optional, if provided it will be used to avoid reading the page from disk.
|
// Providing a page is optional, if provided it will be used to avoid reading the page from disk.
|
||||||
// This is implemented in accordance with sqlite freepage2() function.
|
// This is implemented in accordance with sqlite freepage2() function.
|
||||||
#[instrument(skip_all, level = Level::INFO)]
|
#[instrument(skip_all, level = Level::INFO)]
|
||||||
pub fn free_page(&self, page: Option<PageRef>, page_id: usize) -> Result<CursorResult<()>> {
|
pub fn free_page(&self, page: Option<PageRef>, page_id: usize) -> Result<IOResult<()>> {
|
||||||
tracing::trace!("free_page(page_id={})", page_id);
|
tracing::trace!("free_page(page_id={})", page_id);
|
||||||
const TRUNK_PAGE_HEADER_SIZE: usize = 8;
|
const TRUNK_PAGE_HEADER_SIZE: usize = 8;
|
||||||
const LEAF_ENTRY_SIZE: usize = 4;
|
const LEAF_ENTRY_SIZE: usize = 4;
|
||||||
@@ -1138,7 +1138,7 @@ impl Pager {
|
|||||||
}
|
}
|
||||||
let trunk_page = trunk_page.as_ref().unwrap();
|
let trunk_page = trunk_page.as_ref().unwrap();
|
||||||
if trunk_page.is_locked() || !trunk_page.is_loaded() {
|
if trunk_page.is_locked() || !trunk_page.is_loaded() {
|
||||||
return Ok(CursorResult::IO);
|
return Ok(IOResult::IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
let trunk_page_contents = trunk_page.get().contents.as_ref().unwrap();
|
let trunk_page_contents = trunk_page.get().contents.as_ref().unwrap();
|
||||||
@@ -1167,7 +1167,7 @@ impl Pager {
|
|||||||
}
|
}
|
||||||
FreePageState::NewTrunk { page } => {
|
FreePageState::NewTrunk { page } => {
|
||||||
if page.is_locked() || !page.is_loaded() {
|
if page.is_locked() || !page.is_loaded() {
|
||||||
return Ok(CursorResult::IO);
|
return Ok(IOResult::IO);
|
||||||
}
|
}
|
||||||
// If we get here, need to make this page a new trunk
|
// If we get here, need to make this page a new trunk
|
||||||
page.set_dirty();
|
page.set_dirty();
|
||||||
@@ -1189,7 +1189,7 @@ impl Pager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*state = FreePageState::Start;
|
*state = FreePageState::Start;
|
||||||
Ok(CursorResult::Ok(()))
|
Ok(IOResult::Done(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(skip_all, level = Level::INFO)]
|
#[instrument(skip_all, level = Level::INFO)]
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ impl SimulatorEnv {
|
|||||||
self.opts.seed,
|
self.opts.seed,
|
||||||
self.opts.page_size,
|
self.opts.page_size,
|
||||||
self.opts.latency_probability,
|
self.opts.latency_probability,
|
||||||
|
self.opts.min_tick,
|
||||||
|
self.opts.max_tick,
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
@@ -245,6 +247,8 @@ impl SimulatorEnv {
|
|||||||
latency_probability: cli_opts.latency_probability,
|
latency_probability: cli_opts.latency_probability,
|
||||||
experimental_mvcc: cli_opts.experimental_mvcc,
|
experimental_mvcc: cli_opts.experimental_mvcc,
|
||||||
experimental_indexes: cli_opts.experimental_indexes,
|
experimental_indexes: cli_opts.experimental_indexes,
|
||||||
|
min_tick: cli_opts.min_tick,
|
||||||
|
max_tick: cli_opts.max_tick,
|
||||||
};
|
};
|
||||||
|
|
||||||
let io = Arc::new(
|
let io = Arc::new(
|
||||||
@@ -415,6 +419,8 @@ pub(crate) struct SimulatorOpts {
|
|||||||
pub(crate) latency_probability: usize,
|
pub(crate) latency_probability: usize,
|
||||||
pub(crate) experimental_mvcc: bool,
|
pub(crate) experimental_mvcc: bool,
|
||||||
pub(crate) experimental_indexes: bool,
|
pub(crate) experimental_indexes: bool,
|
||||||
|
pub min_tick: u64,
|
||||||
|
pub max_tick: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ fn write_at(io: &impl IO, file: Arc<dyn File>, offset: usize, data: &[u8]) {
|
|||||||
let drop_fn = Rc::new(move |_| {});
|
let drop_fn = Rc::new(move |_| {});
|
||||||
#[allow(clippy::arc_with_non_send_sync)]
|
#[allow(clippy::arc_with_non_send_sync)]
|
||||||
let buffer = Arc::new(RefCell::new(Buffer::new(Pin::new(data.to_vec()), drop_fn)));
|
let buffer = Arc::new(RefCell::new(Buffer::new(Pin::new(data.to_vec()), drop_fn)));
|
||||||
let result = file.pwrite(offset, buffer, completion).unwrap();
|
let result = file.pwrite(offset, buffer, completion.into()).unwrap();
|
||||||
while !result.is_completed() {
|
while !result.is_completed() {
|
||||||
io.run_once().unwrap();
|
io.run_once().unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user