@@ -221,6 +221,9 @@ var (
221221 ErrorNotifyPostgresLogicalMessageProcessing = ErrorClass {
222222 Class : "NOTIFY_POSTGRES_LOGICAL_MESSAGE_PROCESSING_ERROR" , action : NotifyUser ,
223223 }
224+ ErrorNotifyWalSegmentRemoved = ErrorClass {
225+ Class : "NOTIFY_WAL_SEGMENT_REMOVED" , action : NotifyUser ,
226+ }
224227 ErrorNotifyClickHouseSupportIsDisabledError = ErrorClass {
225228 Class : "NOTIFY_CLICKHOUSE_SUPPORT_IS_DISABLED_ERROR" , action : NotifyUser ,
226229 }
@@ -527,9 +530,12 @@ func GetErrorClass(ctx context.Context, err error) (ErrorClass, ErrorInfo) {
527530
528531 case pgerrcode .UndefinedFile :
529532 // Handle WAL segment removed errors
530- // There is a quirk in some PG installs where replication can try read a segment that hasn't been created yet but will show up
533+ // It either shows up once then disappears
534+ // (quirk in some PG installs where replication can try read a segment that hasn't been created yet)
535+ // or shows up and persists
536+ // NotifyUser with repeat threshold accommodates both
531537 if PostgresWalSegmentRemovedRe .MatchString (pgErr .Message ) {
532- return ErrorRetryRecoverable , pgErrorInfo
538+ return ErrorNotifyWalSegmentRemoved , pgErrorInfo
533539 }
534540 // Handles missing spill-to-disk file during logical decoding (transient error)
535541 if PostgresSpillFileMissingRe .MatchString (pgErr .Message ) {
@@ -557,9 +563,12 @@ func GetErrorClass(ctx context.Context, err error) (ErrorClass, ErrorInfo) {
557563 }
558564
559565 // Handle WAL segment removed errors
560- // There is a quirk in some PG installs where replication can try read a segment that hasn't been created yet but will show up
566+ // It either shows up once then disappears
567+ // (quirk in some PG installs where replication can try read a segment that hasn't been created yet)
568+ // or shows up and persists
569+ // NotifyUser with repeat threshold accommodates both
561570 if PostgresWalSegmentRemovedRe .MatchString (pgErr .Message ) {
562- return ErrorRetryRecoverable , pgErrorInfo
571+ return ErrorNotifyWalSegmentRemoved , pgErrorInfo
563572 }
564573
565574 // Handle Neon quota exceeded errors
0 commit comments