fix merge conflicts

This commit is contained in:
pedrocarlo
2025-07-16 11:08:23 -03:00
parent 6088aa34c2
commit b80218324d
4 changed files with 13 additions and 7 deletions

View File

@@ -3334,7 +3334,7 @@ impl BTreeCursor {
curr_page: sibling_count_new,
sibling_count_new,
},
Ok(CursorResult::Ok(())),
Ok(IOResult::Done(())),
)
}
WriteState::BalanceFreePages {
@@ -3358,7 +3358,7 @@ impl BTreeCursor {
curr_page: curr_page + 1,
sibling_count_new,
},
Ok(CursorResult::Ok(())),
Ok(IOResult::Done(())),
)
}
}

View File

@@ -1087,7 +1087,7 @@ impl Pager {
// 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.
#[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);
const TRUNK_PAGE_HEADER_SIZE: usize = 8;
const LEAF_ENTRY_SIZE: usize = 4;
@@ -1138,7 +1138,7 @@ impl Pager {
}
let trunk_page = trunk_page.as_ref().unwrap();
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();
@@ -1167,7 +1167,7 @@ impl Pager {
}
FreePageState::NewTrunk { page } => {
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
page.set_dirty();
@@ -1189,7 +1189,7 @@ impl Pager {
}
}
*state = FreePageState::Start;
Ok(CursorResult::Ok(()))
Ok(IOResult::Done(()))
}
#[instrument(skip_all, level = Level::INFO)]

View File

@@ -99,6 +99,8 @@ impl SimulatorEnv {
self.opts.seed,
self.opts.page_size,
self.opts.latency_probability,
self.opts.min_tick,
self.opts.max_tick,
)
.unwrap(),
);
@@ -245,6 +247,8 @@ impl SimulatorEnv {
latency_probability: cli_opts.latency_probability,
experimental_mvcc: cli_opts.experimental_mvcc,
experimental_indexes: cli_opts.experimental_indexes,
min_tick: cli_opts.min_tick,
max_tick: cli_opts.max_tick,
};
let io = Arc::new(
@@ -415,6 +419,8 @@ pub(crate) struct SimulatorOpts {
pub(crate) latency_probability: usize,
pub(crate) experimental_mvcc: bool,
pub(crate) experimental_indexes: bool,
pub min_tick: u64,
pub max_tick: u64,
}
#[derive(Debug, Clone)]

View File

@@ -437,7 +437,7 @@ fn write_at(io: &impl IO, file: Arc<dyn File>, offset: usize, data: &[u8]) {
let drop_fn = Rc::new(move |_| {});
#[allow(clippy::arc_with_non_send_sync)]
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() {
io.run_once().unwrap();
}