Skip to content

Commit

Permalink
Merge #126424
Browse files Browse the repository at this point in the history
126424: kvadmission: remove grunning non-monotonic comment r=aadityasondhi a=aadityasondhi

This was fixed in #118907.

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

Informs #95529

Release note: None

Co-authored-by: Aaditya Sondhi <[email protected]>
  • Loading branch information
craig[bot] and aadityasondhi committed Jul 2, 2024
2 parents f8dca2a + 2b9b713 commit b71677c
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 b71677c

Please sign in to comment.