Optimize fileset usage in apply worker.

Amit Kapila <akapila@postgresql.org>

Commit: 31c389d8de915b705ee06c7a6e9246e20f36b9dc
Author: Amit Kapila <akapila@postgresql.org>
Date: 2021-09-02T02:43:46Z
Releases: 15.0
Optimize fileset usage in apply worker.

Use one fileset for the entire worker lifetime instead of using
separate filesets for each streaming transaction. Now, the
changes/subxacts files for every streaming transaction will be
created under the same fileset and the files will be deleted
after the transaction is completed.

This patch extends the BufFileOpenFileSet and BufFileDeleteFileSet
APIs to allow users to specify whether to give an error on missing
files.

Author: Dilip Kumar, based on suggestion by Thomas Munro
Reviewed-by: Hou Zhijie, Masahiko Sawada, Amit Kapila
Discussion: https://postgr.es/m/E1mCC6U-0004Ik-Fs@gemulon.postgresql.org

Files

Discussion