浏览代码

Merge branch 'candidate-5.4.2'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 年之前
父节点
当前提交
beddd27592

+ 14 - 24
dali/base/dadfs.cpp

@@ -3001,7 +3001,7 @@ public:
                     queryLogicalName(), superRepO);
     }
 
-    virtual void getSuperOwners(StringArray &owners)
+    void getSuperOwners(StringArray &owners)
     {
         if (root)
         {
@@ -4763,9 +4763,20 @@ class CDistributedSuperFile: public CDistributedFileBase<IDistributedSuperFile>
                 ForEach (*iter)
                 {
                     IDistributedFile *file = &iter->query();
-                    CDistributedFile *_file = QUERYINTERFACE(file, CDistributedFile);
+                    IDistributedSuperFile *super = file->querySuperFile();
                     StringArray owners;
-                    _file->getSuperOwners(owners);
+                    if (super)
+                    {
+                        CDistributedSuperFile *_super = QUERYINTERFACE(super, CDistributedSuperFile);
+                        if (_super)
+                            _super->getSuperOwners(owners);
+                    }
+                    else
+                    {
+                        CDistributedFile *_file = QUERYINTERFACE(file, CDistributedFile);
+                        if (_file)
+                            _file->getSuperOwners(owners);
+                    }
 
                     if (NotFound == owners.find(parentlname))
                         ThrowStringException(-1, "removeOwnedSubFiles: SuperFile %s, subfile %s - subfile not owned by superfile", parentlname.get(), file->queryLogicalName());
@@ -4935,27 +4946,6 @@ protected:
             throw exceptions.getClear();
     }
 
-    virtual void getSuperOwners(StringArray &owners)
-    {
-        ForEachItemIn(i, subfiles)
-        {
-            IDistributedFile *file = &subfiles.item(i);
-            IDistributedSuperFile *super = file->querySuperFile();
-            if (super)
-            {
-                CDistributedSuperFile *_super = QUERYINTERFACE(super, CDistributedSuperFile);
-                if (_super)
-                    _super->getSuperOwners(owners);
-            }
-            else
-            {
-                CDistributedFile *_file = QUERYINTERFACE(file, CDistributedFile);
-                if (_file)
-                    _file->getSuperOwners(owners);
-            }
-        }
-
-    }
     static StringBuffer &getSubPath(StringBuffer &path,unsigned idx)
     {
         return path.append("SubFile[@num=\"").append(idx+1).append("\"]");

+ 5 - 2
dali/base/dasds.cpp

@@ -2790,6 +2790,11 @@ public:
     }
     virtual void remove(SubscriptionId id)
     {
+        /* important to ensure have exclusive data lock on removal, ahead of subscriber lock
+         * as can get notifications whilst holding data lock, e.g. notifyDelete on node destruction.
+         */
+        CHECKEDDALIREADLOCKBLOCK(owner.dataRWLock, readWriteTimeout);
+        CHECKEDCRITICALBLOCK(owner.treeRegCrit, fakeCritTimeout);
         CriticalBlock b(lock);
         /* calls back out to owner to protect root/treereg.
          * It calls back into removeSubscriberAssociation.
@@ -8590,8 +8595,6 @@ void CCovenSDSManager::addNodeSubscriber(ISubscription *sub, SubscriptionId id)
 
 void CCovenSDSManager::removeNodeSubscriber(SubscriptionId id)
 {
-    CHECKEDDALIREADLOCKBLOCK(dataRWLock, readWriteTimeout);
-    CHECKEDCRITICALBLOCK(treeRegCrit, fakeCritTimeout);
     nodeSubscriptionManager->removeSubscriberAssociation(id);
 }
 

+ 3 - 2
docs/ECLLanguageReference/ECLR_mods/WkFlo-GLOBAL.xml

@@ -73,11 +73,12 @@
   <programlisting>I := RANDOM() : INDEPENDENT;  //calculated once, period
 G := RANDOM() : GLOBAL;       //calculated once in each graph
 
-ds := DATASET([{1,0,0},{2,0,0}],{UNSIGNED1 rec,UNSIGNED Ival, UNSIGNED Gval });
+ds := DATASET([{1,0,0,0},{2,0,0,0}],{UNSIGNED1 rec,UNSIGNED Ival, UNSIGNED Gval , UNSIGNED Aval });
 
 RECORDOF(ds) XF(ds L) := TRANSFORM
   SELF.Ival := I;
   SELF.Gval := G;
+  SELF.Aval := RANDOM();     //calculated each time used
   SELF := L;
 END;
 
@@ -85,7 +86,7 @@ P1 := PROJECT(ds,XF(left)) : PERSIST('~RTTEST::PERSIST::IndependentVsGlobal1');
 P2 := PROJECT(ds,XF(left)) : PERSIST('~RTTEST::PERSIST::IndependentVsGlobal2');
 
 OUTPUT(P1);    
-OUTPUT(P2);    //this gets the same Ival values as P1, but different Gval values
+OUTPUT(P2);    //this gets the same Ival values as P1, but the Gval value is different than P1
 </programlisting>
 
   <para>See Also: <link linkend="GLOBAL">GLOBAL function</link>, <link

+ 18 - 9
roxie/ccd/ccdstate.cpp

@@ -614,19 +614,28 @@ protected:
                 const char *name = super.queryProp("@id");
                 if (name)
                 {
-                    const IResolvedFile *resolved = lookupFileName(name, false, true, true, NULL, true);
-                    if (resolved)
+                    try
                     {
-                        files.append(*const_cast<IResolvedFile *>(resolved));
-                        doPreload(0, resolved);
-                        Owned<IPropertyTreeIterator> it = ccdChannels->getElements("RoxieSlaveProcess");
-                        ForEach(*it)
+                        const IResolvedFile *resolved = lookupFileName(name, false, true, true, NULL, true);
+                        if (resolved)
                         {
-                            unsigned channelNo = it->query().getPropInt("@channel", 0);
-                            assertex(channelNo);
-                            doPreload(channelNo, resolved);
+                            files.append(*const_cast<IResolvedFile *>(resolved));
+                            doPreload(0, resolved);
+                            Owned<IPropertyTreeIterator> it = ccdChannels->getElements("RoxieSlaveProcess");
+                            ForEach(*it)
+                            {
+                                unsigned channelNo = it->query().getPropInt("@channel", 0);
+                                assertex(channelNo);
+                                doPreload(channelNo, resolved);
+                            }
                         }
                     }
+                    catch (IException *E)
+                    {
+                        VStringBuffer msg("Failed to preload file %s for package node %s", name, queryId());
+                        EXCLOG(E, msg.str());
+                        E->Release();
+                    }
                 }
             }
         }

+ 1 - 0
rtl/eclrtl/rtlds_imp.hpp

@@ -154,6 +154,7 @@ public:
     inline void setown(byte * _row)     { dispose(); row = _row; }
     inline void set(const void * _row)  { rtlLinkRow(_row); setown(_row); }
     inline void setown(const void * _row)   { dispose(); row = static_cast<byte *>(const_cast<void *>(_row)); } // ugly - need to clean up const tracking in code generator
+    inline void set(const rtlRowAttr & other) { set(other.getbytes()); }
 
 protected:
     inline void dispose()               { rtlReleaseRow(row); }

+ 3 - 3
system/jhtree/jhtree.cpp

@@ -2869,7 +2869,7 @@ extern jhtree_decl IKeyManager *createSingleKeyMerger(IKeyIndex * _onekey, unsig
 
 class CKeyIndexSet : public CInterface, implements IKeyIndexSet
 {
-    IArrayOf<IKeyIndex> indexes;
+    IPointerArrayOf<IKeyIndex> indexes;
     offset_t recordCount;
     offset_t totalSize;
     StringAttr origFileName;
@@ -2878,9 +2878,9 @@ public:
     IMPLEMENT_IINTERFACE;
     
     virtual bool IsShared() const { return CInterface::IsShared(); }
-    void addIndex(IKeyIndex *i) { indexes.append(*i); }
+    void addIndex(IKeyIndex *i) { indexes.append(i); }
     virtual unsigned numParts() { return indexes.length(); }
-    virtual IKeyIndex *queryPart(unsigned partNo) { return &indexes.item(partNo); }
+    virtual IKeyIndex *queryPart(unsigned partNo) { return indexes.item(partNo); }
     virtual void setRecordCount(offset_t count) { recordCount = count; }
     virtual void setTotalSize(offset_t size) { totalSize = size; }
     virtual offset_t getRecordCount() { return recordCount; }