pijul nest
guest [sign in]

run cargo fmt

[?]
9FZSPF6U3oQmpTwxvCnadrHKQEqTkEpnrDg1UWw9Zo9E
Oct 25, 2021, 10:17 PM
YATBB4O7MHKUVYI2JKIYPHLFJIAPK7UPJWAXHR26VVJPIYAOK66AC

Dependencies

  • [2] GGEFV4YY Some page splits were not properly handled in deletions
  • [3] ECPAFJSB add env_borrow for Txn and MutTxn
  • [4] YDHYZA77 Adding the RootPage trait to access the raw bytes of a root page (needed in libpijul)
  • [5] HCDD6FX7 Fixing some comments and reformatting
  • [6] 26KI6CQS Updating 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] HJ6VZ7HF Fixing a wrong CRC computation
  • [8] BYI23QWI More tests
  • [9] YWFYZNLZ Cleanup + inter-process concurrency
  • [10] M6PHQUGL fallocate only when necessary
  • [11] OFINGD26 implementing prev() on cursors (+ some cleanup)
  • [12] W2MIZD5B Single file databases + CRC for the root pages (checking the other pages makes everything very slow)
  • [13] WTXLZDYI Fixing bus errors on a full disk
  • [14] ONES3V46 reference counting works for put
  • [15] XEU2QVLC Debugging after plugging this into Pijul
  • [16] 6BG65Y2P Cursor::set_last was panicking on empty pages
  • [17] QEUTVAZ4 Splitting btree::page
  • [18] E4MD6T3L Proofreading and commenting of this crate (massive bug fixes included)
  • [19] OTWDDJE7 Trait/type cleanup
  • [20] DASFQGOR Debugging
  • [21] WS4ZQM4R Debugging, tests, etc.
  • [22] G4JEQLLX Debugging synchronisation
  • [23] MORZOA7E Adding a check to avoid incrementing the RC of page 0
  • [24] FZBLNBGN Diagnostic tools (add_refs, check_free) + cleanup
  • [25] SO25TWFL A few features for integrating it into Pijul
  • [26] TSMS6W4D Fully commented implementation of Sized nodes + massive cleanup
  • [27] L5CVF6UJ Debugging
  • [28] OP6SVMOD Resetting history
  • [29] PPI5ZTZP Rebalance: put can free pages without splitting (compaction)
  • [30] H3FVSQIQ Unsized pages
  • [31] 5LSYTRQ6 More docs, example, and fixing the free page diagnostic function for mutable transactions
  • [32] UAQX27N4 Tests
  • [33] HN6Z5DU4 Cleanup
  • [34] KX3WVNZW Testing/debugging "rebalance causes split of the root"
  • [35] 73Z2UB3J Cleanup + comments
  • [36] YXKP4AIW New file locks, with multiple sets of free pages
  • [37] 6UVFCERM Formatting, debugging, etc.
  • [38] APPY2E7M Unsized deletions + custom sizes back
  • [39] Q7DRIBBR Debugging replace (which cannot be del+put)
  • [40] LSQ6V7M6 Cleanup + docs
  • [41] 52X5P7ND Cleaning up the unsized part
  • [42] T73WR2BX Cleaner RC increments for keys and values containing references + more comments in `del`
  • [43] SYURNHHL Adding the `put_mut` and `set_left_child` methods
  • [44] PUOGOIJ3 Debugging, impls and version bump
  • [45] 5JOD7M26 Modifying cursor lengths when appending
  • [*] T7QB6QEP Adding 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,
    ));
    [7.192]
    [9.116]
    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
    [9.4811][9.1103:1206]()
    let off = unsafe { *(page.data.as_ptr().offset(HDR as isize + c.cur * 8) as *const u64) };
    [9.4811]
    [9.4911]
    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
    [9.4585][9.0:51](),[9.51][9.0:30](),[9.30][9.77:133](),[9.77][9.77:133]()
    unsafe fn put_mut(
    page: &mut MutPage,
    c: &mut Self::Cursor,
    k0: &K,
    v0: &V,
    r: u64,
    ) {
    [9.4585]
    [9.133]
    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
    [9.336][9.336:443]()
    unsafe fn set_left_child(
    page: &mut MutPage,
    c: &Self::Cursor,
    l: u64
    ) {
    [9.336]
    [9.443]
    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
    [9.18046][9.0:128]()
    fn modify<T: LoadPage, K: core::fmt::Debug + ?Sized, V: core::fmt::Debug + ?Sized, P: BTreeMutPage<K, V>, L: AllocWrite<K, V>>(
    [9.18046]
    [9.19129]
    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
    [9.8675][9.4966:4988](),[9.4966][9.4966:4988](),[9.4988][5.910:1013]()
    let off =
    unsafe { *(page.data.as_ptr().offset((HDR as isize + c.cur * 8) - 8) as *const u64) };
    [9.8675]
    [9.5088]
    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
    [9.5130][9.5130:5281]()
    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,
    )? {
    [9.5130]
    [9.270]
    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
    [9.5664][9.5664:5815]()
    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,
    )? {
    [9.5664]
    [9.592]
    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
    [9.6090][9.6090:6187]()
    txn, m.modified.page, m.modified.mutable, false, &lc, m.mid.0, m.mid.1, None, 0, rl,
    [9.6090]
    [9.6187]
    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,
    );
    [9.1408]
    [9.1572]
    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
    [9.1604][9.1604:1703](),[9.1703][5.2481:2488]()
    unsafe fn set_left_child(
    page: &mut MutPage,
    c: &Self::Cursor,
    l: u64
    );
    [9.1604]
    [9.1742]
    unsafe fn set_left_child(page: &mut MutPage, c: &Self::Cursor, l: u64);
  • edit in "sanakirja-core/src/btree/mod.rs" at line 189
    [9.1743][9.1743:1744]()
  • replacement in "sanakirja-core/src/btree/del.rs" at line 195
    [9.15103][9.7132:7233]()
    last_op = handle_merge(txn, cursor, p0, &k0v0, incr_page, incr_mid, mil, merge, &mut free)?;
    [9.15103]
    [9.8567]
    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
    [2.360][2.360:439]()
    mod_is_left: bool, // The modified page in the `merge` is the left one.
    [2.360]
    [2.439]
    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
    [9.7600][9.7600:7654]()
    Op::Merged {.. } | Op::Rebalanced { .. } => {
    [9.7600]
    [9.7654]
    Op::Merged { .. } | Op::Rebalanced { .. } => {
  • replacement in "sanakirja-core/src/btree/del.rs" at line 459
    [9.35183][9.4764:4868](),[9.4892][9.4892:4907]()
    Op::Rebalanced {
    k,
    v,
    l,
    r,
    freed,
    } => {
    [9.35183]
    [9.35233]
    Op::Rebalanced { k, v, l, r, freed } => {
  • replacement in "sanakirja-core/src/btree/cursor.rs" at line 205
    [9.40742][9.11211:11288](),[9.67642][9.11211:11288](),[9.11288][9.9302:9334]()
    pub fn set_last<'a, T: LoadPage>(
    &mut self,
    txn: &'a T,
    ) -> Result<(), T::Error> {
    [9.40742]
    [9.19537]
    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
    [9.10133][9.10133:10165]()
    return Ok(None)
    [9.10133]
    [9.10165]
    return Ok(None);
  • replacement in "sanakirja-core/src/btree/cursor.rs" at line 271
    [6.409][6.409:530]()
    let (cur_entry, r) = if let Some((k, v, r)) = P::current(txn, current.page.as_page(), &current.cursor) {
    [6.409]
    [6.530]
    let (cur_entry, r) = if let Some((k, v, r)) =
    P::current(txn, current.page.as_page(), &current.cursor)
    {
  • replacement in "sanakirja-core/src/btree/cursor.rs" at line 276
    [6.593][6.593:677]()
    (None, P::right_child(current.page.as_page(), &current.cursor))
    [6.593]
    [6.677]
    (
    None,
    P::right_child(current.page.as_page(), &current.cursor),
    )
  • edit in "sanakirja/src/tests.rs" at line 48
    [9.10882][9.10882:10883]()
  • edit in "sanakirja/src/tests.rs" at line 159
    [9.14645][9.14645:14647]()
  • edit in "sanakirja/src/tests.rs" at line 229
    [9.17101][9.17101:17102]()
  • replacement in "sanakirja/src/tests.rs" at line 242
    [9.17355][9.17355:17462]()
    let mut db = create_db_::<MutTxn<&Env, ()>, U, V, btree::page_unsized::Page<U, V>>(&mut txn).unwrap();
    [9.17355]
    [9.17462]
    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
    [9.2560][9.19602:19605]()
  • 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
    [9.2997][4.0:67](),[4.67][9.2260:2378](),[9.6634][9.2260:2378]()
    pub use environment::{Commit, Env, MutTxn, RootDb, Txn, RootPage};
    pub use sanakirja_core::{btree, direct_repr, LoadPage, AllocPage, Storable, UnsizedStorable, MutPage, CowPage, Page};
    [9.2997]
    [9.312]
    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
    [3.39][3.39:119]()
    /// Borrow env
    pub fn env_borrow(&self) -> &Env {
    self.env.borrow()
    }
    [3.39]
    [3.119]
    /// Borrow env
    pub fn env_borrow(&self) -> &Env {
    self.env.borrow()
    }
  • replacement in "sanakirja/src/environment/muttxn.rs" at line 500
    [9.89127][9.2424:2478]()
    debug!("incr rc 0x{:x} {:?}", off, rc+1);
    [9.89127]
    [9.19176]
    debug!("incr rc 0x{:x} {:?}", off, rc + 1);
  • edit in "sanakirja/src/environment/mod.rs" at line 9
    [9.1301]
    [9.1301]
    use log::*;
  • edit in "sanakirja/src/environment/mod.rs" at line 18
    [9.1533][9.20092:20104]()
    use log::*;
  • replacement in "sanakirja/src/environment/mod.rs" at line 352
    [9.104214][9.20241:20369]()
    info!("find_offset, i = {:?}/{:?}, extending, offset = {:?}, length0 = {:?}", i, mmaps.len(), offset, length0);
    [9.104214]
    [9.246]
    info!(
    "find_offset, i = {:?}/{:?}, extending, offset = {:?}, length0 = {:?}",
    i,
    mmaps.len(),
    offset,
    length0
    );
  • edit in "sanakirja/src/environment/mod.rs" at line 468
    [3.126][3.126:127]()
  • replacement in "sanakirja/src/environment/mod.rs" at line 469
    [3.157][3.157:237]()
    /// Borrow env
    pub fn env_borrow(&self) -> &Env {
    self.env.borrow()
    }
    [3.157]
    [9.105581]
    /// Borrow env
    pub fn env_borrow(&self) -> &Env {
    self.env.borrow()
    }
  • replacement in "sanakirja/src/environment/mod.rs" at line 630
    [9.2848][9.2848:2965]()
    .ptr
    .add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE + 8 * n)
    as *mut u64)
    [9.2848]
    [9.18025]
    .ptr
    .add(self.root * PAGE_SIZE + GLOBAL_HEADER_SIZE + 8 * n) as *mut u64)
  • replacement in "sanakirja/src/debug.rs" at line 205
    [9.4354][9.85:227]()
    pub fn add_refs<T: LoadPage, K: Storable + Ord + ?Sized + std::fmt::Debug, V: Storable + Ord + ?Sized + std::fmt::Debug, P: BTreePage<K, V>>(
    [9.4354]
    [9.4448]
    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
    [9.260][9.260:290]()
    T::Error: std::fmt::Debug
    [9.260]
    [9.290]
    T::Error: std::fmt::Debug,
  • replacement in "sanakirja/src/debug.rs" at line 238
    [9.731][9.731:819]()
    panic!("{:?} {:?} {:?} {:?} {:?}", kv, k_, v_, k_>k, v_>v);
    [9.731]
    [9.819]
    panic!("{:?} {:?} {:?} {:?} {:?}", kv, k_, v_, k_ > k, v_ > v);
  • replacement in "sanakirja/src/debug.rs" at line 293
    [8.6263][8.6263:6396]()
    pub fn check_refs<B: std::borrow::Borrow<crate::Env>, T>(txn: &crate::MutTxn<B, T>, refs: &std::collections::BTreeMap<u64, usize>) {
    [8.6263]
    [8.6396]
    pub fn check_refs<B: std::borrow::Borrow<crate::Env>, T>(
    txn: &crate::MutTxn<B, T>,
    refs: &std::collections::BTreeMap<u64, usize>,
    ) {