@@ -348,35 +348,36 @@ where
348
348
self . add_rel ( rel, rel) . await ?;
349
349
}
350
350
}
351
+ }
351
352
352
- for ( path, content) in self
353
- . timeline
354
- . list_aux_files ( self . lsn , self . ctx )
355
- . await
356
- . map_err ( |e| BasebackupError :: Server ( e. into ( ) ) ) ?
357
- {
358
- if path. starts_with ( "pg_replslot" ) {
359
- let offs = pg_constants:: REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN ;
360
- let restart_lsn = Lsn ( u64:: from_le_bytes (
361
- content[ offs..offs + 8 ] . try_into ( ) . unwrap ( ) ,
362
- ) ) ;
363
- info ! ( "Replication slot {} restart LSN={}" , path, restart_lsn) ;
364
- min_restart_lsn = Lsn :: min ( min_restart_lsn, restart_lsn) ;
365
- } else if path == "pg_logical/replorigin_checkpoint" {
366
- // replorigin_checkoint is written only on compute shutdown, so it contains
367
- // deteriorated values. So we generate our own version of this file for the particular LSN
368
- // based on information about replorigins extracted from transaction commit records.
369
- // In future we will not generate AUX record for "pg_logical/replorigin_checkpoint" at all,
370
- // but now we should handle (skip) it for backward compatibility.
371
- continue ;
372
- }
373
- let header = new_tar_header ( & path, content. len ( ) as u64 ) ?;
374
- self . ar
375
- . append ( & header, & * content)
376
- . await
377
- . context ( "could not add aux file to basebackup tarball" ) ?;
353
+ for ( path, content) in self
354
+ . timeline
355
+ . list_aux_files ( self . lsn , self . ctx )
356
+ . await
357
+ . map_err ( |e| BasebackupError :: Server ( e. into ( ) ) ) ?
358
+ {
359
+ if path. starts_with ( "pg_replslot" ) {
360
+ let offs = pg_constants:: REPL_SLOT_ON_DISK_OFFSETOF_RESTART_LSN ;
361
+ let restart_lsn = Lsn ( u64:: from_le_bytes (
362
+ content[ offs..offs + 8 ] . try_into ( ) . unwrap ( ) ,
363
+ ) ) ;
364
+ info ! ( "Replication slot {} restart LSN={}" , path, restart_lsn) ;
365
+ min_restart_lsn = Lsn :: min ( min_restart_lsn, restart_lsn) ;
366
+ } else if path == "pg_logical/replorigin_checkpoint" {
367
+ // replorigin_checkoint is written only on compute shutdown, so it contains
368
+ // deteriorated values. So we generate our own version of this file for the particular LSN
369
+ // based on information about replorigins extracted from transaction commit records.
370
+ // In future we will not generate AUX record for "pg_logical/replorigin_checkpoint" at all,
371
+ // but now we should handle (skip) it for backward compatibility.
372
+ continue ;
378
373
}
374
+ let header = new_tar_header ( & path, content. len ( ) as u64 ) ?;
375
+ self . ar
376
+ . append ( & header, & * content)
377
+ . await
378
+ . context ( "could not add aux file to basebackup tarball" ) ?;
379
379
}
380
+
380
381
if min_restart_lsn != Lsn :: MAX {
381
382
info ! (
382
383
"Min restart LSN for logical replication is {}" ,
0 commit comments