Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29f28e5

Browse files
committed
Disable incremental backups with ptrack 1.X, as it is unsafe.
Instead of throwing an error, throw a warning and fall back to performing DELTA backup, as we don't want to break existing scripts.
1 parent 93f0f5e commit 29f28e5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/ptrack.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,21 @@ get_ptrack_version(PGconn *backup_conn, PGNodeInfo *nodeInfo)
202202
else if (strcmp(ptrack_version_str, "2.1") == 0)
203203
nodeInfo->ptrack_version_num = 21;
204204
else
205-
elog(WARNING, "Update your ptrack to the version 1.5 or upper. Current version is %s",
205+
elog(WARNING, "Update your ptrack to the version 2.1 or upper. Current version is %s",
206206
ptrack_version_str);
207207

208+
/* ptrack 1.X is buggy, so fall back to DELTA backup strategy for safety */
209+
if (nodeInfo->ptrack_version_num >= 15 && nodeInfo->ptrack_version_num < 20)
210+
{
211+
if (current.backup_mode == BACKUP_MODE_DIFF_PTRACK)
212+
{
213+
elog(WARNING, "Update your ptrack to the version 2.1 or upper. Current version is %s. "
214+
"Fall back to DELTA backup.",
215+
ptrack_version_str);
216+
current.backup_mode = BACKUP_MODE_DIFF_DELTA;
217+
}
218+
}
219+
208220
PQclear(res_db);
209221
}
210222

0 commit comments

Comments
 (0)