Refuse to start if the bucardo database version does not match that of bucardo_ctl
authorGreg Sabino Mullane <greg@endpoint.com>
Tue, 24 Nov 2009 16:58:07 +0000 (11:58 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Tue, 24 Nov 2009 16:58:07 +0000 (11:58 -0500)
Changes
bucardo_ctl

diff --git a/Changes b/Changes
index 7830d10b73d614e20c986aa5bc9c547b80336680..ed98efac5fabc934a91c355d2d139a60f891cc77 100644 (file)
--- a/Changes
+++ b/Changes
@@ -33,6 +33,9 @@ Bucardo version 4.5.0
 
   - Better formatting of bucardo.reason.log, and log startup failures. [GSM]
 
+  - Refuse to start if the bucardo database version does not match that of 
+    bucardo_ctl (the former is set by 'bucardo_ctl upgrade') [GSM]
+
 Bucardo version 4.4.0, released October 14, 2009
 
   - Allow validate_goat() to work correctly against pgbouncer databases by 
index 967e998aafd972357ef21059518fae73828e009f..fa29bf445c4aab53c2714837e25617de5d6743c3 100755 (executable)
@@ -580,6 +580,15 @@ sub start {
                exit 1;
        }
 
+       my $dbversion = get_config('bucardo_current_version') or die "Could not find Bucardo version!\n";
+       if ($dbversion ne $VERSION) {
+               $nouns = "Version mismatch: bucardo_ctl is $VERSION, but bucardo database is $dbversion\n";
+               append_reason_file('fail');
+               warn $nouns;
+               warn "Perhaps you need to run 'bucardo_ctl upgrade' ?\n";
+               exit 1;
+       }
+
        ## Create a new Bucardo instance and connect to its database
        require Bucardo;
        my $bc = Bucardo->new($bcargs);