Repository navigation
fix: continue FlashDB recovery scanning after unfinished writes - #437
Closed
brightness-810 wants to merge 1 commit into
Closed
brightness-810 wants to merge 1 commit into
brightness-810 wants to merge 1 commit into
Conversation
9 of 17 tasks
Owner
|
我按照 #438 方式合入了,这个先关闭了哈 |
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 this changes
Fix an early exit in KVDB initialization recovery.
When
check_and_recovery_kv_cb()encounters aPRE_WRITErecord, it marksthe record as
ERR_HDR. Previously, returningtruethen stopped the entireKV traversal, rather than skipping only the unfinished record.
A valid
PRE_DELETEold copy may appear later in traversal order. If no GCrequest is pending, initialization does not retry the scan, so that old copy
can remain unrecovered and the corresponding key may be unavailable.
This change continues scanning after handling the unfinished record, allowing
later records to be processed by the existing recovery logic.
The change does not introduce a new recovery policy, restore
DELETEDrecords, or modify GC behavior.
Related issue
Closes #436
Test closure
tests/fdb_kvdb_tc.cortests/fdb_tsdb_tc.cUTEST_UNIT_RUN(...)list oftestcase()Write granularity covered
FDB_WRITE_GRAN= 1 / 8 / 32 / 64 / 128 / 256Data layout and compatibility
inc/flashdb.hchanged, compatibility impact:docs/plusdocs/zh-cn/are updatedPower-loss semantics
fdb_xxx_deinit->fdb_xxx_initreboot simulation