[fix] Allow kv_clear to work on tag-only entries with no field data#129
Open
dodatboii wants to merge 1 commit into
Open
[fix] Allow kv_clear to work on tag-only entries with no field data#129dodatboii wants to merge 1 commit into
dodatboii wants to merge 1 commit into
Conversation
Signed-off-by: yxstev <zhangyixiang9@huawei.com>
CLA Signature Passdodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Collaborator
|
I believe we should not simply skip storage clear |
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.
Previously, calling kv_clear on a key that was put via async_kv_put with only a tag (e.g. {"status": "finished"}) and no fields would raise:
RuntimeError: Fail to clear_data for key-value based backends due to lack of
field_namesin BatchMetaThis happened because async_clear_samples always called storage_manager.clear_data, which requires field_names to generate storage keys. For tag-only entries, nothing was ever written to the storage backend, so there is nothing to clear there.
Fix: skip storage_manager.clear_data when metadata.field_names is empty, and only clear the controller-side metadata.