Skip to content

[fix] Allow kv_clear to work on tag-only entries with no field data#129

Open
dodatboii wants to merge 1 commit into
Ascend:mainfrom
dodatboii:fix_clear_tag
Open

[fix] Allow kv_clear to work on tag-only entries with no field data#129
dodatboii wants to merge 1 commit into
Ascend:mainfrom
dodatboii:fix_clear_tag

Conversation

@dodatboii

Copy link
Copy Markdown
Contributor

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_names in BatchMeta

This 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.

Signed-off-by: yxstev <zhangyixiang9@huawei.com>
@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

dodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@0oshowero0

Copy link
Copy Markdown
Collaborator

I believe we should not simply skip storage clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants