From dd4ddfc9653e39d26304e4b3a588188ff223f079 Mon Sep 17 00:00:00 2001 From: "J.C. Jones" Date: Tue, 4 May 2021 11:47:52 -0700 Subject: [PATCH] Use dirty reads for cert-checker (#5405) Explicitly opt in to the least-consistent transaction coherency for the duration of all cert-checker queries. The primary risk here is that the windowed table scan across the certificates table can, on replicas, read a series of rows that aren't from consistent timesteps. However, the certificates table is append-only, so in practice this is not a concern, and there is no risk to enabling the dirtiest of reads, done dirt cheap. This doesn't impact the length of the window function, so existing overlap mechanisms to ensure coverage will remain as good as they are today. Based on #5400 Part of #5393 --- cmd/cert-checker/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cert-checker/main.go b/cmd/cert-checker/main.go index 373a48948..d310fd8af 100644 --- a/cmd/cert-checker/main.go +++ b/cmd/cert-checker/main.go @@ -384,6 +384,11 @@ func main() { sa.InitDBMetrics(saDbMap, prometheus.DefaultRegisterer, dbSettings) + _, err = saDbMap.Exec( + "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;", + ) + cmd.FailOnError(err, "Failed to set transaction isolation level at the DB") + checkerLatency := prometheus.NewHistogram(prometheus.HistogramOpts{ Name: "cert_checker_latency", Help: "Histogram of latencies a cert-checker worker takes to complete a batch",