@@ -64,10 +64,11 @@ var (
6464 ClickHouseObjectStorageIOErrorRe = regexp .MustCompile (
6565 `unspecified iostream_category error: while reading .+: While executing ReadFromObjectStorage` ,
6666 )
67- PostgresPublicationDoesNotExistRe = regexp .MustCompile (`publication ".*?" does not exist` )
68- PostgresSnapshotDoesNotExistRe = regexp .MustCompile (`snapshot ".*?" does not exist` )
69- PostgresWalSegmentRemovedRe = regexp .MustCompile (`requested WAL segment \w+ has already been removed` )
70- PostgresSpillFileMissingRe = regexp .MustCompile (`Unable to restore changes for xid \d+` )
67+ ClickHouseLockingAttemptForAlterRe = regexp .MustCompile (`Locking attempt for ALTER on .+ has timed out` )
68+ PostgresPublicationDoesNotExistRe = regexp .MustCompile (`publication ".*?" does not exist` )
69+ PostgresSnapshotDoesNotExistRe = regexp .MustCompile (`snapshot ".*?" does not exist` )
70+ PostgresWalSegmentRemovedRe = regexp .MustCompile (`requested WAL segment \w+ has already been removed` )
71+ PostgresSpillFileMissingRe = regexp .MustCompile (`Unable to restore changes for xid \d+` )
7172 // e.g. could not rename file "pg_logical/snapshots/25-3370F40.snap.19943.tmp" to "pg_logical/snapshots/25-3370F40.snap"
7273 PostgresCouldNotRenameSnapshotRe = regexp .MustCompile (`could not rename file ".*\.snap\..*\.tmp" to ".*\.snap"` )
7374 MySqlRdsBinlogFileNotFoundRe = regexp .MustCompile (`File '/rdsdbdata/log/binlog/mysql-bin-changelog.\d+' not found` )
@@ -956,6 +957,10 @@ func GetErrorClass(ctx context.Context, err error) (ErrorClass, ErrorInfo) {
956957 return ErrorRetryRecoverable , chErrorInfo
957958 case chproto .ErrCannotAssignAlter :
958959 return ErrorNotifyClickHouseError , chErrorInfo
960+ case chproto .ErrDeadlockAvoided :
961+ if ClickHouseLockingAttemptForAlterRe .MatchString (chException .Message ) {
962+ return ErrorRetryRecoverable , chErrorInfo
963+ }
959964 case chproto .ErrAborted :
960965 return ErrorInternalClickHouse , chErrorInfo
961966 case chproto .ErrTooManySimultaneousQueries :
0 commit comments