run cargo fmt
[?]
9FZSPF6U3oQmpTwxvCnadrHKQEqTkEpnrDg1UWw9Zo9E
Oct 25, 2021, 10:17 PM
YATBB4O7MHKUVYI2JKIYPHLFJIAPK7UPJWAXHR26VVJPIYAOK66ACDependencies
- [2]
GGEFV4YYSome page splits were not properly handled in deletions - [3]
ECPAFJSBadd env_borrow for Txn and MutTxn - [4]
YDHYZA77Adding the RootPage trait to access the raw bytes of a root page (needed in libpijul) - [5]
HCDD6FX7Fixing some comments and reformatting - [6]
26KI6CQSUpdating the first_rc_len when moving a cursor (this is not used anywhere at the moment, and not part of the public API, but will be useful later) - [7]
HJ6VZ7HFFixing a wrong CRC computation - [8]
BYI23QWIMore tests - [9]
YWFYZNLZCleanup + inter-process concurrency - [10]
M6PHQUGLfallocate only when necessary - [11]
OFINGD26implementing prev() on cursors (+ some cleanup) - [12]
W2MIZD5BSingle file databases + CRC for the root pages (checking the other pages makes everything very slow) - [13]
WTXLZDYIFixing bus errors on a full disk - [14]
ONES3V46reference counting works for put - [15]
XEU2QVLCDebugging after plugging this into Pijul - [16]
6BG65Y2PCursor::set_last was panicking on empty pages - [17]
QEUTVAZ4Splitting btree::page - [18]
E4MD6T3LProofreading and commenting of this crate (massive bug fixes included) - [19]
OTWDDJE7Trait/type cleanup - [20]
DASFQGORDebugging - [21]
WS4ZQM4RDebugging, tests, etc. - [22]
G4JEQLLXDebugging synchronisation - [23]
MORZOA7EAdding a check to avoid incrementing the RC of page 0 - [24]
FZBLNBGNDiagnostic tools (add_refs, check_free) + cleanup - [25]
SO25TWFLA few features for integrating it into Pijul - [26]
TSMS6W4DFully commented implementation of Sized nodes + massive cleanup - [27]
L5CVF6UJDebugging - [28]
OP6SVMODResetting history - [29]
PPI5ZTZPRebalance: put can free pages without splitting (compaction) - [30]
H3FVSQIQUnsized pages - [31]
5LSYTRQ6More docs, example, and fixing the free page diagnostic function for mutable transactions - [32]
UAQX27N4Tests - [33]
HN6Z5DU4Cleanup - [34]
KX3WVNZWTesting/debugging "rebalance causes split of the root" - [35]
73Z2UB3JCleanup + comments - [36]
YXKP4AIWNew file locks, with multiple sets of free pages - [37]
6UVFCERMFormatting, debugging, etc. - [38]
APPY2E7MUnsized deletions + custom sizes back - [39]
Q7DRIBBRDebugging replace (which cannot be del+put) - [40]
LSQ6V7M6Cleanup + docs - [41]
52X5P7NDCleaning up the unsized part - [42]
T73WR2BXCleaner RC increments for keys and values containing references + more comments in `del` - [43]
SYURNHHLAdding the `put_mut` and `set_left_child` methods - [44]
PUOGOIJ3Debugging, impls and version bump - [45]
5JOD7M26Modifying cursor lengths when appending - [*]
T7QB6QEPAdding debug.rs
Change contents
- replacement in "sanakirja-core/src/lib.rs" at line 258[7.192]→[9.346:401](∅→∅),[9.346]→[9.346:401](∅→∅),[9.401]→[5.119:153](∅→∅),[5.153]→[9.438:485](∅→∅),[9.438]→[9.438:485](∅→∅)
hasher.update(core::slice::from_raw_parts(self.data.add(8),PAGE_SIZE - 8,));hasher.update(core::slice::from_raw_parts(self.data.add(8), PAGE_SIZE - 8)); - replacement in "sanakirja-core/src/btree/page_unsized.rs" at line 153
let off = unsafe { *(page.data.as_ptr().offset(HDR as isize + c.cur * 8) as *const u64) };let off =unsafe { *(page.data.as_ptr().offset(HDR as isize + c.cur * 8) as *const u64) }; - replacement in "sanakirja-core/src/btree/page_unsized.rs" at line 341
unsafe fn put_mut(page: &mut MutPage,c: &mut Self::Cursor,k0: &K,v0: &V,r: u64,) {unsafe fn put_mut(page: &mut MutPage, c: &mut Self::Cursor, k0: &K, v0: &V, r: u64) { - replacement in "sanakirja-core/src/btree/page_unsized.rs" at line 351
unsafe fn set_left_child(page: &mut MutPage,c: &Self::Cursor,l: u64) {unsafe fn set_left_child(page: &mut MutPage, c: &Self::Cursor, l: u64) { - replacement in "sanakirja-core/src/btree/page_unsized.rs" at line 652
fn modify<T: LoadPage, K: core::fmt::Debug + ?Sized, V: core::fmt::Debug + ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(fn modify<T: LoadPage,K: core::fmt::Debug + ?Sized,V: core::fmt::Debug + ?Sized,P: BTreeMutPage<K, V>,L: AllocWrite<K, V>,>( - replacement in "sanakirja-core/src/btree/page.rs" at line 222
let off =unsafe { *(page.data.as_ptr().offset((HDR as isize + c.cur * 8) - 8) as *const u64) };let off = unsafe {*(page.data.as_ptr().offset((HDR as isize + c.cur * 8) - 8) as *const u64)}; - replacement in "sanakirja-core/src/btree/page/rebalance.rs" at line 53
if let Put::Ok(Ok { page, freed }) = <Page<K, V>>::put(txn, page.0, true, false, &lc, m.mid.0, m.mid.1, None, 0, rl,)? {if let Put::Ok(Ok { page, freed }) =<Page<K, V>>::put(txn, page.0, true, false, &lc, m.mid.0, m.mid.1, None, 0, rl)?{ - replacement in "sanakirja-core/src/btree/page/rebalance.rs" at line 86
if let Put::Ok(Ok { page, freed }) = <Page<K, V>>::put(txn, page.0, true, false, &lc, m.mid.0, m.mid.1, None, 0, rl,)? {if let Put::Ok(Ok { page, freed }) =<Page<K, V>>::put(txn, page.0, true, false, &lc, m.mid.0, m.mid.1, None, 0, rl)?{ - replacement in "sanakirja-core/src/btree/page/rebalance.rs" at line 105
txn, m.modified.page, m.modified.mutable, false, &lc, m.mid.0, m.mid.1, None, 0, rl,txn,m.modified.page,m.modified.mutable,false,&lc,m.mid.0,m.mid.1,None,0,rl, - replacement in "sanakirja-core/src/btree/mod.rs" at line 184[9.1408]→[9.1408:1459](∅→∅),[9.1459]→[9.108:138](∅→∅),[9.138]→[9.1485:1533](∅→∅),[9.1485]→[9.1485:1533](∅→∅),[9.1533]→[5.2473:2480](∅→∅)
unsafe fn put_mut(page: &mut MutPage,c: &mut Self::Cursor,k0: &K,v0: &V,r: u64,);unsafe fn put_mut(page: &mut MutPage, c: &mut Self::Cursor, k0: &K, v0: &V, r: u64); - replacement in "sanakirja-core/src/btree/mod.rs" at line 187
unsafe fn set_left_child(page: &mut MutPage,c: &Self::Cursor,l: u64);unsafe fn set_left_child(page: &mut MutPage, c: &Self::Cursor, l: u64); - edit in "sanakirja-core/src/btree/mod.rs" at line 189
- replacement in "sanakirja-core/src/btree/del.rs" at line 195
last_op = handle_merge(txn, cursor, p0, &k0v0, incr_page, incr_mid, mil, merge, &mut free)?;last_op = handle_merge(txn, cursor, p0, &k0v0, incr_page, incr_mid, mil, merge, &mut free,)?; - replacement in "sanakirja-core/src/btree/del.rs" at line 383
mod_is_left: bool, // The modified page in the `merge` is the left one.mod_is_left: bool, // The modified page in the `merge` is the left one. - replacement in "sanakirja-core/src/btree/del.rs" at line 411
Op::Merged {.. } | Op::Rebalanced { .. } => {Op::Merged { .. } | Op::Rebalanced { .. } => { - replacement in "sanakirja-core/src/btree/del.rs" at line 459
Op::Rebalanced {k,v,l,r,freed,} => {Op::Rebalanced { k, v, l, r, freed } => { - replacement in "sanakirja-core/src/btree/cursor.rs" at line 205
pub fn set_last<'a, T: LoadPage>(&mut self,txn: &'a T,) -> Result<(), T::Error> {pub fn set_last<'a, T: LoadPage>(&mut self, txn: &'a T) -> Result<(), T::Error> { - replacement in "sanakirja-core/src/btree/cursor.rs" at line 238
return Ok(None)return Ok(None); - replacement in "sanakirja-core/src/btree/cursor.rs" at line 271
let (cur_entry, r) = if let Some((k, v, r)) = P::current(txn, current.page.as_page(), ¤t.cursor) {let (cur_entry, r) = if let Some((k, v, r)) =P::current(txn, current.page.as_page(), ¤t.cursor){ - replacement in "sanakirja-core/src/btree/cursor.rs" at line 276
(None, P::right_child(current.page.as_page(), ¤t.cursor))(None,P::right_child(current.page.as_page(), ¤t.cursor),) - edit in "sanakirja/src/tests.rs" at line 48
- edit in "sanakirja/src/tests.rs" at line 159
- edit in "sanakirja/src/tests.rs" at line 229
- replacement in "sanakirja/src/tests.rs" at line 242
let mut db = create_db_::<MutTxn<&Env, ()>, U, V, btree::page_unsized::Page<U, V>>(&mut txn).unwrap();let mut db =create_db_::<MutTxn<&Env, ()>, U, V, btree::page_unsized::Page<U, V>>(&mut txn).unwrap(); - edit in "sanakirja/src/tests.rs" at line 310
- edit in "sanakirja/src/tests.rs" at line 311[9.19606]→[9.19606:19607](∅→∅),[9.2560]→[9.978:979](∅→∅),[9.19607]→[9.978:979](∅→∅),[9.25573]→[9.978:979](∅→∅),[9.978]→[9.978:979](∅→∅)
- replacement in "sanakirja/src/lib.rs" at line 107
pub use environment::{Commit, Env, MutTxn, RootDb, Txn, RootPage};pub use sanakirja_core::{btree, direct_repr, LoadPage, AllocPage, Storable, UnsizedStorable, MutPage, CowPage, Page};pub use environment::{Commit, Env, MutTxn, RootDb, RootPage, Txn};pub use sanakirja_core::{btree, direct_repr, AllocPage, CowPage, LoadPage, MutPage, Page, Storable, UnsizedStorable,}; - replacement in "sanakirja/src/environment/muttxn.rs" at line 52
/// Borrow envpub fn env_borrow(&self) -> &Env {self.env.borrow()}/// Borrow envpub fn env_borrow(&self) -> &Env {self.env.borrow()} - replacement in "sanakirja/src/environment/muttxn.rs" at line 500
debug!("incr rc 0x{:x} {:?}", off, rc+1);debug!("incr rc 0x{:x} {:?}", off, rc + 1); - edit in "sanakirja/src/environment/mod.rs" at line 9
use log::*; - edit in "sanakirja/src/environment/mod.rs" at line 18
use log::*; - replacement in "sanakirja/src/environment/mod.rs" at line 352
info!("find_offset, i = {:?}/{:?}, extending, offset = {:?}, length0 = {:?}", i, mmaps.len(), offset, length0);info!("find_offset, i = {:?}/{:?}, extending, offset = {:?}, length0 = {:?}",i,mmaps.len(),offset,length0); - edit in "sanakirja/src/environment/mod.rs" at line 468
- replacement in "sanakirja/src/environment/mod.rs" at line 469
/// Borrow envpub fn env_borrow(&self) -> &Env {self.env.borrow()}/// Borrow envpub fn env_borrow(&self) -> &Env {self.env.borrow()} - replacement in "sanakirja/src/environment/mod.rs" at line 630
.ptr.add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE + 8 * n)as *mut u64).ptr.add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE + 8 * n) as *mut u64) - replacement in "sanakirja/src/debug.rs" at line 205
pub fn add_refs<T: LoadPage, K: Storable + Ord + ?Sized + std::fmt::Debug, V: Storable + Ord + ?Sized + std::fmt::Debug, P: BTreePage<K, V>>(pub fn add_refs<T: LoadPage,K: Storable + Ord + ?Sized + std::fmt::Debug,V: Storable + Ord + ?Sized + std::fmt::Debug,P: BTreePage<K, V>,>( - replacement in "sanakirja/src/debug.rs" at line 216
T::Error: std::fmt::DebugT::Error: std::fmt::Debug, - replacement in "sanakirja/src/debug.rs" at line 238
panic!("{:?} {:?} {:?} {:?} {:?}", kv, k_, v_, k_>k, v_>v);panic!("{:?} {:?} {:?} {:?} {:?}", kv, k_, v_, k_ > k, v_ > v); - replacement in "sanakirja/src/debug.rs" at line 293
pub fn check_refs<B: std::borrow::Borrow<crate::Env>, T>(txn: &crate::MutTxn<B, T>, refs: &std::collections::BTreeMap<u64, usize>) {pub fn check_refs<B: std::borrow::Borrow<crate::Env>, T>(txn: &crate::MutTxn<B, T>,refs: &std::collections::BTreeMap<u64, usize>,) {