Skip to content

Commit

Permalink
Merge #97238
Browse files Browse the repository at this point in the history
97238: kvserver: addMVCCStats with no check for inited replica r=tbg a=pavelkalinnikov

Remove the unnecessary check for tenant ID. The ID, and tenantMetricsRef is always set for an initialized Replica, so we can just use it.

Release note: none
Epic: none

Co-authored-by: Pavel Kalinnikov <[email protected]>
  • Loading branch information
craig[bot] and pav-kv committed Feb 16, 2023
2 parents 2111f9b + 1875e6d commit e4b62c9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/kv/kvserver/store_split.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,7 @@ func splitPostApply(

// Update store stats with difference in stats before and after split.
if rightReplOrNil != nil {
if _, ok := rightReplOrNil.TenantID(); ok {
// TODO(tbg): why this check to get here? Is this really checking if the RHS
// is already initialized? But isn't it always, at this point?
rightReplOrNil.store.metrics.addMVCCStats(ctx, rightReplOrNil.tenantMetricsRef, deltaMS)
} else {
log.Fatalf(ctx, "%s: found replica which is RHS of a split "+
"without a valid tenant ID", rightReplOrNil)
}
rightReplOrNil.store.metrics.addMVCCStats(ctx, rightReplOrNil.tenantMetricsRef, deltaMS)
}

now := r.store.Clock().NowAsClockTimestamp()
Expand Down

0 comments on commit e4b62c9

Please sign in to comment.