Skip to content

Commit

Permalink
Merge #46269
Browse files Browse the repository at this point in the history
46269: sql: fix metric logging for temporary objects cleaner r=jordanlewis a=otan

Was benchmarking temporary tables and found we didn't actually log these
metrics properly. There was a bit of plumbing that I missed doing. This
has been resolved and verified in this PR.

Release justification: bug fixes and low-risk updates to new
functionality
Release note: None

Co-authored-by: Oliver Tan <[email protected]>
  • Loading branch information
craig[bot] and otan committed Mar 20, 2020
2 parents a22a085 + fc88f4f commit 8eff499
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ func NewServer(cfg Config, stopper *stop.Stopper) (*Server, error) {
s.temporaryObjectCleaner = sql.NewTemporaryObjectCleaner(
s.st,
s.db,
s.registry,
s.distSQLServer.ServerConfig.SessionBoundInternalExecutorFactory,
s.status,
s.node.stores.IsMeta1Leaseholder,
Expand Down
5 changes: 4 additions & 1 deletion pkg/sql/temporary_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,22 @@ func (m *temporaryObjectCleanerMetrics) MetricStruct() {}
func NewTemporaryObjectCleaner(
settings *cluster.Settings,
db *kv.DB,
registry *metric.Registry,
makeSessionBoundInternalExecutor sqlutil.SessionBoundInternalExecutorFactory,
statusServer serverpb.StatusServer,
isMeta1LeaseholderFunc isMeta1LeaseholderFunc,
testingKnobs ExecutorTestingKnobs,
) *TemporaryObjectCleaner {
metrics := makeTemporaryObjectCleanerMetrics()
registry.AddMetricStruct(metrics)
return &TemporaryObjectCleaner{
settings: settings,
db: db,
makeSessionBoundInternalExecutor: makeSessionBoundInternalExecutor,
statusServer: statusServer,
isMeta1LeaseholderFunc: isMeta1LeaseholderFunc,
testingKnobs: testingKnobs,
metrics: makeTemporaryObjectCleanerMetrics(),
metrics: metrics,
}
}

Expand Down

0 comments on commit 8eff499

Please sign in to comment.