1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

Use pg_ptrack_get_block() only with ptrack <2.0.0

This commit is contained in:
Alexey Kondratov 2020-05-09 15:19:36 +03:00 committed by Grigory Smolkin
parent 23497fb78d
commit 8a6b5af297
2 changed files with 11 additions and 11 deletions

View File

@ -408,15 +408,12 @@ prepare_page(ConnectionArgs *conn_arg,
}
}
/* Get page via ptrack interface from PostgreSQL shared buffer.
* We do this in following cases:
* 1. PTRACK backup of 1.x versions
* 2. During backup, regardless of backup mode, of PostgreSQL instance
* with ptrack support we encountered invalid page.
/*
* Get page via ptrack interface from PostgreSQL shared buffer.
* We do this only in the cases of PTRACK 1.x versions backup
*/
if ((backup_mode == BACKUP_MODE_DIFF_PTRACK
if (backup_mode == BACKUP_MODE_DIFF_PTRACK
&& (ptrack_version_num >= 15 && ptrack_version_num < 20))
|| !page_is_valid)
{
int rc = 0;
size_t page_size = 0;
@ -440,7 +437,8 @@ prepare_page(ConnectionArgs *conn_arg,
memcpy(page, ptrack_page, BLCKSZ);
pg_free(ptrack_page);
/* UPD: It apprears that is possible to get zeroed page or page with invalid header
/*
* UPD: It apprears that is possible to get zeroed page or page with invalid header
* from shared buffer.
* Note, that getting page with wrong checksumm from shared buffer is
* acceptable.
@ -462,7 +460,8 @@ prepare_page(ConnectionArgs *conn_arg,
from_fullpath, blknum, errormsg);
}
/* We must set checksum here, because it is outdated
/*
* We must set checksum here, because it is outdated
* in the block recieved from shared buffers.
*/
if (checksum_version)

View File

@ -526,7 +526,7 @@ pg_ptrack_get_block(ConnectionArgs *arguments,
if (arguments->cancel_conn == NULL)
arguments->cancel_conn = PQgetCancel(arguments->conn);
//elog(LOG, "db %i pg_ptrack_get_block(%i, %i, %u)",dbOid, tblsOid, relOid, blknum);
// elog(LOG, "db %i pg_ptrack_get_block(%i, %i, %u)",dbOid, tblsOid, relOid, blknum);
if (ptrack_version_num < 20)
res = pgut_execute_parallel(arguments->conn,
@ -544,7 +544,8 @@ pg_ptrack_get_block(ConnectionArgs *arguments,
if (ptrack_version_num == 20)
sprintf(query, "SELECT %s.pg_ptrack_get_block($1, $2, $3, $4)", ptrack_schema);
else
sprintf(query, "SELECT %s.ptrack_get_block($1, $2, $3, $4)", ptrack_schema);
elog(ERROR, "ptrack >= 2.1.0 does not support pg_ptrack_get_block()");
// sprintf(query, "SELECT %s.ptrack_get_block($1, $2, $3, $4)", ptrack_schema);
res = pgut_execute_parallel(arguments->conn,
arguments->cancel_conn,