Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support zero byte value #63

Merged
merged 4 commits into from
Aug 12, 2024
Merged

Support zero byte value #63

merged 4 commits into from
Aug 12, 2024

Conversation

somnathr
Copy link
Contributor

This MR is for supporting zero byte value in the KV pair. Tools like IO500 first create file with empty/zero byte value in it and we need this zero byte value support within DSS for that. We had checks in multiple layers within dss-sdk stack to protect against zero byte value earlier. As part of this MR, we needed to modify code on those parts to gracefully handle zero byte value.

: Somnath Roy, [email protected]

somnathr and others added 4 commits August 6, 2024 11:21
    Brief Changes:
    ==============
    * Included null check on data pointer only when data length is
      not zero
    * Updated comments explaining relevant changes

    Testing Done:
    =============
    * Manual testing with nvk_test_cli

Signed-off-by: r.kavuluru <[email protected]>
[SPDK_TCP-NVMF/KVTRANS] Support zero byte value on target
@somnathr somnathr requested a review from a team as a code owner August 12, 2024 18:25
@ramachaitanyak
Copy link
Contributor

Looks good to me.

Copy link

@@ -764,7 +764,7 @@ nkv_result nkv_retrieve_kvp (uint64_t nkv_handle, nkv_io_context* ioctx, const n
smg_info(logger, "NKV retrieve operation is successful for nkv_handle = %u, key = %s, key_length = %u, supplied length = %u, actual length = %u",
nkv_handle, key ? (char*)key->key: "NULL", key ? key->length:0, value->length, value->actual_length);
if (value->actual_length == 0)
smg_error(logger, "NKV retrieve operation returned 0 value length object !!, nkv_handle = %u, key = %s, key_length = %u, supplied length = %u, actual length = %u",
smg_warn(logger, "NKV retrieve operation returned 0 value length object !!, nkv_handle = %u, key = %s, key_length = %u, supplied length = %u, actual length = %u",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if this is debug log, if we are going to see this more frequently in the IO path.

@@ -1031,7 +1041,7 @@ nkv_result NKVTargetPath::do_retrieve_io_from_path(const nkv_key* n_key, const n
int ret = kvs_retrieve_tuple(path_cont_handle, &kvskey, &kvsvalue, &ret_ctx);
if(ret != KVS_SUCCESS ) {
if (ret != KVS_ERR_KEY_NOT_EXIST) {
smg_error(logger, "Retrieve tuple failed with error 0x%x - %s, key = %s, dev_path = %s, ip = %s",
smg_warn(logger, "Retrieve tuple failed with error 0x%x - %s, key = %s, dev_path = %s, ip = %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this warning? This should still be error I think.

@somnathr somnathr merged commit 13f841e into master Aug 12, 2024
6 checks passed
@somnathr somnathr deleted the support-zero-byte-value branch August 12, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants