@@ -276,8 +276,7 @@ get_checksum_errormsg(Page page, char **errormsg, BlockNumber absolute_blkno)
276
276
* return it to the caller
277
277
*/
278
278
static int32
279
- prepare_page (ConnectionArgs * conn_arg ,
280
- pgFile * file ,XLogRecPtr prev_backup_start_lsn ,
279
+ prepare_page (pgFile * file ,XLogRecPtr prev_backup_start_lsn ,
281
280
BlockNumber blknum ,FILE * in ,
282
281
BackupMode backup_mode ,
283
282
Page page ,bool strict ,
@@ -395,66 +394,6 @@ prepare_page(ConnectionArgs *conn_arg,
395
394
return PageIsOk ;
396
395
}
397
396
398
- /*
399
- * Get page via ptrack interface from PostgreSQL shared buffer.
400
- * We do this only in the cases of PTRACK 1.x versions backup
401
- */
402
- if (backup_mode == BACKUP_MODE_DIFF_PTRACK
403
- && (ptrack_version_num >=15 && ptrack_version_num < 20 ))
404
- {
405
- int rc = 0 ;
406
- size_t page_size = 0 ;
407
- Page ptrack_page = NULL ;
408
- ptrack_page = (Page )pg_ptrack_get_block (conn_arg ,file -> dbOid ,file -> tblspcOid ,
409
- file -> relOid ,absolute_blknum ,& page_size ,
410
- ptrack_version_num ,ptrack_schema );
411
-
412
- if (ptrack_page == NULL )
413
- /* This block was truncated.*/
414
- return PageIsTruncated ;
415
-
416
- if (page_size != BLCKSZ )
417
- elog (ERROR ,"File: \"%s\", block %u, expected block size %d, but read %zu" ,
418
- from_fullpath ,blknum ,BLCKSZ ,page_size );
419
-
420
- /*
421
- * We need to copy the page that was successfully
422
- * retrieved from ptrack into our output "page" parameter.
423
- */
424
- memcpy (page ,ptrack_page ,BLCKSZ );
425
- pg_free (ptrack_page );
426
-
427
- /*
428
- * UPD: It apprears that is possible to get zeroed page or page with invalid header
429
- * from shared buffer.
430
- * Note, that getting page with wrong checksumm from shared buffer is
431
- * acceptable.
432
- */
433
- rc = validate_one_page (page ,absolute_blknum ,
434
- InvalidXLogRecPtr ,page_st ,
435
- checksum_version );
436
-
437
- /* It is ok to get zeroed page */
438
- if (rc == PAGE_IS_ZEROED )
439
- return PageIsOk ;
440
-
441
- /* Getting page with invalid header from shared buffers is unacceptable */
442
- if (rc == PAGE_HEADER_IS_INVALID )
443
- {
444
- char * errormsg = NULL ;
445
- get_header_errormsg (page ,& errormsg );
446
- elog (ERROR ,"Corruption detected in file \"%s\", block %u: %s" ,
447
- from_fullpath ,blknum ,errormsg );
448
- }
449
-
450
- /*
451
- * We must set checksum here, because it is outdated
452
- * in the block recieved from shared buffers.
453
- */
454
- if (checksum_version )
455
- page_st -> checksum = ((PageHeader )page )-> pd_checksum = pg_checksum_page (page ,absolute_blknum );
456
- }
457
-
458
397
/*
459
398
* Skip page if page lsn is less than START_LSN of parent backup.
460
399
* Nullified pages must be copied by DELTA backup, just to be safe.
@@ -714,12 +653,11 @@ backup_data_file(ConnectionArgs* conn_arg, pgFile *file,
714
653
* backup with special header.
715
654
*/
716
655
void
717
- catchup_data_file (ConnectionArgs * conn_arg ,pgFile * file ,
718
- const char * from_fullpath ,const char * to_fullpath ,
656
+ catchup_data_file (pgFile * file ,const char * from_fullpath ,const char * to_fullpath ,
719
657
XLogRecPtr prev_backup_start_lsn ,BackupMode backup_mode ,
720
658
CompressAlg calg ,int clevel ,uint32 checksum_version ,
721
659
int ptrack_version_num ,const char * ptrack_schema ,
722
- HeaderMap * hdr_map , bool is_merge )
660
+ bool is_merge )
723
661
{
724
662
int rc ;
725
663
bool use_pagemap ;
@@ -796,7 +734,7 @@ catchup_data_file(ConnectionArgs* conn_arg, pgFile *file,
796
734
else
797
735
{
798
736
/* TODO: stop handling errors internally */
799
- rc = copy_pages (conn_arg , to_fullpath ,from_fullpath ,file ,
737
+ rc = copy_pages (to_fullpath ,from_fullpath ,file ,
800
738
/* send prev backup START_LSN */
801
739
backup_mode == BACKUP_MODE_DIFF_DELTA &&
802
740
file -> exists_in_prev ?prev_backup_start_lsn :InvalidXLogRecPtr ,
@@ -1742,7 +1680,7 @@ check_data_file(ConnectionArgs *arguments, pgFile *file,
1742
1680
for (blknum = 0 ;blknum < nblocks ;blknum ++ )
1743
1681
{
1744
1682
PageState page_st ;
1745
- page_state = prepare_page (NULL , file ,InvalidXLogRecPtr ,
1683
+ page_state = prepare_page (file ,InvalidXLogRecPtr ,
1746
1684
blknum ,in ,BACKUP_MODE_FULL ,
1747
1685
curr_page , false,checksum_version ,
1748
1686
0 ,NULL ,from_fullpath ,& page_st );
@@ -2228,7 +2166,7 @@ send_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const char *from_f
2228
2166
while (blknum < file -> n_blocks )
2229
2167
{
2230
2168
PageState page_st ;
2231
- int rc = prepare_page (conn_arg , file ,prev_backup_start_lsn ,
2169
+ int rc = prepare_page (file ,prev_backup_start_lsn ,
2232
2170
blknum ,in ,backup_mode ,curr_page ,
2233
2171
true,checksum_version ,
2234
2172
ptrack_version_num ,ptrack_schema ,
@@ -2303,7 +2241,7 @@ send_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const char *from_f
2303
2241
2304
2242
/* copy local file (взята из send_pages, но используется простое копирование странички, без добавления заголовков и компрессии) */
2305
2243
int
2306
- copy_pages (ConnectionArgs * conn_arg , const char * to_fullpath ,const char * from_fullpath ,
2244
+ copy_pages (const char * to_fullpath ,const char * from_fullpath ,
2307
2245
pgFile * file ,XLogRecPtr prev_backup_start_lsn ,
2308
2246
uint32 checksum_version ,bool use_pagemap ,
2309
2247
BackupMode backup_mode ,int ptrack_version_num ,const char * ptrack_schema )
@@ -2358,7 +2296,7 @@ copy_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const char *from_f
2358
2296
while (blknum < file -> n_blocks )
2359
2297
{
2360
2298
PageState page_st ;
2361
- int rc = prepare_page (conn_arg , file ,prev_backup_start_lsn ,
2299
+ int rc = prepare_page (file ,prev_backup_start_lsn ,
2362
2300
blknum ,in ,backup_mode ,curr_page ,
2363
2301
true,checksum_version ,
2364
2302
ptrack_version_num ,ptrack_schema ,