yjhjstz commented on issue #927:
URL: https://github.com/apache/cloudberry/issues/927#issuecomment-2968315231
In PostgreSQL, if `elog(ERROR)` is called *inside* a critical section, it
will be automatically escalated to a **PANIC**.
In the WAL write path, PostgreSQL uses a `CriticalSection` mechanism:
```c
START_CRIT_SECTION();
/* ... */
XLogInsert_Internal
elog(ERROR, "something went wrong"); // → escalates to PANIC!
END_CRIT_SECTION();
```
This means that even if you use `elog(ERROR)`, if the function is executed
between `START_CRIT_SECTION()` and `END_CRIT_SECTION()`, PostgreSQL will
automatically treat the error as **PANIC**. This escalation will call `abort()`
and forcibly terminate the process, in order to prevent the database from
continuing in a potentially corrupted state.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]