Skip to content

Commit

Permalink
executor: initialize expensive query handler on domain creation (#21340)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlins authored Mar 11, 2021
1 parent bc572f3 commit 67e4528
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ func NewDomain(store kv.Storage, ddlLease time.Duration, statsLease time.Duratio
}

do.SchemaValidator = NewSchemaValidator(ddlLease, do)
do.expensiveQueryHandle = expensivequery.NewExpensiveQueryHandle(do.exit)
return do
}

Expand Down Expand Up @@ -1296,11 +1297,6 @@ func (do *Domain) ExpensiveQueryHandle() *expensivequery.Handle {
return do.expensiveQueryHandle
}

// InitExpensiveQueryHandle init the expensive query handler.
func (do *Domain) InitExpensiveQueryHandle() {
do.expensiveQueryHandle = expensivequery.NewExpensiveQueryHandle(do.exit)
}

const privilegeKey = "/tidb/privilege"

// NotifyUpdatePrivilege updates privilege key in etcd, TiDB client that watches
Expand Down
1 change: 0 additions & 1 deletion session/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ func (s *testBootstrapSuite) TestBootstrapInitExpensiveQueryHandle(c *C) {
dom := domain.GetDomain(se)
c.Assert(dom, NotNil)
defer dom.Close()
dom.InitExpensiveQueryHandle()
c.Assert(dom.ExpensiveQueryHandle(), NotNil)
}

Expand Down
1 change: 0 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,6 @@ func BootstrapSession(store kv.Storage) (*domain.Domain, error) {
}

dom := domain.GetDomain(se)
dom.InitExpensiveQueryHandle()

se2, err := createSession(store)
if err != nil {
Expand Down

0 comments on commit 67e4528

Please sign in to comment.