pijul nest
guest [sign in]

Fixing corruption issues

[?]
Apr 20, 2021, 10:03 AM
3MCRJULOVO35LWV32HECCGSJNRLHWWMNISXXWWHNKGMDYANWHSPQC

Dependencies

  • [2] 7T2CCH3P Fixing a segfault (wrong offset in page_unsized::del)
  • [3] 52X5P7ND Cleaning up the unsized part
  • [4] H3FVSQIQ Unsized pages

Change contents

  • edit in sanakirja-core/src/btree/page_unsized.rs at line 671
    [3.19483]
    [3.19483]
    let mut rr = m.r;
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 674
    [3.19558][2.86:136]()
    L::alloc_write(new, k, v, 0, m.l, n);
    [3.19558]
    [2.136]
    L::alloc_write(new, k, v, l, m.l, n);
  • edit in sanakirja-core/src/btree/page_unsized.rs at line 676
    [2.188]
    [3.19664]
    } else if m.l > 0 {
    L::alloc_write(new, k, v, m.l, m.r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 679
    [3.19681][3.18547:18599]()
    L::alloc_write(new, k, v, m.l, m.r, n);
    [3.19681]
    [3.19735]
    L::alloc_write(new, k, v, l, m.r, n);
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 681
    [3.19745][3.19745:19758]()
    } else {
    [3.19745]
    [3.19758]
    l = 0;
    rr = 0;
    } else if m.l > 0 {
  • edit in sanakirja-core/src/btree/page_unsized.rs at line 690
    [3.18690]
    [3.18690]
    // Here's a confusing thing: if the first element of `c1` is the
    // last element of a page, we may be updating its right child (in
    // which case m.r > 0) rather than its left child like for all
    // other elements.
    //
    // This case only ever happens for this function when we're
    // updating the last child of a page p, and then merging p with
    // its right neighbour.
  • replacement in sanakirja-core/src/btree/page_unsized.rs at line 699
    [3.18764][3.18764:18808]()
    L::alloc_write(new, k, v, l, r, n);
    [3.18764]
    [3.20035]
    if rr > 0 {
    L::alloc_write(new, k, v, l, rr, n);
    rr = 0;
    } else {
    L::alloc_write(new, k, v, l, r, n);
    }