LiuYuHui commented on code in PR #2190:
URL: https://github.com/apache/kvrocks/pull/2190#discussion_r1545347494
##########
src/types/redis_stream.cc:
##########
@@ -343,8 +346,26 @@ rocksdb::Status Stream::DeletePelEntries(const Slice
&stream_name, const std::st
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;
+ StreamPelEntry pel_entry = decodeStreamPelEntryValue(value);
+
+ const std::string &consumer_name = pel_entry.consumer_name;
+ std::string consumer_key = internalKeyFromConsumerName(ns_key, metadata,
group_name, consumer_name);
+ std::string get_consumer_value;
+ s = storage_->Get(rocksdb::ReadOptions(), stream_cf_handle_,
consumer_key, &get_consumer_value);
+ if (!s.ok() && !s.IsNotFound()) {
+ return s;
+ }
+ if (s.IsNotFound()) {
+ return rocksdb::Status::OK();
+ }
+
+ StreamConsumerMetadata consumer_metadata =
decodeStreamConsumerMetadataValue(get_consumer_value);
+ consumer_metadata.pending_number -= 1;
Review Comment:
@Yangsx-1 , It seems that we should also update `pending_number` in
`StreamConsumerMetadata`, when `xack` id, currently, we only update
`pending_number` in `StreamConsumerGroupMetadata`.
--
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]