This is an automated email from the ASF dual-hosted git repository.

huor pushed a commit to branch taoz
in repository https://gitbox.apache.org/repos/asf/hawq.git

commit 33b5f136dbf984c7cdcbfe571e68b5dbc30f0b9c
Author: Ruilong Huo <[email protected]>
AuthorDate: Sun Jun 2 12:03:39 2019 +0800

    HAWQ-1722. Fix core dump due to lock is not released before reporting 
errors when exceeding MaxAORelSegFileStatus
---
 src/backend/access/appendonly/appendonlywriter.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/backend/access/appendonly/appendonlywriter.c 
b/src/backend/access/appendonly/appendonlywriter.c
index 63b6bc2..addd33e 100644
--- a/src/backend/access/appendonly/appendonlywriter.c
+++ b/src/backend/access/appendonly/appendonlywriter.c
@@ -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)));
                                }

Reply via email to