Skip to content

Commit 884dd52

Browse files
committed
[Issue #204] Enforce "no-forward-compatibility" policy on remote agent
1 parent 612e928 commit 884dd52

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pg_probackup.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ main(int argc, char *argv[])
345345
#endif
346346
else if (strcmp(argv[1], "agent") == 0)
347347
{
348+
/* 'No forward compatibility' sanity:
349+
* /old/binary -> ssh execute -> /newer/binary agent version_num
350+
* If we are executed as an agent for older binary, then exit with error
351+
*/
352+
if (argc > 2)
353+
{
354+
elog(ERROR, "Version mismatch, pg_probackup binary with version '%s' "
355+
"is launched as an agent for pg_probackup binary with version '%s'",
356+
PROGRAM_VERSION, argv[2]);
357+
}
348358
fio_communicate(STDIN_FILENO, STDOUT_FILENO);
349359
return 0;
350360
}

0 commit comments

Comments
 (0)