Unverified Commit 0f63a05f authored by Keiven C's avatar Keiven C Committed by GitHub
Browse files

fix: etcd bucket delete missing prefix and metrics test range (#3331)


Signed-off-by: default avatarKeiven Chang <keivenchang@users.noreply.github.com>
parent 2a2bf58a
...@@ -1593,8 +1593,8 @@ mod test_metricsregistry_nats { ...@@ -1593,8 +1593,8 @@ mod test_metricsregistry_nats {
( (
build_component_metric_name(nats_service::REQUESTS_TOTAL), build_component_metric_name(nats_service::REQUESTS_TOTAL),
0.0, 0.0,
0.0, 10.0,
), // No work handler requests ), // NATS service stats requests (may differ from work handler count)
( (
build_component_metric_name(nats_service::PROCESSING_MS_TOTAL), build_component_metric_name(nats_service::PROCESSING_MS_TOTAL),
0.0, 0.0,
......
...@@ -70,7 +70,7 @@ impl KeyValueBucket for EtcdBucket { ...@@ -70,7 +70,7 @@ impl KeyValueBucket for EtcdBucket {
} }
async fn get(&self, key: &Key) -> Result<Option<bytes::Bytes>, StorageError> { async fn get(&self, key: &Key) -> Result<Option<bytes::Bytes>, StorageError> {
let k = format!("{}/{key}", self.bucket_name); let k = make_key(&self.bucket_name, key);
tracing::trace!("etcd get: {k}"); tracing::trace!("etcd get: {k}");
let mut kvs = self let mut kvs = self
...@@ -86,9 +86,11 @@ impl KeyValueBucket for EtcdBucket { ...@@ -86,9 +86,11 @@ impl KeyValueBucket for EtcdBucket {
} }
async fn delete(&self, key: &Key) -> Result<(), StorageError> { async fn delete(&self, key: &Key) -> Result<(), StorageError> {
let k = make_key(&self.bucket_name, key);
tracing::trace!("etcd delete: {k}");
let _ = self let _ = self
.client .client
.kv_delete(key.0.clone(), None) .kv_delete(k, None)
.await .await
.map_err(|e| StorageError::EtcdError(e.to_string()))?; .map_err(|e| StorageError::EtcdError(e.to_string()))?;
Ok(()) Ok(())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment