You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improvement: Make it possible to initialize KVS when snapshot with ID=0 is not available #237
@Ahmed-Elsaka-JC, to start with an answer - I think C++ is affected, because it's not about ::Optional or ::Required behavior. The description of this ticket is misleading.
I meant that if snapshot with ID=0 is broken, then KVS is not able to initialize. E.g., hash file got removed, or JSON file is malformed.
Selectable snapshot ID would allow restoring the state using another snapshot - but this would still need a predictable error behavior.
I dislike the automatic loop idea, especially since IIRC snapshot IDs won't be ordered latest to oldest anymore (planned for #292, but stale).
Unit tests for Rust exist, but are marked as #[ignore = "Not handled properly yet"] and probably should get revisited and expanded.
Both KvsLoad::Required and KvsLoad::Optional should halt on broken snapshot.
Regardless if it's a missing file, a malformed one, or an invalid hash.
KvsLoad::Optional should be allowed to proceed only if both files are missing.
Error handling could be simplified:
Merge KvsFileReadError, KvsHashFileReadError and FileNotFound to FileReadError, change description to "File not found or couldn't be read".
Merge IntegrityCorrupted and ValidationFailed to IntegrityCorrupted.
I'm not sure what should be the behavior for KvsLoad::Optional with added snapshot ID parameter for init. Try load for given ID?
hash file is missing : -> Failed to open KVS: KVS hash file read error
corrupted kvs file format : -> Failed to open KVS: Validation failed
Fix proposal :
provide new parameter called RecoveryPolicy which will be enum as follwoing : enum RecoveryPolicy { strict = 0, EmptyFallback = 1, }
in case of calling open with stict -> will return the error
in case of calling open with EmptyFallback :
- if hash file is missing or corrupted kvs file , return empty storage .
- if use still need another storage can call snapshot_restore api to load it.
Agreed decision :
two recovery approaches :
1- add another option to OpenNeedKvs (Ignore).
2- allow user to open another snapshot by passing snapshot number to builder.
Activity
Ahmed-Elsaka-JC commentedon Sep 18, 2026
for C++ implementation :
Is this issue related to C++ implementaion ?
arkjedrz commentedon Sep 22, 2026
@Ahmed-Elsaka-JC, to start with an answer - I think C++ is affected, because it's not about
::Optionalor::Requiredbehavior. The description of this ticket is misleading.I meant that if snapshot with ID=0 is broken, then KVS is not able to initialize. E.g., hash file got removed, or JSON file is malformed.
Selectable snapshot ID would allow restoring the state using another snapshot - but this would still need a predictable error behavior.
I dislike the automatic loop idea, especially since IIRC snapshot IDs won't be ordered latest to oldest anymore (planned for #292, but stale).
Unit tests for Rust exist, but are marked as
#[ignore = "Not handled properly yet"]and probably should get revisited and expanded.KvsLoad::RequiredandKvsLoad::Optionalshould halt on broken snapshot.KvsLoad::Optionalshould be allowed to proceed only if both files are missing.KvsFileReadError,KvsHashFileReadErrorandFileNotFoundtoFileReadError, change description to "File not found or couldn't be read".IntegrityCorruptedandValidationFailedtoIntegrityCorrupted.KvsLoad::Optionalwith added snapshot ID parameter for init. Try load for given ID?Ahmed-Elsaka-JC commentedon Sep 23, 2026
update :
From C++ implementation prespective :
Fix proposal :
enum RecoveryPolicy { strict = 0, EmptyFallback = 1, }- if hash file is missing or corrupted kvs file , return empty storage .
- if use still need another storage can call snapshot_restore api to load it.
Agreed decision :
1- add another option to OpenNeedKvs (Ignore).
2- allow user to open another snapshot by passing snapshot number to builder.