Skip to content

Commit

Permalink
Merge pull request #18458 from jakesmith/HPCC-31530-clearup-stale-lz-…
Browse files Browse the repository at this point in the history
…groups

HPCC-31530 Remove stale LZ groups

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Mar 28, 2024
2 parents 14dab01 + 8ce96c9 commit ca74c00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10525,6 +10525,18 @@ class CInitGroups
}
return true;
}
void clearLZGroups()
{
if (!writeLock)
throw makeStringException(0, "CInitGroups::clearLZGroups called in read-only mode");
IPropertyTree *root = groupsconnlock.conn->queryRoot();
std::vector<IPropertyTree *> toDelete;
Owned<IPropertyTreeIterator> groups = root->getElements("Group[@kind='dropzone']");
ForEach(*groups)
toDelete.push_back(&groups->query());
for (auto &group: toDelete)
root->removeTree(group);
}
void constructGroups(bool force, StringBuffer &messages, IPropertyTree *oldEnvironment)
{
Owned<IRemoteConnection> conn = querySDS().connect("/Environment/Software", myProcessSession(), RTM_LOCK_READ, SDS_CONNECT_TIMEOUT);
Expand Down Expand Up @@ -10717,12 +10729,14 @@ class CInitGroups
void initClusterGroups(bool force, StringBuffer &response, IPropertyTree *oldEnvironment, unsigned timems)
{
CInitGroups init(timems, true);
init.clearLZGroups(); // clear existing LZ groups, current ones will be recreated
init.constructGroups(force, response, oldEnvironment);
}

void initClusterAndStoragePlaneGroups(bool force, IPropertyTree *oldEnvironment, unsigned timems)
{
CInitGroups init(timems, true);
init.clearLZGroups(); // clear existing LZ groups, current ones will be recreated

StringBuffer response;
init.constructGroups(force, response, oldEnvironment);
Expand Down

0 comments on commit ca74c00

Please sign in to comment.