DynamicCollection cannot write a document larger than one page: no overflow on the schema-less write path
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reading DynamicCollection and the existing overflow writer in DocumentCollection.InsertWithOverflow / AllocateOverflowPage, then review OverflowChainReader and DeleteSlot for the layout they already support. Add coverage to the DynamicCollection oracle for documents larger than one page, and run the migration round trip for a typed database containing a 40 KB document in both layouts. Done means schema-less writes, reads, deletes, and both migration layouts handle the large document.
Written by the indexing model from the issue text.
Description
DynamicCollection rejects a document larger than MaxDocumentSize (one page minus header, slot and reserve; about 16 KB with the default page size) with BLiteValidationException. A typed DocumentCollection stores such a document across overflow pages (InsertWithOverflow), and since #319 the schema-less API reads those. It still cannot write them, so:
BLiteMigration.ToMultiFileAsync/ToSingleFileAsyncrefuse a database whose typed collections hold a large document (#319 makes the refusal name the collection and_id; before, the BSON reader threw).- The LiteDB import of #297 writes to
DynamicCollection; LiteDB documents can be far larger than a page. - A server or scripting client of the schema-less API has a size limit the typed API does not have.
Suggested change
Give DynamicCollection the same overflow write path as DocumentCollection: insert and relocating update write [TotalLength][FirstOverflowPage][first chunk] into the slot with SlotFlags.HasOverflow and the rest into PageType.Overflow pages; the read side (OverflowChainReader, #319) and the delete side (DeleteSlot frees the chain, #319) already handle that layout. Candidates for sharing: move DocumentCollection.InsertWithOverflow / AllocateOverflowPage next to OverflowChainReader so both collections use one writer. Then BLiteMigration can drop its size check and MaxDocumentSize becomes the size of a single document BLite stores (today int.MaxValue-ish, bounded by the page count).
Tests: the DynamicCollection oracle (#272) with document sizes past one page; migration round trip of a typed database with a 40 KB document, both layouts.
Related: #301 (read side, fixed by #319), #297, #272.
- Dominant language
- C#
- Stars
- 66
- Forks
- 6
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EntglDb/BLite
-
GdprMode.Strict warns that deleted documents are not zeroed, but every delete zero-fills themPossibly taken @CaffeinatedCoder claimed this 2 days ago. Openbug gdpr package/core severity/low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EntglDb/BLite#299 · 1 comment ·
Maintainers usually reply within 2 days
-
bug package/core severity/medium triage
Difficulty 4/5 3-5 days Newbie friendliness 54/100
Maintainers usually reply within 2 days
-
bug package/core severity/medium
Difficulty 4/5 3-5 days Newbie friendliness 48/100
EntglDb/BLite#322 · 1 comment ·
Maintainers usually reply within 2 days
-
BLiteSession.Rollback() does not await the rollback: it returns while the transaction is still active, and failures go unobservedPossibly taken @CaffeinatedCoder claimed this 2 days ago. Openbug package/core severity/medium
Difficulty 3/5 1-2 days Newbie friendliness 78/100
EntglDb/BLite#307 · 1 comment ·
Maintainers usually reply within 2 days
-
area/indexing bug package/core severity/medium
Difficulty 4/5 3-5 days Newbie friendliness 55/100
EntglDb/BLite#305 · 1 comment ·
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
gavin-wolfe/wolfden#104 ·
Maintainers usually reply within 1 day
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt fileOpentype/bug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[辞書] かんそうりつ->乾燥率Open辞書
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
thomhurst/TUnit#7201 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ArduPilot/MissionPlanner#3826 ·
Maintainers usually reply within 1 day