Fix error when waiting for remote COPY to finish

Pass proper flags to WaitLatchOrSocket, and fix the swapped up
arguments.
This commit is contained in:
Alexander Kuzmenkov 2022-09-21 16:10:25 +03:00 committed by Alexander Kuzmenkov
parent 9d0d159ac1
commit 6011c1446e
2 changed files with 4 additions and 7 deletions

View File

@ -25,6 +25,7 @@ argument or resolve the type ambiguity by casting to the intended type.
* #4685 Improve chunk exclusion for space dimensions * #4685 Improve chunk exclusion for space dimensions
* #4696 Report warning when enabling compression on hypertable * #4696 Report warning when enabling compression on hypertable
* #4720 Fix chunk exclusion for prepared statements and dst changes * #4720 Fix chunk exclusion for prepared statements and dst changes
* #4738 Fix the assorted epoll_ctl() errors that could occur with COPY into a distributed hypertable
* #4739 Fix continuous aggregate migrate check constraint * #4739 Fix continuous aggregate migrate check constraint
**Thanks** **Thanks**

View File

@ -2278,8 +2278,8 @@ remote_connection_end_copy(TSConnection *conn, TSConnectionError *err)
* writeable, we just retry. * writeable, we just retry.
*/ */
(void) WaitLatchOrSocket(MyLatch, (void) WaitLatchOrSocket(MyLatch,
WL_TIMEOUT | WL_SOCKET_WRITEABLE | WL_EXIT_ON_PM_DEATH,
socket, socket,
WL_TIMEOUT | WL_SOCKET_WRITEABLE,
/* timeout = */ 1000, /* timeout = */ 1000,
/* wait_event_info = */ 0); /* wait_event_info = */ 0);
} }
@ -2348,12 +2348,8 @@ remote_connection_end_copy(TSConnection *conn, TSConnectionError *err)
ExecStatusType status = PQresultStatus(res); ExecStatusType status = PQresultStatus(res);
if (status != PGRES_COMMAND_OK) if (status != PGRES_COMMAND_OK)
{ {
success = success = false;
fill_result_error(err, remote_connection_get_result_error(res, err);
ERRCODE_CONNECTION_EXCEPTION,
psprintf("invalid result status '%s' when ending remote COPY",
PQresStatus(status)),
res);
} }
} }