Repository navigation
fix(gdpr): Strict mode no longer claims deleted documents are not zeroed (#299) - #318
Open
CaffeinatedCoder wants to merge 2 commits into
Open
CaffeinatedCoder wants to merge 2 commits into
CaffeinatedCoder wants to merge 2 commits into
Conversation
…oed (EntglDb#299) Event 9006 said "Deleted document slots are not currently zeroed at the page layer" and pointed at MISSING_FEATURES.md §3. Both delete paths have zero-filled the deleted bytes since EntglDb#96, and freed overflow pages are rewritten zeroed. The one true caveat is timing: the zeroed page reaches the database file at the next checkpoint. The event now says that, and asks for CheckpointAsync() after deleting personal data. docs/DPIA_CHECKLIST.md says the same instead of "call VacuumAsync after deletion" (vacuum remains a maintenance step). GdprStrictSecureEraseUnavailable is renamed GdprStrictSecureEraseCheckpointHint; the id 9006 is unchanged. Tests: the Strict-mode test asserts the new wording and the absence of the old claims; a new test deletes a document, checkpoints, and finds no byte of it in the .db or .wal file. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closed
5 of 72 tasks
mrdevrobot
requested changes
Oct 18, 2026
mrdevrobot
left a comment
Contributor
There was a problem hiding this comment.
Changes requested. Verified that deletes zero-fill and that the new 9006 text is accurate. docs/DPIA_CHECKLIST.md says a DocumentDbContext checkpoints on dispose; only DisposeAsync() does, Dispose() does not (DocumentDbContext.cs ~590–627). Please say DisposeAsync there.
Collaborator
Author
|
Done in 0e875ff: docs/DPIA_CHECKLIST.md now says a |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Opening a database with
GdprMode.Stricttraced event 9006: "SecureEraseOnDelete is not yet available as an engine-level setting. Deleted document slots are not currently zeroed at the page layer. Track MISSING_FEATURES.md §3 for the planned implementation." (#299). The second sentence has been untrue since #96:DocumentCollection.DeleteCoreandSlottedPageUtils.CompactAndErasezero-fill the bytes a deleted document occupied, andPageFile.FreePagerewrites a freed overflow page zeroed.docs/DPIA_CHECKLIST.mdgave a third answer ("callVacuumAsyncafter deletion"). A GDPR review reading them concludes that erasure needs extra work.The one true caveat is timing: a delete writes the zeroed page through the WAL, and the database file receives it at the next checkpoint. Until then the
.dbfile can still hold the deleted bytes (aDocumentDbContextcheckpoints on dispose; aBLiteEnginedoes not).Fix
CheckpointAsync()after deleting personal data, andVacuumAsync(SecureErase = true)additionally zero-fills the free space of every page. The constant is renamedGdprStrictSecureEraseCheckpointHint(internal; the id 9006 and theTraceWarninglevel are unchanged, so existing listeners see the same event). The pointer toMISSING_FEATURES.mdis gone.GdprMode.StrictXML doc: same correction.docs/DPIA_CHECKLIST.md: the residual-data row, the two checklist items and the Art. 17 row say delete + checkpoint, with vacuum as a maintenance step, and that zero-filling covers the database file only (not the OS page cache, SSD wear-levelling or swap, which the encryption Strict mode requires covers).The README section is corrected in #298 (
README.md:338-351there); this PR does not touch the README to avoid a conflict.Tests
GdprStrictTests:GdprStrict_SecureErase_EmitsCheckpointHint_NotAnUnavailableWarningreplaces the old test: exactly one 9006 event, it namesCheckpointAsyncand "zero-filled", and contains none of "not currently zeroed", "not yet available", "MISSING_FEATURES". Fails onupstream/mainon the wording.Delete_ThenCheckpoint_LeavesNoBytesOfTheDocumentInTheFiles(new): inserts a document carrying a marker string into a plaintextBLiteEngine, checkpoints and confirms the marker is in the.dbfile; reopens, deletes, checkpoints; the marker occurs zero times in the.dband the.walfile. This is the behaviour the event describes, and the GDPR row of the oracle plan in Epic: reliability before features — durability, AOT, query correctness and oracle coverage #288.Full suite
dotnet test tests/BLite.Tests(macOS, net10.0): 3090 passed, 4 skipped, 3 failed, allTimeoutExceptionon a lock (BTreeSplitTests×2,IndexPageReleaseTests×1) while a second suite ran on the same machine; the #303 class of failure, see #302. All 35 tests of those two classes pass when rerun on their own.Fixes #299
🤖 Generated with Claude Code