Skip to content

Commit

Permalink
HPCC-32845 review change
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Oct 28, 2024
1 parent 8a51134 commit f1ffb34
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions thorlcr/thorutil/thormisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,31 +1709,30 @@ void saveWuidToFile(const char *wuid)
bool hasTLK(IDistributedFile &file, CActivityBase *activity)
{
unsigned np = file.numParts();
if (np<=1) // NB: a better test would be to only continue if this is a width that is +1 of group it's based on, but not worth checking
return false;
IDistributedFilePart &part = file.queryPart(np-1);
bool keyHasTlk = strisame("topLevelKey", part.queryAttributes().queryProp("@kind"));
if (!keyHasTlk)
{
// See HPCC-32845 - check if TLK flag is missing from TLK part
// It is very likely the last part should be a TLK. Even a local key (>1 parts) has a TLK by default (see buildLocalTlks)
if (np>1)
RemoteFilename rfn;
part.getFilename(rfn);
StringBuffer filename;
rfn.getPath(filename);
Owned<IKeyIndex> index = createKeyIndex(filename, 0, false, 0);
dbgassertex(index);
if (index->isTopLevelKey())
{
RemoteFilename rfn;
part.getFilename(rfn);
StringBuffer filename;
rfn.getPath(filename);
Owned<IKeyIndex> index = createKeyIndex(filename, 0, false, 0);
dbgassertex(index);
if (index->isTopLevelKey())
if (activity)
{
if (activity)
{
Owned<IException> e = MakeActivityException(activity, 0, "TLK file part of file %s is missing kind=\"topLevelKey\" flag. The meta data should be fixed!", file.queryLogicalName());
reportExceptionToWorkunitCheckIgnore(activity->queryJob().queryWorkUnit(), e, SeverityWarning);
StringBuffer errMsg;
UWARNLOG("%s", e->errorMessage(errMsg).str());
}
keyHasTlk = true;
Owned<IException> e = MakeActivityException(activity, 0, "TLK file part of file %s is missing kind=\"topLevelKey\" flag. The meta data should be fixed!", file.queryLogicalName());
reportExceptionToWorkunitCheckIgnore(activity->queryJob().queryWorkUnit(), e, SeverityWarning);
StringBuffer errMsg;
UWARNLOG("%s", e->errorMessage(errMsg).str());
}
keyHasTlk = true;
}
}
return keyHasTlk;
Expand Down

0 comments on commit f1ffb34

Please sign in to comment.