Index: release/package-release-nodes.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/release/package-release-nodes.php,v
retrieving revision 1.42
diff -u -p -r1.42 package-release-nodes.php
--- release/package-release-nodes.php	27 Feb 2009 23:11:16 -0000	1.42
+++ release/package-release-nodes.php	3 Mar 2009 18:13:51 -0000
@@ -147,11 +147,6 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 // We have to initialize the theme() system before we leave $drupal_root
 $hack = theme('placeholder', 'hack');
 
-// Set a variable so that on sites using DB replication, we ensure that all
-// our queries are against the primary database to avoid problems where the
-// connection to a secondary DB might timeout causing node_load() to fail.
-$_SESSION['not_slavesafe'] = TRUE;
-
 if ($task == 'check' || $task == 'repair') {
   verify_packages($task, $project_id);
 }
@@ -872,6 +867,11 @@ function package_release_update_node($ni
   // nodes in RAM, so we reset the node_load() cache each time we call it.
   $status = db_result(db_query("SELECT status from {node} WHERE nid = %d", $nid));
   if (empty($status)) {
+    // If the site is using DB replication, force this node_load() to use the
+    // primary database to avoid node_load() failures.
+    if (function_exists('db_set_ignore_slave')) {
+      db_set_ignore_slave();
+    }
     $node = node_load($nid, NULL, TRUE);
     if (!empty($node->nid)) {
       $node->status = 1;
