Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.0.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.2.x

Signed-off-by: Jake Smith <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	helm/hpcc/templates/dafilesrv.yaml
#	helm/hpcc/templates/dali.yaml
#	helm/hpcc/templates/dfuserver.yaml
#	helm/hpcc/templates/eclagent.yaml
#	helm/hpcc/templates/eclccserver.yaml
#	helm/hpcc/templates/eclscheduler.yaml
#	helm/hpcc/templates/esp.yaml
#	helm/hpcc/templates/localroxie.yaml
#	helm/hpcc/templates/roxie.yaml
#	helm/hpcc/templates/sasha.yaml
#	helm/hpcc/templates/thor.yaml
#	version.cmake
  • Loading branch information
jakesmith committed Jan 25, 2024
2 parents 628672e + f664f22 commit fd890cf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
43 changes: 33 additions & 10 deletions dali/dfu/dfuutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class CFileCloner
throw afor2.exc.getClear();
}

void updateCloneFrom(const char *lfn, IPropertyTree &attrs, IFileDescriptor *srcfdesc, INode *srcdali, const char *srcCluster)
void updateCloneFrom(const char *lfn, IPropertyTree &attrs, IFileDescriptor *srcfdesc, const IPropertyTree *srcTree, INode *srcdali, const char *srcCluster)
{
DBGLOG("updateCloneFrom %s", lfn);
if (!srcdali || srcdali->endpoint().isNull())
Expand All @@ -421,8 +421,17 @@ class CFileCloner
if (prefix.length())
attrs.setProp("@cloneFromPrefix", prefix.get());

while(attrs.removeProp("cloneFromGroup"));

// for now, only use source file descriptor as cloned source if it's from
// wsdfs file backed by remote storage using dafilesrv (NB: if it is '_remoteStoragePlane' will be set)
// JCSMORE: it may be this can replace the need for the other 'clone*' attributes altogether.
if (srcfdesc->queryProperties().hasProp("_remoteStoragePlane"))
{
attrs.setPropTree("cloneFromFDesc", createPTreeFromIPT(srcTree));
return;
}

while(attrs.removeProp("cloneFromGroup"));
unsigned numClusters = srcfdesc->numClusters();
for (unsigned clusterNum = 0; clusterNum < numClusters; clusterNum++)
{
Expand All @@ -438,15 +447,15 @@ class CFileCloner
}
}
}
void updateCloneFrom(IDistributedFile *dfile, IFileDescriptor *srcfdesc, INode *srcdali, const char *srcCluster)
void updateCloneFrom(IDistributedFile *dfile, IFileDescriptor *srcfdesc, const IPropertyTree *srcTree, INode *srcdali, const char *srcCluster)
{
DistributedFilePropertyLock lock(dfile);
IPropertyTree &attrs = lock.queryAttributes();
updateCloneFrom(dfile->queryLogicalName(), attrs, srcfdesc, srcdali, srcCluster);
updateCloneFrom(dfile->queryLogicalName(), attrs, srcfdesc, srcTree, srcdali, srcCluster);
}
void updateCloneFrom(const char *lfn, IFileDescriptor *dstfdesc, IFileDescriptor *srcfdesc, INode *srcdali, const char *srcCluster)
void updateCloneFrom(const char *lfn, IFileDescriptor *dstfdesc, IFileDescriptor *srcfdesc, const IPropertyTree *srcTree, INode *srcdali, const char *srcCluster)
{
updateCloneFrom(lfn, dstfdesc->queryProperties(), srcfdesc, srcdali, srcCluster);
updateCloneFrom(lfn, dstfdesc->queryProperties(), srcfdesc, srcTree, srcdali, srcCluster);
}

void cloneSubFile(IPropertyTree *ftree,const char *destfilename, INode *srcdali, const char *srcCluster) // name already has prefix added
Expand All @@ -455,7 +464,11 @@ class CFileCloner
const char * kind = srcfdesc->queryProperties().queryProp("@kind");
bool iskey = kind&&(strcmp(kind,"key")==0);

Owned<IFileDescriptor> dstfdesc = createFileDescriptor(srcfdesc->getProperties());
Owned<IPropertyTree> dstProps = createPTreeFromIPT(&srcfdesc->queryProperties());
// If present, we do not want this as part of the cloned properties of this new local roxie file
dstProps->removeProp("_remoteStoragePlane");
Owned<IFileDescriptor> dstfdesc = createFileDescriptor(dstProps.getClear());

