Skip to content

Commit

Permalink
domain: use the KV timeout read feature to mitigate the slow meta reg…
Browse files Browse the repository at this point in the history
…ion issue (#48125)

close #48124
  • Loading branch information
cfzjywxk authored Nov 2, 2023
1 parent 356cad2 commit eed2a76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (do *Domain) loadInfoSchema(startTS uint64) (infoschema.InfoSchema, bool, i
infoschema_metrics.LoadSchemaDurationTotal.Observe(time.Since(beginTime).Seconds())
}()
snapshot := do.store.GetSnapshot(kv.NewVersion(startTS))
// Using the KV timeout read feature to address the issue of potential DDL lease expiration when
// the meta region leader is slow.
snapshot.SetOption(kv.TiKVClientReadTimeout, uint64(3000)) // 3000ms.
m := meta.NewSnapshotMeta(snapshot)
neededSchemaVersion, err := m.GetSchemaVersionWithNonEmptyDiff()
if err != nil {
Expand Down

0 comments on commit eed2a76

Please sign in to comment.