Skip to content

Commit 9667072

Browse files
authored
follow to memalloc classify (#3346)
1 parent 928570e commit 9667072

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flow/alerting/classifier.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ var (
160160
// Postgres 16.9/17.5 etc. introduced a bug where certain workloads can cause logical replication to
161161
// request a memory allocation of >1GB, which is not allowed by Postgres. Fixed already, but we need to handle this error
162162
// https://github.com/postgres/postgres/commit/d87d07b7ad3b782cb74566cd771ecdb2823adf6a
163-
ErrorPostgresSlotMemalloc = ErrorClass{
164-
Class: "ERROR_POSTGRES_SLOT_MEMALLOC", action: NotifyUser,
163+
ErrorNotifyPostgresSlotMemalloc = ErrorClass{
164+
Class: "NOTIFY_POSTGRES_SLOT_MEMALLOC", action: NotifyUser,
165165
}
166166
)
167167

@@ -329,7 +329,7 @@ func GetErrorClass(ctx context.Context, err error) (ErrorClass, ErrorInfo) {
329329
}
330330

331331
if strings.Contains(pgErr.Message, "invalid memory alloc request size") {
332-
return ErrorPostgresSlotMemalloc, pgErrorInfo
332+
return ErrorNotifyPostgresSlotMemalloc, pgErrorInfo
333333
}
334334

335335
// Fall through for other internal errors

flow/alerting/classifier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func TestPostgresMemoryAllocErrorShouldBeSlotMemalloc(t *testing.T) {
160160
},
161161
}
162162
errorClass, errInfo := GetErrorClass(t.Context(), fmt.Errorf("error in WAL: %w", err))
163-
assert.Equal(t, ErrorPostgresSlotMemalloc, errorClass, "Unexpected error class")
163+
assert.Equal(t, ErrorNotifyPostgresSlotMemalloc, errorClass, "Unexpected error class")
164164
assert.Equal(t, ErrorInfo{
165165
Source: ErrorSourcePostgres,
166166
Code: pgerrcode.InternalError,

0 commit comments

Comments
 (0)