From 2b9b71330428dd968873e67668f949d6ac059e17 Mon Sep 17 00:00:00 2001 From: Aaditya Sondhi <20070511+aadityasondhi@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:54:09 -0400 Subject: [PATCH] kvadmission: remove grunning non-monotonic comment This was fixed in https://github.com/cockroachdb/cockroach/pull/118907. This patch adds an assertion for test builds to ensure monotonic grunning time. Informs #95529 Release note: None --- pkg/kv/kvserver/kvadmission/kvadmission.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/kv/kvserver/kvadmission/kvadmission.go b/pkg/kv/kvserver/kvadmission/kvadmission.go index f54bdb018c37..77fec28766bb 100644 --- a/pkg/kv/kvserver/kvadmission/kvadmission.go +++ b/pkg/kv/kvserver/kvadmission/kvadmission.go @@ -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) }