Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31c389d

Browse files
author
Amit Kapila
committed
Optimize fileset usage in apply worker.
Use one fileset for the entire worker lifetime instead of usingseparate filesets for each streaming transaction. Now, thechanges/subxacts files for every streaming transaction will becreated under the same fileset and the files will be deletedafter the transaction is completed.This patch extends the BufFileOpenFileSet and BufFileDeleteFileSetAPIs to allow users to specify whether to give an error on missingfiles.Author: Dilip Kumar, based on suggestion by Thomas MunroReviewed-by: Hou Zhijie, Masahiko Sawada, Amit KapilaDiscussion:https://postgr.es/m/E1mCC6U-0004Ik-Fs@gemulon.postgresql.org
1 parent163074e commit31c389d

File tree

7 files changed

+86
-219
lines changed

7 files changed

+86
-219
lines changed

‎src/backend/replication/logical/launcher.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname, Oid userid,
379379
worker->relid=relid;
380380
worker->relstate=SUBREL_STATE_UNKNOWN;
381381
worker->relstate_lsn=InvalidXLogRecPtr;
382+
worker->stream_fileset=NULL;
382383
worker->last_lsn=InvalidXLogRecPtr;
383384
TIMESTAMP_NOBEGIN(worker->last_send_time);
384385
TIMESTAMP_NOBEGIN(worker->last_recv_time);
@@ -648,8 +649,9 @@ logicalrep_worker_onexit(int code, Datum arg)
648649

649650
logicalrep_worker_detach();
650651

651-
/* Cleanup filesets used for streaming transactions. */
652-
logicalrep_worker_cleanupfileset();
652+
/* Cleanup fileset used for streaming transactions. */
653+
if (MyLogicalRepWorker->stream_fileset!=NULL)
654+
FileSetDeleteAll(MyLogicalRepWorker->stream_fileset);
653655

654656
ApplyLauncherWakeup();
655657
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp