Commit Graph

574 Commits

Author SHA1 Message Date
Zaid Humayun
77815b20d7 docs: added documentation for btree_destroy and clear_overflow_pages 2025-02-19 21:46:26 +05:30
Zaid Humayun
2ff27834ff fix: addresses comment https://github.com/tursodatabase/limbo/pull/897#discussion_r1948154297 by @pereman2
this commit adds the final touches to the state machine for btree_destroy and also introduces a state machine for clear_overflow_pages
this addresses the issue of IO interrupting an operation in progress and solves the following problems:
* performance issues with repeating an operation
* missing page issues with clear overflow pages
2025-02-19 21:46:26 +05:30
Zaid Humayun
f7dc0d42df btree_destroy: implemented functionality with state machine 2025-02-19 21:46:26 +05:30
Zaid Humayun
e0105398a6 btree: modified the btree_destroy subroutine
modified the btree_destroy subroutine to do an iterative DFS and use the stack cell counters to keep track of whether children have been removed. adds a unit test.
2025-02-19 21:46:26 +05:30
Zaid Humayun
97d87955cc DROP TABLE: renamed BTreeCusor::btree_drop to BTreeCursor::btree_destroy
this more closely matches semantics
2025-02-19 21:46:26 +05:30
Zaid Humayun
76e2d98381 drop table: addresses issue https://github.com/tursodatabase/limbo/issues/894 which requires DROP TABLE to be implemented
this is the initial commit is for the implementation of DROP TABLE. It adds support for the DROP TABLE instruction and adds a DropBTree instruction. It also implements the btree_drop method in btree.rs which makes use of free_page method which will be implemented via PR https://github.com/tursodatabase/limbo/pull/785
2025-02-19 21:46:25 +05:30
Pere Diaz Bou
e25272adc0 fix free_cell_space extend content area 2025-02-17 11:50:15 +01:00
Pere Diaz Bou
ddbfada8bd fix wrong usage of insert in fuzz tests 2025-02-17 08:47:55 +01:00
Pere Diaz Bou
4d6843d1cc clippy 2025-02-16 19:27:34 +01:00
Pere Diaz Bou
d276c22a0c clippy 2025-02-16 19:25:41 +01:00
Pere Diaz Bou
a6f5bcbaf4 fix return find_free_cell 2025-02-16 19:21:37 +01:00
Pere Diaz Bou
286cb8c5bc fix some free_cell_range pointer reads 2025-02-16 19:10:15 +01:00
Pere Diaz Bou
aea4560422 bring back corrupt errors 2025-02-16 18:51:09 +01:00
Pere Diaz Bou
1687072d77 remove dbg 2025-02-16 18:31:19 +01:00
Pere Diaz Bou
b64cc769b6 fix rebase 2025-02-16 18:31:03 +01:00
Pere Diaz Bou
b5ec5186ea fix divider cell on leaf data 2025-02-16 18:30:42 +01:00
Pere Diaz Bou
177dbcd403 simplify balance_root 2025-02-16 18:01:33 +01:00
Pere Diaz Bou
f9d979575b fix defragment_page cell payload size calculation 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
d3574f1e55 fix root offfset handling 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
8ba7022e0b remove dbg prints 2025-02-15 16:51:52 +01:00
Pere Diaz Bou
1b96bd8a30 fix free_cell_area offset check 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
7e55f46b26 fix defragment 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
c65dce6cfd re implemenet free cell range 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
4907de6e21 fix rightpoitner load + some stuff 2025-02-15 16:46:22 +01:00
Pere Diaz Bou
5ff66b8c62 fix reset content area in drop_cell 2025-02-15 16:42:26 +01:00
Pere Diaz Bou
78e7364f45 fuzz test 2025-02-15 16:30:59 +01:00
Pere Diaz Bou
ea77902e24 add defragment test after deletion of odd cells
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
2025-02-15 16:30:59 +01:00
Pere Diaz Bou
0274f74f32 fix drop cell and add some tests 2025-02-15 16:30:59 +01:00
Pere Diaz Bou
44857cdd17 fix insert test 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
48f0fe0904 multiple cell insert test 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
c4c5a74e16 add a bit of testing 2025-02-15 16:21:33 +01:00
Pere Diaz Bou
7e3470fb8e fix rebase 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
915bb42412 fix rightmost pointer update 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
0c015e43a2 some fixes 2025-02-15 16:18:04 +01:00
Pere Diaz Bou
05ca716f82 up to finish without fixing stuff 2025-02-15 16:11:29 +01:00
Pere Diaz Bou
0035b9d1bd up to edit 2025-02-15 15:55:42 +01:00
Pere Diaz Bou
1266994a0a balance sibling pages 2025-02-15 15:37:13 +01:00
Doug Anderson444
0aa5de6d9f rm log, switch all to tracing 2025-02-11 09:03:36 -04:00
Pekka Enberg
0638550be7 Merge 'Remove unnecessary reference counting from completion I/O callbacks' from Preston Thorpe
I am on a bit of a mission to revisit a lot of the ref counting, this
was an easy first win.
It seems to be a linear path of function calls or hashmaps which can own
the completions directly, no cloning needed.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #912
2025-02-10 12:11:30 +02:00
Tiago Ribeiro
af12036e88 Update core/storage/btree.rs to use the new retrieval methods to access Record values. 2025-02-10 00:27:51 -07:00
Pekka Enberg
bad5f2cad3 Merge 'Fix a handful of typos' from Aarni Koskela
I noticed the README had a prominent typo ("workin on"), so I decided to
run [crate-ci/typos](https://github.com/crate-ci/typos) on the repo and
fix what it flagged.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #952
2025-02-10 07:41:01 +02:00
Aarni Koskela
eaea02c567 Fix a handful of typos 2025-02-09 18:08:29 +02:00
Nikita Sivukhin
1b9772e9ad fix clippy 2025-02-09 19:36:14 +04:00
Nikita Sivukhin
32b5b0d019 introduce additional condition for cells distribution in order to avoid almost empty pages 2025-02-09 19:26:03 +04:00
Nikita Sivukhin
bc289d314a adjust test a bit 2025-02-09 19:20:48 +04:00
Nikita Sivukhin
e23ea35993 add simple B-tree validation func 2025-02-09 19:20:37 +04:00
Nikita Sivukhin
a59589844d fix insertion to the parent 2025-02-09 19:19:36 +04:00
Nikita Sivukhin
6c40f52fc8 separate fuzz tests in categories 2025-02-09 18:37:04 +04:00
Nikita Sivukhin
9049c91863 find cell in parent node 2025-02-09 18:36:37 +04:00
Nikita Sivukhin
9e4afd1d13 relax assertion 2025-02-09 18:36:26 +04:00