if (!nameprefix.isEmpty())
dstfdesc->queryProperties().setProp("@roxiePrefix", nameprefix.get());
if (!copyphysical)
Expand Down Expand Up @@ -507,7 +520,7 @@ class CFileCloner
}

if (!copyphysical) //cloneFrom tells roxie where to copy from.. it's unnecessary if we already did the copy
updateCloneFrom(destfilename, dstfdesc, srcfdesc, srcdali, srcCluster);
updateCloneFrom(destfilename, dstfdesc, srcfdesc, ftree, srcdali, srcCluster);
else
{
DBGLOG("copyphysical dst=%s", destfilename);
Expand Down Expand Up @@ -771,7 +784,7 @@ class CFileCloner
{
Owned<IFileDescriptor> dstfdesc=dfile->getFileDescriptor();
Owned<IFileDescriptor> srcfdesc = deserializeFileDescriptorTree(ftree, NULL, 0);
updateCloneFrom(filename, dstfdesc, srcfdesc, srcdali, srcCluster);
updateCloneFrom(filename, dstfdesc, srcfdesc, ftree, srcdali, srcCluster);
}
return;
}
Expand Down Expand Up @@ -832,6 +845,16 @@ class CFileCloner
}
else
{
IPropertyTree *dstClonedFDesc = dfile->queryAttributes().queryPropTree("cloneFromFDesc");
IPropertyTree *srcClonedFDesc = srcfdesc->queryProperties().queryPropTree("cloneFromFDesc");
if (dstClonedFDesc && srcClonedFDesc)
{
// if both based on cloneFromFDesc, no need to check other varieties.
return !areMatchingPTrees(dstClonedFDesc, srcClonedFDesc);
}
else if (dstClonedFDesc || srcClonedFDesc) // one has cloneFromFDesc, the other doesn't
return true;
// else - neither based on cloneFromFDesc
StringBuffer s;
if (checkValueChanged(dfile->queryAttributes().queryProp("@cloneFrom"), srcdali->endpoint().getUrlStr(s).str()))
return true;
Expand Down Expand Up @@ -921,7 +944,7 @@ class CFileCloner
{
Owned<IFileDescriptor> srcfdesc = deserializeFileDescriptorTree(ftree, NULL, 0);
if (checkCloneFromChanged(dfile, srcfdesc, srcdali, srcCluster))
updateCloneFrom(dfile, srcfdesc, srcdali, srcCluster);
updateCloneFrom(dfile, srcfdesc, ftree, srcdali, srcCluster);
}
return;
}
Expand Down
9 changes: 8 additions & 1 deletion roxie/ccd/ccddali.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ class CRoxieDaliHelper : implements IRoxieDaliHelper, public CInterface

IFileDescriptor *recreateCloneSource(IFileDescriptor *srcfdesc, const char *destfilename)
{
IPropertyTree *clonedFDescTree = srcfdesc->queryProperties().queryPropTree("cloneFromFDesc");
if (clonedFDescTree)
{
Owned<IFileDescriptor> srcFDesc = deserializeFileDescriptorTree(clonedFDescTree);
return srcFDesc.getClear();
}

Owned<IFileDescriptor> dstfdesc = createFileDescriptor(srcfdesc->getProperties());
// calculate dest dir

Expand Down Expand Up @@ -596,7 +603,7 @@ class CRoxieDaliHelper : implements IRoxieDaliHelper, public CInterface
return resolveCachedLFN(foreignLfn); // Note - cache only used when no dali connection available
try
{
if (fdesc->queryProperties().hasProp("cloneFromGroup") && fdesc->queryProperties().hasProp("@cloneFromDir"))
if (fdesc->queryProperties().hasProp("cloneFromFDesc") || (fdesc->queryProperties().hasProp("cloneFromGroup") && fdesc->queryProperties().hasProp("@cloneFromDir")))
{
Owned<IFileDescriptor> ret = recreateCloneSource(fdesc, _lfn);
if (cacheIt)
Expand Down

0 comments on commit fd890cf

Please sign in to comment.