!1046 Fixed the bug that a memory leak occurs when archiving is enabled on the standby node.

Merge pull request !1046 from Cross-罗/patch_branch
This commit is contained in:
opengauss-bot 2021-06-22 14:16:37 +00:00 committed by Gitee
commit 2f6663e0a8
2 changed files with 5 additions and 1 deletions

View File

@ -3031,6 +3031,8 @@ static void InitArchiveStartPoint()
pfree(xlog_array);
xlog_array = NULL;
}
FreeDir(xldir);
xldir = NULL;
}
static bool CheckXlogNameValid(char* xlog)

View File

@ -3189,7 +3189,9 @@ static int WalSndLoop(WalSndSendDataCallback send_data)
XLogRecPtr replayPtr;
bool amSync = false;
bool got_recptr = false;
int standby_nums = list_length(SyncRepGetSyncStandbys(&amSync));
List* sync_standbys = SyncRepGetSyncStandbys(&amSync);
int standby_nums = list_length(sync_standbys);
list_free(sync_standbys);
got_recptr = SyncRepGetSyncRecPtr(&receivePtr, &writePtr, &flushPtr, &replayPtr, &amSync, false);
if (got_recptr) {
ArchiveXlogOnStandby(flushPtr);