diff --git a/domain/schema_validator.go b/domain/schema_validator.go index 4ad250aa13d44..9c7cd406b107c 100644 --- a/domain/schema_validator.go +++ b/domain/schema_validator.go @@ -88,7 +88,10 @@ func (s *schemaValidator) Check(txnTS uint64, schemaVer int64) bool { // Latest returns the latest schema version it knows. func (s *schemaValidator) Latest() int64 { - return s.latestSchemaVer + s.mux.RLock() + ret := s.latestSchemaVer + s.mux.RUnlock() + return ret } func extractPhysicalTime(ts uint64) time.Time {