LindaSummer commented on code in PR #2826:
URL: https://github.com/apache/kvrocks/pull/2826#discussion_r1997547400


##########
src/types/redis_tdigest.cc:
##########
@@ -273,6 +271,11 @@ rocksdb::Status TDigest::Reset(engine::Context& ctx, const 
Slice& digest_name) {
     return status;
   }
 
+  if (!status.ok()) return status;
+  auto start_key = internalSegmentGuardPrefixKey(metadata, ns_key, 
SegmentType::kBuffer);
+  auto guard_key = internalSegmentGuardPrefixKey(metadata, ns_key, 
SegmentType::kGuardFlag);
+  
+  status = batch->DeleteRange(cf_handle_, start_key, guard_key);

Review Comment:
   ```suggestion
     status = batch->DeleteRange(cf_handle_, start_key, guard_key);
     if (!status.ok()) {
       return status;
     }
    
    status = storage_->Write(ctx, storage_->DefaultWriteOptions(), 
batch->GetWriteBatch());
   ```



##########
src/types/redis_tdigest.cc:
##########
@@ -273,6 +271,11 @@ rocksdb::Status TDigest::Reset(engine::Context& ctx, const 
Slice& digest_name) {
     return status;
   }
 
+  if (!status.ok()) return status;
+  auto start_key = internalSegmentGuardPrefixKey(metadata, ns_key, 
SegmentType::kBuffer);
+  auto guard_key = internalSegmentGuardPrefixKey(metadata, ns_key, 
SegmentType::kGuardFlag);
+  
+  status = batch->DeleteRange(cf_handle_, start_key, guard_key);

Review Comment:
   Sorry for my mistake. This line should be kept.
   We should add the status check before writing to storage.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to