From 33a64335d1e90594b9debf7029f7fcaa4e5203cc Mon Sep 17 00:00:00 2001 From: Ashwin Agrawal Date: Fri, 22 Jun 2018 14:22:26 -0700 Subject: [PATCH] Remove code checking for am_walsender in SyncRepWaitForLSN() No reason to call `SyncRepWaitForLSN()` from walsender process itself. Some existed in past seems which performed the same, even if walsender for whatever reason needs to perform transaction shouldn't result in wrtitng anything. Replaced the if with assertion instead to catch any viaolations of the assumption. --- src/backend/replication/syncrep.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index b3b314057c..24914adffd 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -117,24 +117,11 @@ SyncRepWaitForLSN(XLogRecPtr XactCommitLSN) { return; } - + Assert(!am_walsender); elogif(debug_walrepl_syncrep, LOG, "syncrep wait -- This backend's commit LSN for syncrep is %X/%X.", XactCommitLSN.xlogid,XactCommitLSN.xrecoff); - /* GPDB_91_MERGE_FIXME: is this still relevant after PT and filerep removal? */ - /* - * Walsenders are not supposed to call this function, but currently - * basebackup needs to access catalog, hence open/close transaction. - * It doesn't make sense to wait for myself anyway. - */ - if (am_walsender) - { - elogif(debug_walrepl_syncrep, LOG, - "syncrep wait -- Not waiting for syncrep as this process is a walsender."); - return; - } - /* Fast exit if user has not requested sync replication. */ if (!SyncRepRequested()) return; -- GitLab