Skip to content

Commit

Permalink
sql: fix metric logging for temporary objects cleaner
Browse files Browse the repository at this point in the history
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
  • Loading branch information
otan committed Mar 18, 2020
1 parent aaa6040 commit fc88f4f
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 fc88f4f

Please sign in to comment.