func (s *schemaValidityInfo) Check(txnTS uint64, schemaVer int64) (int64, error) {
	currVer := atomic.LoadInt64(&s.lastSchemaVer)
	s.mux.RLock()
	if s.isExpired {
		s.mux.RUnlock()
		return currVer, ErrInfoSchemaExpired
	}

	// txnTS != 0, it means the transition isn't nil.
	// txnTS <= s.recoveredTS, it means the transition begins before schema is recovered.
	// schemaVer != currVer, it means the schema version is changed.
	if txnTS != 0 && txnTS <= s.recoveredTS && schemaVer != currVer {
		s.mux.RUnlock()
		log.Warnf("check schema validity, txnTS:%v recordTS:%v schema version original:%v input:%v",
			txnTS, s.recoveredTS, currVer, schemaVer)
		return currVer, ErrInfoSchemaChanged
	}
	s.mux.RUnlock()
	return currVer, nil
}
// Check checks schema validity. It returns the current schema version and an error.
Check checks schema validity. It returns the current schema version and an error.
// Check checks schema validity . It returns the current schema version and an error .
func (s *schemaValidityInfo) Check(txnTS uint64, schemaVer int64) (int64, error) {
	currVer := atomic.LoadInt64(&s.lastSchemaVer)
	s.mux.RLock()
	if s.isExpired {
		s.mux.RUnlock()
		return currVer, ErrInfoSchemaExpired
	}
	if txnTS != 0 && txnTS <= s.recoveredTS && schemaVer != currVer {
		s.mux.RUnlock()
		log.Warnf("check schema validity, txnTS:%v recordTS:%v schema version original:%v input:%v",
			txnTS, s.recoveredTS, currVer, schemaVer)
		return currVer, ErrInfoSchemaChanged
	}
	s.mux.RUnlock()
	return currVer, nil
}
func ( s * schemaValidityInfo ) Check ( txnTS uint64 , schemaVer int64 ) ( int64 , error ) { currVer := atomic . LoadInt64 ( & s . lastSchemaVer ) s . mux . RLock ( ) if s . isExpired { s . mux . RUnlock ( ) return currVer , ErrInfoSchemaExpired } if txnTS != 0 && txnTS <= s . recoveredTS && schemaVer != currVer { s . mux . RUnlock ( ) log . Warnf ( " " , txnTS , s . recoveredTS , currVer , schemaVer ) return currVer , ErrInfoSchemaChanged } s . mux . RUnlock ( ) return currVer , nil }
Check checks schema validity.
Check checks schema validity .
// txnTS != 0, it means the transition isn't nil. // txnTS <= s.recoveredTS, it means the transition begins before schema is recovered. // schemaVer != currVer, it means the schema version is changed.