Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[walproposer] Async WAL append #105

Merged
merged 9 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/backend/replication/libpqwalproposer/libpqwalproposer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static WalProposerConnectPollStatusType libpqprop_connect_poll(WalProposerConn*
static bool libpqprop_send_query(WalProposerConn* conn, char* query);
static WalProposerExecStatusType libpqprop_get_query_result(WalProposerConn* conn);
static pgsocket libpqprop_socket(WalProposerConn* conn);
static int libpqprop_flush(WalProposerConn* conn, bool socket_read_ready);
static int libpqprop_flush(WalProposerConn* conn);
static void libpqprop_finish(WalProposerConn* conn);
static PGAsyncReadResult libpqprop_async_read(WalProposerConn* conn, char** buf, int* amount);
static PGAsyncWriteResult libpqprop_async_write(WalProposerConn* conn, void const* buf, size_t size);
Expand Down Expand Up @@ -239,13 +239,8 @@ libpqprop_socket(WalProposerConn* conn)
}

static int
libpqprop_flush(WalProposerConn* conn, bool socket_read_ready)
libpqprop_flush(WalProposerConn* conn)
{
/* If the socket is read-ready, we have to call PQconsumeInput before
* calling PQflush (according to libpq docs) */
if (socket_read_ready && !PQconsumeInput(conn->pg_conn))
return -1; /* return failure if PQconsumeInput fails */

return (PQflush(conn->pg_conn));
}

Expand Down
Loading