Skip to content

Conversation

@LiuYuHui
Copy link
Contributor

@LiuYuHui LiuYuHui commented Mar 21, 2024

closes #1734

@LiuYuHui LiuYuHui marked this pull request as ready for review March 31, 2024 14:53
consumer_metadata.pending_number -= 1;

batch->Put(stream_cf_handle_, consumer_key, encodeStreamConsumerMetadataValue(consumer_metadata));
batch->Delete(stream_cf_handle_, entry_key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should be put after *acknowledged += 1 , because the entry_key may not be delete due to the early return.

Copy link
Member

@jihuayu jihuayu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Pretty good.

const std::string &group_name = options.group_name;
std::string ns_key = AppendNamespacePrefix(stream_name);

LockGuard guard(storage_->GetLockManager(), ns_key);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the snapshot instead of the lock? @mapleFU
#2174

Comment on lines +69 to +70
rocksdb::Status GetPendingEntries(StreamPendingOptions &options, StreamGetPendingEntryResult &pending_infos,
std::vector<StreamGetExtPendingEntryResult> &ext_results);
Copy link
Member

@jihuayu jihuayu Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options here can be const.

The signature of this function is different from what we are accustomed to.

  1. We are accustomed to using pointers instead of references to represent return values.
  2. In general, we usually have only one return value.
  3. We usually place the key name(here is stream_name), group_name, consumer_name outside instead of inside the options.

#include <rocksdb/status.h>

#include <memory>
#include <unordered_set>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this included?

@git-hulk git-hulk requested review from Yangsx-1, jihuayu and torwig April 1, 2024 03:58
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2024

@Yangsx-1
Copy link
Contributor

@LiuYuHui Hi, how's it going now?

@LiuYuHui
Copy link
Contributor Author

@LiuYuHui Hi, how's it going now?

@Yangsx-1 Sorry for the long delay, will pick it up this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support of the XPENDING command

3 participants