Skip to content

Commit

Permalink
Merge pull request #19236 from shamser/issue32879
Browse files Browse the repository at this point in the history
HPCC-32879 Fix issue with FileAttrLock being used on superfiles

Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Oct 31, 2024
2 parents 0c52dfc + d4c4918 commit 17916ae
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2912,7 +2912,7 @@ class CDistributedFileBase : implements INTERFACE, public CInterface
if (history)
queryAttributes().removeTree(history);
}
void lockFileAttrLock(CFileAttrLock & attrLock)
virtual void lockFileAttrLock(CFileAttrLock & attrLock)
{
if (!attrLock.init(logicalName, DXB_File, RTM_LOCK_WRITE, conn, defaultTimeout, "CDistributedFile::lockFileAttrLock"))
{
Expand Down Expand Up @@ -6482,6 +6482,19 @@ class CDistributedSuperFile: public CDistributedFileBase<IDistributedSuperFile>
return new cSubFileIterator(subfiles,supersub);
}

virtual void lockFileAttrLock(CFileAttrLock & attrLock) override
{
if (!attrLock.init(logicalName, DXB_SuperFile, RTM_LOCK_WRITE, conn, defaultTimeout, "CDistributedFile::lockFileAttrLock"))
{
// In unlikely event File/Attr doesn't exist, must ensure created, commited and root connection is reloaded.
verifyex(attrLock.init(logicalName, DXB_SuperFile, RTM_LOCK_WRITE|RTM_CREATE_QUERY, conn, defaultTimeout, "CDistributedFile::lockFileAttrLock"));
attrLock.commit();
conn->commit();
conn->reload();
root.setown(conn->getRoot());
}
}

void updateFileAttrs()
{
if (subfiles.ordinality()==0) {
Expand Down

0 comments on commit 17916ae

Please sign in to comment.