Class AnomalyClassifier
java.lang.Object
com.cockroachlabs.crdb.anomaly.AnomalyClassifier
Maps raw
SQLExceptions onto the typed CrdbAnomaly hierarchy and
decides retryability, based on SQLSTATE.
40001(serialization_failure) and40P01(deadlock) →SerializationConflict— retryable.- class
08*(connection exceptions) →ConnectionAnomaly— retryable (a fresh connection may succeed). - everything else →
UnknownAnomaly— not retryable.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CrdbAnomalyClassify aSQLExceptioninto a typedCrdbAnomaly.static booleanWhether aSQLExceptionrepresents a retryable anomaly.
-
Field Details
-
SQLSTATE_SERIALIZATION_FAILURE
-
SQLSTATE_DEADLOCK
Deadlock detected (also treated as a serialization conflict on CockroachDB).- See Also:
-
-
Method Details
-
classify
Classify aSQLExceptioninto a typedCrdbAnomaly. -
isRetryable
Whether aSQLExceptionrepresents a retryable anomaly. Retryable kinds are serialization conflicts and connection anomalies.
-