Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32879 Fix issue with FileAttrLock being used on superfiles #19236

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading