Skip to content

Commit

Permalink
chore(bors): merge pull request #761
Browse files Browse the repository at this point in the history
761: fix(legacy prefix detection): calculate range end for legacy prefix instead of empty r=Abhinandan-Purkait a=Abhinandan-Purkait

#### What is the issue?

For legacy prefix detection we used the paginated call with range end as `""`, which was incorrect as `""` range end fetches all the values, irrespective of the key prefix. Now we calculate the range end with legacy prefix thus we get only the specific KVs.

Co-authored-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
  • Loading branch information
mayastor-bors and Abhinandan-Purkait committed Feb 26, 2024
2 parents 550e4df + 528a02f commit 6041608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/pstor/src/products/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ pub fn key_prefix_obj<K: AsRef<str>>(key_type: K) -> String {

/// Fetches the product v1 key prefix and returns true if entry is present.
pub async fn detect_product_v1_prefix<S: Store>(store: &mut S) -> Result<bool, crate::Error> {
let prefix = store.get_values_paged(&key_prefix(), 3, "").await?;
let prefix = store.get_values_paged_all(&key_prefix(), 3).await?;
Ok(!prefix.is_empty())
}

0 comments on commit 6041608

Please sign in to comment.