@@ -51,14 +51,14 @@ filemap_create(void)
5151}
5252
5353/*
54- * Callback for processingremote file list.
54+ * Callback for processingsource file list.
5555 *
5656 * This is called once for every file in the source server. We decide what
5757 * action needs to be taken for the file, depending on whether the file
5858 * exists in the target and whether the size matches.
5959 */
6060void
61- process_remote_file (const char * path ,file_type_t type ,size_t newsize ,
61+ process_source_file (const char * path ,file_type_t type ,size_t newsize ,
6262const char * link_target )
6363{
6464bool exists ;
@@ -97,7 +97,7 @@ process_remote_file(const char *path, file_type_t type, size_t newsize,
9797
9898snprintf (localpath ,sizeof (localpath ),"%s/%s" ,datadir_target ,path );
9999
100- /* Does the correspondinglocal file exist? */
100+ /* Does the corresponding file exist in the target data dir ? */
101101if (lstat (localpath ,& statbuf )< 0 )
102102{
103103if (errno != ENOENT )
@@ -185,18 +185,19 @@ process_remote_file(const char *path, file_type_t type, size_t newsize,
185185 *
186186 * If it's smaller in the target, it means that it has been
187187 * truncated in the target, or enlarged in the source, or
188- * both. If it was truncatedlocally , we need to copy the
189- * missing tail from theremote system. If it was enlarged in
190- * theremote system, there will be WAL records in theremote
188+ * both. If it was truncatedin the target , we need to copy the
189+ * missing tail from thesource system. If it was enlarged in
190+ * thesource system, there will be WAL records in thesource
191191 * system for the new blocks, so we wouldn't need to copy them
192192 * here. But we don't know which scenario we're dealing with,
193193 * and there's no harm in copying the missing blocks now, so
194194 * do it now.
195195 *
196- * If it's the same size, do nothing here. Any locally
197- * modified blocks will be copied based on parsing the local
198- * WAL, and any remotely modified blocks will be updated after
199- * rewinding, when the remote WAL is replayed.
196+ * If it's the same size, do nothing here. Any blocks modified
197+ * in the target will be copied based on parsing the target
198+ * system's WAL, and any blocks modified in the source will be
199+ * updated after rewinding, when the source system's WAL is
200+ * replayed.
200201 */
201202oldsize = statbuf .st_size ;
202203if (oldsize < newsize )
@@ -233,14 +234,15 @@ process_remote_file(const char *path, file_type_t type, size_t newsize,
233234}
234235
235236/*
236- * Callback for processinglocal file list.
237+ * Callback for processingtarget file list.
237238 *
238- * All remote files must be already processed before calling this. This only
239- * marks local files that didn't exist in the remote system for deletion.
239+ * All source files must be already processed before calling this. This only
240+ * marks target data directory's files that didn't exist in the source for
241+ * deletion.
240242 */
241243void
242- process_local_file (const char * path ,file_type_t type ,size_t oldsize ,
243- const char * link_target )
244+ process_target_file (const char * path ,file_type_t type ,size_t oldsize ,
245+ const char * link_target )
244246{
245247bool exists ;
246248char localpath [MAXPGPATH ];
@@ -266,7 +268,7 @@ process_local_file(const char *path, file_type_t type, size_t oldsize,
266268if (map -> nlist == 0 )
267269{
268270/* should not happen */
269- pg_fatal ("remote file list is empty\n" );
271+ pg_fatal ("source file list is empty\n" );
270272}
271273
272274filemap_list_to_array (map );
@@ -288,7 +290,7 @@ process_local_file(const char *path, file_type_t type, size_t oldsize,
288290exists = (bsearch (& key_ptr ,map -> array ,map -> narray ,sizeof (file_entry_t * ),
289291path_cmp )!= NULL );
290292
291- /* Remove any file or folder that doesn't exist in theremote system. */
293+ /* Remove any file or folder that doesn't exist in thesource system. */
292294if (!exists )
293295{
294296entry = pg_malloc (sizeof (file_entry_t ));
@@ -313,16 +315,16 @@ process_local_file(const char *path, file_type_t type, size_t oldsize,
313315else
314316{
315317/*
316- * We already handled all files that exist in theremote system in
317- *process_remote_file ().
318+ * We already handled all files that exist in thesource system in
319+ *process_source_file ().
318320 */
319321}
320322}
321323
322324/*
323- * This callback gets called while we read theold WAL, for every block that
324- * have changed in thelocal system. It makes note of all the changed blocks
325- * in the pagemap of the file.
325+ * This callback gets called while we read the WAL in the target , for every
326+ *block that have changed in thetarget system. It makes note of all the
327+ *changed blocks in the pagemap of the file.
326328 */
327329void
328330process_block_change (ForkNumber forknum ,RelFileNode rnode ,BlockNumber blkno )
@@ -388,8 +390,8 @@ process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
388390{
389391/*
390392 * If we don't have any record of this file in the file map, it means
391- * that it's a relation that doesn't exist in theremote system, and
392- * it was subsequently removed in thelocal system, too. We can safely
393+ * that it's a relation that doesn't exist in thesource system, and
394+ * it was subsequently removed in thetarget system, too. We can safely
393395 * ignore it.
394396 */
395397}