Commit graph

651 commits

Author SHA1 Message Date
PThorpe92
eecf6ae6e6 Wait till we write the page to increment current page in wal checkpoint 2025-06-13 11:11:30 +03:00
PThorpe92
9f966910bc Add manual wal sync before checkpoint in connection Drop 2025-06-13 11:11:30 +03:00
pedrocarlo
8dbf09bb42 betters instrumentation for btree operations 2025-06-11 23:34:32 -03:00
Jussi Saurio
ace1e02fc0 Remove leftover info trace 2025-06-10 16:51:34 +03:00
Jussi Saurio
f8df870fb7 Fix implementation of InteriorNodeReplacement(interior index cell being deleted)
Some checks failed
Run long fuzz tests on Btree / run-long-tests (push) Has been cancelled
Run long fuzz tests on Btree / simple-stress-test (push) Has been cancelled
2025-06-10 14:16:26 +03:00
Jussi Saurio
6d2ca58235 get_prev_record() small fixes 2025-06-10 14:16:26 +03:00
Jussi Saurio
9caa8334be add FIXME about balance after interior node replacement 2025-06-10 14:16:26 +03:00
Jussi Saurio
10caca25c9 advance in balance_non_root() if -1 idx 2025-06-10 14:16:26 +03:00
Jussi Saurio
d827eeade0 For now always calculate post-balance seek key 2025-06-10 14:16:26 +03:00
Jussi Saurio
58172641fd Use SeekOP:LT after post-deletebalancing to end up pointing to the left of the deleted row 2025-06-10 14:16:26 +03:00
Jussi Saurio
e1bc268a65 fix CREATE TABLE hang 2025-06-10 14:16:26 +03:00
Jussi Saurio
a5aeff9a3d Fix index insert accidentally double-inserting after balance 2025-06-10 14:16:26 +03:00
Jussi Saurio
04e89c0c4a actually fix drop table 2025-06-10 14:16:26 +03:00
Jussi Saurio
843eb18daf simplify cursor.exists() by using seek() 2025-06-10 14:16:26 +03:00
Jussi Saurio
844461d20b update and delete fixes 2025-06-10 14:16:26 +03:00
Jussi Saurio
d81f5f67bd insert spaghetti fixes 2025-06-10 14:16:26 +03:00
Jussi Saurio
499296d396 fix drop table again: only stack.advance() in a single place 2025-06-10 14:16:26 +03:00
Jussi Saurio
5c08d259bf Fix drop table: initialize loaded pages to cell idx 0 2025-06-10 14:16:26 +03:00
Jussi Saurio
e897052650 flatten process_overflow_read() to get rid of borrowmuterror possibility 2025-06-10 14:16:26 +03:00
Jussi Saurio
5f60cce3c7 fix seek_to_last() 2025-06-10 14:16:26 +03:00
Jussi Saurio
0ce18a9146 Fix comment 2025-06-10 14:16:26 +03:00
Jussi Saurio
0b7f5a2a13 Merge MoveTo&Seek states, remove unnecessary seekstate methods, add eq_seen flag to prevent unnecessary next()/prev() 2025-06-10 14:16:26 +03:00
Jussi Saurio
2bac140d73 Remove SeekOp::EQ and encode eq_only in LE&GE - needed for iteration direction aware equality seeks 2025-06-10 14:16:26 +03:00
Jussi Saurio
ae6a943e43 Leave parent pointing at rightmost pointer at the end of balance_root() 2025-06-10 14:16:26 +03:00
Jussi Saurio
cba84b7ce9 Remove premature cast to usize (cell_idx can be negative) 2025-06-10 14:16:26 +03:00
Jussi Saurio
8ad6aadbbd remove unnecessary SeekingIndexMoveUp state 2025-06-10 14:16:26 +03:00
Jussi Saurio
a3ffc6f4e2 Align prev() implementation with next() 2025-06-10 14:16:26 +03:00
Jussi Saurio
58e1a2f5bc Remove unnecessary self.prev() from last() 2025-06-10 14:16:26 +03:00
Jussi Saurio
8941c4a537 fmt 2025-06-10 14:16:26 +03:00
Jussi Saurio
6e5f05a257 Remove unnecessary cell_idx move from tablebtree_move_to() 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
0f79b0dd50 fix prev? 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
f83d837131 fix next to not advance if not necessary 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
f261d5b6af compare on next/prev after seek 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
681df9b1eb fix get record 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
b46852a366 move setting target key in delete if balance is needed 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
c52d9a52d9 fix count 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
96324834a5 invalidate records on movement 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
77b6896eae implement lazy record and rowid in cursor
This also comments save_context for now
2025-06-10 14:16:26 +03:00
Pere Diaz Bou
b0c64cb4d2 parse record lazily 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
105de7e1d8 seek, next and prev return bool 2025-06-10 14:16:26 +03:00
Pere Diaz Bou
cb4efdbc19 Merge 'LimboRwLock write and read lock fixes' from Pere Diaz Bou
Some checks are pending
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@18 (push) Blocked by required conditions
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@18 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / check-requirements (push) Waiting to run
Python / lint (push) Waiting to run
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
* `write` was returning `true` even though it shouldn't because it
should return `false` in case it was already acquired.
* `read` theoritically can increase `nread` after another thread calls
`unlock` between first lock load and increase of `nread`. So it looks
something like this:
                  1. THREAD  1: read()
                  2. THREAD 2: get lock = `SHARED_LOCK`
                  3. THREAD 1: unlock -> lock is now `NO_LOCK`
                  4. THREAD 2: increase nread, return true.
    This is obviously wrong because `nreads` will be ` > 0 ` but `lock`
is `NO_LOCK`

Closes #1676
2025-06-09 16:15:46 +02:00
Zaid Humayun
e994adfb40 Persisting database header and pointer map page to cache
This commit ensures that the metadata in the database header and the pointer map pages allocated are correctly persisted to the page cache. This was not being done earlier.
2025-06-06 23:14:25 +05:30
Zaid Humayun
e7d09edf09 fix clippy warnings 2025-06-06 23:14:25 +05:30
Zaid Humayun
1f5025541c addresses comment https://github.com/tursodatabase/limbo/pull/1600#discussion_r2115796655 by @jussisaurio
this commit ensures that ptrmap operations return a CursorResult so operation can be suspended & later retried
2025-06-06 23:14:25 +05:30
Zaid Humayun
8efbce5980 Fixes tests after asserting MIN_PAGE_SIZE
this commit fixes tests that broke after addding the MIN_PAGE_SIZE assertion
2025-06-06 23:14:25 +05:30
Zaid Humayun
6e87761a34 Addresses comment https://github.com/tursodatabase/limbo/pull/1600#discussion_r2115842804 by @jussisaurio
this commit adds an assert into ptrmap_page_cycle_length
2025-06-06 23:14:25 +05:30
Zaid Humayun
20e20b8a32 Larger compiler directive. Addresses https://github.com/tursodatabase/limbo/pull/1600#discussion_r2115820195
this commit places all pointer map functionality within a module called ptrmap guarded by a compiler directive
2025-06-06 23:14:25 +05:30
Zaid Humayun
33fc60232c removed unnecessary comment 2025-06-06 23:14:25 +05:30
Zaid Humayun
8e6fb1d28f addresses comments by @jussisaurio 2025-06-06 23:14:25 +05:30
Zaid Humayun
0b5338ec7e fixed off by one error 2025-06-06 23:14:25 +05:30