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


##########
src/types/redis_stream.cc:
##########
@@ -339,20 +339,40 @@ rocksdb::Status Stream::DeletePelEntries(const Slice 
&stream_name, const std::st
   WriteBatchLogData log_data(kRedisStream);
   batch->PutLogData(log_data.Encode());
 
+  std::map<std::string, uint64_t> consumer_acknowledges;
   for (const auto &id : entry_ids) {
     std::string entry_key = internalPelKeyFromGroupAndEntryId(ns_key, 
metadata, group_name, id);
     std::string value;
     s = storage_->Get(rocksdb::ReadOptions(), stream_cf_handle_, entry_key, 
&value);
     if (s.ok()) {
       *acknowledged += 1;
       batch->Delete(stream_cf_handle_, entry_key);
+
+      // increment ack for each related consumer
+      auto pel_entry = decodeStreamPelEntryValue(value);
+      if (consumer_acknowledges.find(pel_entry.consumer_name) == 
consumer_acknowledges.cend()) {

Review Comment:
   Thanks very much.
   
   I will update it with automatic construction if not existed.



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