Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix partition counter value #3587

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ydb/core/persqueue/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TString TPartition::LogPrefix() const {

bool TPartition::CanWrite() const {
if (PartitionConfig == nullptr) {
// Old format without AllPartitions configuration field.
// Old format without AllPartitions configuration field.
// It is not split/merge partition.
return true;
}
Expand Down Expand Up @@ -273,7 +273,7 @@ ui64 TPartition::ImportantClientsMinOffset() const {
minOffset = Min<ui64>(minOffset, curOffset);
}

return minOffset;
return minOffset;
}

void TPartition::HandleWakeup(const TActorContext& ctx) {
Expand Down Expand Up @@ -552,7 +552,7 @@ void TPartition::InitComplete(const TActorContext& ctx) {
PartitionCountersLabeled->GetCounters()[METRIC_INIT_TIME] = InitDuration.MilliSeconds();
PartitionCountersLabeled->GetCounters()[METRIC_LIFE_TIME] = CreationTime.MilliSeconds();
PartitionCountersLabeled->GetCounters()[METRIC_PARTITIONS] = 1;
PartitionCountersLabeled->GetCounters()[METRIC_PARTITIONS_TOTAL] = Config.PartitionIdsSize();
PartitionCountersLabeled->GetCounters()[METRIC_PARTITIONS_TOTAL] = std::max(Config.PartitionIdsSize(), Config.PartitionsSize());
ctx.Send(Tablet, new TEvPQ::TEvPartitionLabeledCounters(Partition, *PartitionCountersLabeled));
}
UpdateUserInfoEndOffset(ctx.Now());
Expand Down Expand Up @@ -969,7 +969,7 @@ void TPartition::Handle(TEvPQ::TEvBlobResponse::TPtr& ev, const TActorContext& c

auto it = ReadInfo.find(cookie);
Y_ABORT_UNLESS(it != ReadInfo.end());

TReadInfo info = std::move(it->second);
ReadInfo.erase(it);

Expand All @@ -980,7 +980,7 @@ void TPartition::Handle(TEvPQ::TEvBlobResponse::TPtr& ev, const TActorContext& c
info.Destination, GetSizeLag(info.Offset), Tablet, Config.GetMeteringMode()
));
const auto& resp = dynamic_cast<TEvPQ::TEvProxyResponse*>(answer.Event.Get())->Response;

if (HasError(*ev->Get())) {
if (info.IsSubscription) {
TabletCounters.Cumulative()[COUNTER_PQ_READ_SUBSCRIPTION_ERROR].Increment(1);
Expand Down
Loading