Fix core dump due to lock is not released before reporting errors when exceeding MaxAORelSegFileStatus
@@ -423,6 +423,8 @@ AORelCreateHashEntry(Oid relid)
{
pfree(allfsinfoParquet);
+ LWLockRelease(AOSegFileLock);
+
ereport(ERROR, (errmsg("cannot open more than %d "
"append-only table segment "
"files cocurrently",
@@ -458,6 +460,8 @@ AORelCreateHashEntry(Oid relid)
{
pfree(allfsinfo);
+ LWLockRelease(AOSegFileLock);
+
ereport(ERROR, (errmsg("cannot open more than %d "
"append-only table segment "
"files cocurrently",
@@ -1147,6 +1151,7 @@ List *SetSegnoForWrite(List *existing_segnos, Oid relid, int segment_num,
if (new_status == NEXT_END_OF_LIST)
{
LWLockRelease(AOSegFileLock);
+
ereport(ERROR, (errmsg("cannot open more than %d append-only table segment files concurrently",
MaxAORelSegFileStatus)));
}
