浏览代码

HPCC-8803 Directories hpcc-data2 and hpcc-data3 don't get used

Fix incorrect reporting of invalid topology in 'overloaded' mode.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 年之前
父节点
当前提交
fe4338a8a5
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 3 6
      roxie/ccd/ccdmain.cpp

+ 3 - 6
roxie/ccd/ccdmain.cpp

@@ -316,8 +316,9 @@ void addSlaveChannel(unsigned channel, unsigned level, bool suspended)
     IPropertyTree *ci = createPTree("RoxieSlaveProcess");
     ci->setPropInt("@channel", channel);
     ci->setPropBool("@suspended", suspended);
-    ci->setPropInt("@subChannel", numSlaves[channel]);
+    ci->setPropInt("@subChannel", numSlaves[channel]);   // Alternatively could probably use replication level as subchannel ?
     suspendedChannels[channel] = suspended;
+    assertex(!replicationLevel[channel]);  // implies channel repeated, caught above
     replicationLevel[channel] = level;
     ccdChannels->addPropTree("RoxieSlaveProcess", ci);
 }
@@ -913,7 +914,6 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
             }
         }
         Owned<IPropertyTreeIterator> slaves = topology->getElements("./RoxieSlaveProcess");
-        unsigned slaveCount = 0;
         IpAddress *primaries = new IpAddress[numChannels+1];    // check each channel has a different primary, if possible. Leaks on fatal errors, but who cares
         ForEach(*slaves)
         {
@@ -934,10 +934,7 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
                     if (isMe)
                         isCCD = true;
                     if (!replicationLevel)
-                    {
                         primaries[channel] = slaveIp;
-                        slaveCount++;
-                    }
                     addChannel(channel, replicationLevel, isMe, suspended, slaveIp);
                     if (isMe)
                         joinMulticastChannel(channel);
@@ -953,7 +950,7 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
 
         for (unsigned n = 1; n < numActiveChannels; n++)
         {
-            if (primaries[n].isNull())
+            if (!numSlaves[n])
                 throw MakeStringException(MSGAUD_operator, ROXIE_INVALID_TOPOLOGY, "Invalid topology file - no slaves for channel %d", n);
             if (checkPrimaries)
             {