[PR #186] [MERGED] Fix broken B+Trees #156

Closed
opened 2026-05-23 08:32:08 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/appy-one/acebase/pull/186
Author: @appy-one
Created: 12/5/2022
Status: Merged
Merged: 12/5/2022
Merged by: @appy-one

Base: masterHead: fix/broken-b+trees


📝 Commits (10+)

📊 Changes

8 files changed (+402 additions, -171 deletions)

View changed files

📝 src/acebase-local.ts (+34 -25)
📝 src/api-local.ts (+4 -0)
📝 src/btree/binary-tree-builder.ts (+0 -8)
📝 src/btree/binary-tree-leaf.ts (+1 -1)
📝 src/btree/binary-tree.spec.ts (+4 -4)
📝 src/btree/binary-tree.ts (+212 -78)
📝 src/data-index/data-index.ts (+8 -2)
📝 src/storage/binary/index.ts (+139 -53)

📄 Description

Closes #183

Adds a recovery options that repairs damaged nodes that use a B+Tree to store its child keys.

Usage: await db.recovery.repairNodeTree(path) (execute once to fix)

This PR also prevents B+Trees from becoming damaged in the future if it grows, but fails to be rewritten to disk because of a filesystem error.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/appy-one/acebase/pull/186 **Author:** [@appy-one](https://github.com/appy-one) **Created:** 12/5/2022 **Status:** ✅ Merged **Merged:** 12/5/2022 **Merged by:** [@appy-one](https://github.com/appy-one) **Base:** `master` ← **Head:** `fix/broken-b+trees` --- ### 📝 Commits (10+) - [`ecf9e4a`](https://github.com/appy-one/acebase/commit/ecf9e4a3e6b3c919337bc14696531abf44309999) reflect: rethrow `err` if not `NodeNotFoundError` - [`cb40d89`](https://github.com/appy-one/acebase/commit/cb40d89353081dec448d58d1c71d462f803aa7ff) cleanup - [`db85791`](https://github.com/appy-one/acebase/commit/db857917505fe0cc7a6d16b0bb8f3ac65db33c18) add `repairMode` param to `getNext` - [`04c4e3c`](https://github.com/appy-one/acebase/commit/04c4e3c8f9cfeabf7303dffefcae90f1625a9dcd) Repair binary B+Trees: - [`1d1b1ab`](https://github.com/appy-one/acebase/commit/1d1b1ab523a9f9a03759710a2467ff74bec9ead8) simpler sort - [`326d0e0`](https://github.com/appy-one/acebase/commit/326d0e041888f9d8229d5c91ba72c1a1debdabc1) updated debug comments - [`39e6f4e`](https://github.com/appy-one/acebase/commit/39e6f4ee80b98490e3e1df8b9edd82bdd358c7f7) use new BinaryBPlusTree constructor - [`3d06727`](https://github.com/appy-one/acebase/commit/3d067279ac2209ab23578de1533c24b898ff131e) pass DebugLogger - [`d35977e`](https://github.com/appy-one/acebase/commit/d35977e61f562753967a7f9c4b625fed7b12b456) prevent tree allocation issue #183: - [`9f4bc3d`](https://github.com/appy-one/acebase/commit/9f4bc3deb50830677279cf6904e72902485dc76e) cleanup ### 📊 Changes **8 files changed** (+402 additions, -171 deletions) <details> <summary>View changed files</summary> 📝 `src/acebase-local.ts` (+34 -25) 📝 `src/api-local.ts` (+4 -0) 📝 `src/btree/binary-tree-builder.ts` (+0 -8) 📝 `src/btree/binary-tree-leaf.ts` (+1 -1) 📝 `src/btree/binary-tree.spec.ts` (+4 -4) 📝 `src/btree/binary-tree.ts` (+212 -78) 📝 `src/data-index/data-index.ts` (+8 -2) 📝 `src/storage/binary/index.ts` (+139 -53) </details> ### 📄 Description Closes #183 Adds a recovery options that repairs damaged nodes that use a B+Tree to store its child keys. Usage: `await db.recovery.repairNodeTree(path)` (execute once to fix) This PR also prevents B+Trees from becoming damaged in the future if it grows, but fails to be rewritten to disk because of a filesystem error. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-23 08:32:08 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#156
No description provided.