Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r20300: LJSUP-10124: [internal] Make user cluste...

Committer: gariev
LJSUP-10124: [internal] Make user cluster DB switching dynamically
U   trunk/cgi-bin/LJ/DBUtil.pm
Modified: trunk/cgi-bin/LJ/DBUtil.pm
===================================================================
--- trunk/cgi-bin/LJ/DBUtil.pm	2011-10-13 00:47:07 UTC (rev 20299)
+++ trunk/cgi-bin/LJ/DBUtil.pm	2011-10-13 01:10:33 UTC (rev 20300)
@@ -24,7 +24,8 @@
         if ($block && $block->data->{$cid}) {
             my $c = $block->data->{$cid};
             my $ab = ($c->{'active'} eq 'a') ? 'b' : 'a';
-            if ($c->{'dead'} && ($c->{'dead'} eq $ab) {
+            warn "$c->{'active'} is active, using $ab" if $verbose;
+            if ($c->{'dead'} && $c->{'dead'} eq $ab) {
                 ## oops, inactive db is dead
                 warn " inactivve DB $ab is marked dead";
                 return;
@@ -64,7 +65,7 @@
     my $clid = shift;
     my $verbose = shift;
     
-    my $dbr = LJ::DBUtil->get_inactive_db($clid);
+    my $dbr = LJ::DBUtil->get_inactive_db($clid, $verbose);
     unless ($dbr) {
         warn "Using master database for cluster #$clid"
             if $verbose;

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments