commit 281e292bb1edc082ac0cf4ab6ba6af11a1d21adc
parent 6b409f7c1f5b640108b5e4da56d819c43aee3ccd
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 11 Oct 2026 14:05:23 +0200
fail if destination is ahead of us
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c
@@ -663,6 +663,19 @@ transact (void)
if (table->start_serial == table->end_serial)
continue;
+ if (table->start_serial > table->end_serial)
+ {
+ /* The destination is ahead of the source: either we are copying
+ from the wrong database, or the source was restored from an old
+ backup. Either way, continuing would produce a bogus copy. */
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Destination is ahead of source for table `%s' (%llu > %llu); aborting\n",
+ rt_name (table->rt),
+ (unsigned long long) table->start_serial,
+ (unsigned long long) table->end_serial);
+ global_ret = EXIT_FAILURE;
+ return GNUNET_SYSERR;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Replicating table `%s' from %llu to %llu\n",
rt_name (table->rt),