Skip to content

Commit

Permalink
kvadmission: remove grunning non-monotonic comment
Browse files Browse the repository at this point in the history
This was fixed in #118907.

This patch adds an assertion for test builds to ensure monotonic
grunning time.

Informs #95529

Release note: None
  • Loading branch information
aadityasondhi committed Jun 28, 2024
1 parent d016ee7 commit 2b9b713
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/kv/kvserver/kvadmission/kvadmission.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,8 @@ func (n *controllerImpl) AdmittedKVWorkDone(ah Handle, writeBytes *StoreWriteByt
n.elasticCPUGrantCoordinator.ElasticCPUWorkQueue.AdmittedWorkDone(ah.elasticCPUWorkHandle)
if ah.callAdmittedWorkDoneOnKVAdmissionQ {
cpuTime := grunning.Time() - ah.cpuStart
if cpuTime < 0 {
// See https://github.com/cockroachdb/cockroach/issues/95529. Count 1
// nanosecond, arbitrarily.
//
// TODO(sumeer): remove this hack when that bug is fixed.
cpuTime = 1
if buildutil.CrdbTestBuild && cpuTime < 0 {
panic("grunning.Time() should be non-decreasing")
}
n.kvAdmissionQ.AdmittedWorkDone(ah.tenantID, cpuTime)
}
Expand Down

0 comments on commit 2b9b713

Please sign in to comment.