Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: engine.Reload(): read table sizes asynchronously #17102

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion go/vt/vttablet/tabletserver/schema/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,14 @@ func (se *Engine) EnableHistorian(enabled bool) error {
// The includeStats argument controls whether table size statistics should be
// emitted, as they can be expensive to calculate for a large number of tables
func (se *Engine) Reload(ctx context.Context) error {
return se.ReloadAt(ctx, replication.Position{})
pos := replication.Position{}
ctxWithoutCancel := context.WithoutCancel(ctx)
time.AfterFunc(time.Minute, func() {
ctx, cancel := context.WithTimeout(ctxWithoutCancel, time.Minute)
defer cancel()
se.ReloadAtEx(ctx, pos, true)
})
return se.ReloadAtEx(ctx, pos, false)
}

// ReloadAt reloads the schema info from the db.
Expand Down
Loading