aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2025-04-23 11:08:24 +0530
committerAmit Kapila <akapila@postgresql.org>2025-04-23 11:08:24 +0530
commit0e091ce409e06cd89baf81306cc92c496d8ba58d (patch)
tree3f0c37e776aa28de5c480f5c59958c3120a5eddd /src/backend/utils/error/elog.c
parent1f7878c33cab8b741ecb0d145809cdd3000677be (diff)
downloadpostgresql-0e091ce409e06cd89baf81306cc92c496d8ba58d.tar.gz
postgresql-0e091ce409e06cd89baf81306cc92c496d8ba58d.zip
Fix an oversight in 3f28b2fcac.
Commit 3f28b2fcac tried to ensure that the replication origin shouldn't be advanced in case of an ERROR in the apply worker, so that it can request the same data again after restart. However, it is possible that an ERROR was caught and handled by a (say PL/pgSQL) function, and the apply worker continues to apply further changes, in which case, we shouldn't reset the replication origin. Ensure to reset the origin only when the apply worker exits after an ERROR. Commit 3f28b2fcac added new function geterrlevel, which we removed in HEAD as part of this commit, but kept it in backbranches to avoid breaking any applications. A separate case can be made to have such a function even for HEAD. Reported-by: Shawn McCoy <shawn.the.mccoy@gmail.com> Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/CALsgZNCGARa2mcYNVTSj9uoPcJo-tPuWUGECReKpNgTpo31_Pw@mail.gmail.com
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index d6299633ab7..47af743990f 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -1591,23 +1591,6 @@ geterrcode(void)
}
/*
- * geterrlevel --- return the currently set error level
- *
- * This is only intended for use in error callback subroutines, since there
- * is no other place outside elog.c where the concept is meaningful.
- */
-int
-geterrlevel(void)
-{
- ErrorData *edata = &errordata[errordata_stack_depth];
-
- /* we don't bother incrementing recursion_depth */
- CHECK_STACK_DEPTH();
-
- return edata->elevel;
-}
-
-/*
* geterrposition --- return the currently set error position (0 if none)
*
* This is only intended for use in error callback subroutines, since there