@@ -219,9 +219,8 @@ catchup_preflight_checks(PGNodeInfo *source_node_info, PGconn *source_conn,
219
219
if (current .from_replica && exclusive_backup )
220
220
elog (ERROR , "Catchup from standby is only available for PostgreSQL >= 9.6" );
221
221
222
- /* if local catchup, check that we don't overwrite tablespace in source pgdata */
223
- if (!fio_is_remote (FIO_DB_HOST ))
224
- catchup_check_tablespaces_existance_in_tbsmapping (source_conn );
222
+ /* check that we don't overwrite tablespace in source pgdata */
223
+ catchup_check_tablespaces_existance_in_tbsmapping (source_conn );
225
224
226
225
/* check timelines */
227
226
if (current .backup_mode != BACKUP_MODE_FULL )
@@ -246,7 +245,7 @@ catchup_preflight_checks(PGNodeInfo *source_node_info, PGconn *source_conn,
246
245
247
246
/*
248
247
* Check that all tablespaces exists in tablespace mapping (--tablespace-mapping option)
249
- * Check that all local mapped directories is empty if it is local catchup
248
+ * Check that all local mapped directories is empty if it is local FULL catchup
250
249
* Emit fatal error if that (not existent in map or not empty) tablespace found
251
250
*/
252
251
static void
@@ -274,17 +273,23 @@ catchup_check_tablespaces_existance_in_tbsmapping(PGconn *conn)
274
273
linked_path = get_tablespace_mapping (tablespace_path );
275
274
276
275
if (strcmp (tablespace_path , linked_path ) == 0 )
277
- /* same result -> not found in mapping */
278
- elog (ERROR , "Local catchup executed, but source database contains "
279
- "tablespace (\"%s\"), that is not listed in the map" , tablespace_path );
276
+ /* same result -> not found in mapping */
277
+ {
278
+ if (!fio_is_remote (FIO_DB_HOST ))
279
+ elog (ERROR , "Local catchup executed, but source database contains "
280
+ "tablespace (\"%s\"), that is not listed in the map" , tablespace_path );
281
+ else
282
+ elog (WARNING , "Remote catchup executed and source database contains "
283
+ "tablespace (\"%s\"), that is not listed in the map" , tablespace_path );
284
+ }
280
285
281
286
if (!is_absolute_path (linked_path ))
282
287
elog (ERROR , "Tablespace directory path must be an absolute path: \"%s\"" ,
283
288
linked_path );
284
289
285
290
if (current .backup_mode == BACKUP_MODE_FULL
286
291
&& !dir_is_empty (linked_path , FIO_LOCAL_HOST ))
287
- elog (ERROR , "Target mapped tablespace directory (\"%s\") is not empty in local catchup" ,
292
+ elog (ERROR , "Target mapped tablespace directory (\"%s\") is not empty in FULL catchup" ,
288
293
linked_path );
289
294
}
290
295
PQclear (res );
0 commit comments