@@ -276,8 +276,7 @@ get_checksum_errormsg(Page page, char **errormsg, BlockNumber absolute_blkno)
276276 * return it to the caller
277277 */
278278static 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 ,
281280BlockNumber blknum ,FILE * in ,
282281BackupMode backup_mode ,
283282Page page ,bool strict ,
@@ -395,66 +394,6 @@ prepare_page(ConnectionArgs *conn_arg,
395394return PageIsOk ;
396395}
397396
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-
458397/*
459398 * Skip page if page lsn is less than START_LSN of parent backup.
460399 * Nullified pages must be copied by DELTA backup, just to be safe.
@@ -714,12 +653,11 @@ backup_data_file(ConnectionArgs* conn_arg, pgFile *file,
714653 * backup with special header.
715654 */
716655void
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 ,
719657XLogRecPtr prev_backup_start_lsn ,BackupMode backup_mode ,
720658CompressAlg calg ,int clevel ,uint32 checksum_version ,
721659int ptrack_version_num ,const char * ptrack_schema ,
722- HeaderMap * hdr_map , bool is_merge )
660+ bool is_merge )
723661{
724662int rc ;
725663bool use_pagemap ;
@@ -796,7 +734,7 @@ catchup_data_file(ConnectionArgs* conn_arg, pgFile *file,
796734else
797735{
798736/* 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 ,
800738/* send prev backup START_LSN */
801739backup_mode == BACKUP_MODE_DIFF_DELTA &&
802740file -> exists_in_prev ?prev_backup_start_lsn :InvalidXLogRecPtr ,
@@ -1742,7 +1680,7 @@ check_data_file(ConnectionArgs *arguments, pgFile *file,
17421680for (blknum = 0 ;blknum < nblocks ;blknum ++ )
17431681{
17441682PageState page_st ;
1745- page_state = prepare_page (NULL , file ,InvalidXLogRecPtr ,
1683+ page_state = prepare_page (file ,InvalidXLogRecPtr ,
17461684blknum ,in ,BACKUP_MODE_FULL ,
17471685curr_page , false,checksum_version ,
174816860 ,NULL ,from_fullpath ,& page_st );
@@ -2228,7 +2166,7 @@ send_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const char *from_f
22282166while (blknum < file -> n_blocks )
22292167{
22302168PageState page_st ;
2231- int rc = prepare_page (conn_arg , file ,prev_backup_start_lsn ,
2169+ int rc = prepare_page (file ,prev_backup_start_lsn ,
22322170blknum ,in ,backup_mode ,curr_page ,
22332171 true,checksum_version ,
22342172ptrack_version_num ,ptrack_schema ,
@@ -2303,7 +2241,7 @@ send_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const char *from_f
23032241
23042242/* copy local file (взята из send_pages, но используется простое копирование странички, без добавления заголовков и компрессии) */
23052243int
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 ,
23072245pgFile * file ,XLogRecPtr prev_backup_start_lsn ,
23082246uint32 checksum_version ,bool use_pagemap ,
23092247BackupMode 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
23582296while (blknum < file -> n_blocks )
23592297{
23602298PageState page_st ;
2361- int rc = prepare_page (conn_arg , file ,prev_backup_start_lsn ,
2299+ int rc = prepare_page (file ,prev_backup_start_lsn ,
23622300blknum ,in ,backup_mode ,curr_page ,
23632301 true,checksum_version ,
23642302ptrack_version_num ,ptrack_schema ,