Commit 6e75897b authored by Christian Mohrbacher's avatar Christian Mohrbacher

updated to release 6.13

parent 76cf67e6
......@@ -49,7 +49,7 @@ chmod +x debian/rules
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -69,7 +69,7 @@ cd $builddir
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -52,7 +52,7 @@ chmod +x debian/rules
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -69,7 +69,7 @@ if [ ! -f ../*.deb ]; then
fi
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -6,6 +6,5 @@ public enum StripePatternEnum
{
STRIPE_PATTERN_INVALID,
STRIPE_PATTERN_RAID_0,
STRIPE_PATTERN_RAID_10,
STRIPE_PATTERN_BUDDY_MIRROR
}
......@@ -308,7 +308,7 @@
<Component class="javax.swing.JComboBox" name="jComboStripingStripePattern">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new javax.swing.DefaultComboBoxModel&lt;&gt;(new String[] { &quot;RAID 0&quot;, &quot;RAID 10&quot;, &quot;BuddyMirror&quot; })" type="code"/>
<Connection code="new javax.swing.DefaultComboBoxModel&lt;&gt;(new String[] { &quot;RAID 0&quot;, &quot;BuddyMirror&quot; })" type="code"/>
</Property>
</Properties>
<AuxValues>
......
......@@ -368,7 +368,7 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
jPanelStriping.add(jLabelStripingStripePattern, gridBagConstraints);
jComboStripingStripePattern.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "RAID 0", "RAID 10", "BuddyMirror" }));
jComboStripingStripePattern.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "RAID 0", "BuddyMirror" }));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
......@@ -538,12 +538,6 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame
JOptionPane.showMessageDialog(this, msg, "Error", JOptionPane.ERROR_MESSAGE);
}
else
if(pattern == StripePatternEnum.STRIPE_PATTERN_RAID_10.ordinal() )
{
String msg = "The strippe pattern RAID10 is not supported anymore!";
JOptionPane.showMessageDialog(this, msg, "Error", JOptionPane.ERROR_MESSAGE);
}
else
{
// get a nonce for authentication from server
XMLParser parser = new XMLParser(HttpTk.generateAdmonUrl("/XML_GetNonce"), THREAD_NAME);
......
......@@ -2,7 +2,7 @@ Source: beegfs-client
Section: misc
Priority: optional
Maintainer: BeeGFS Maintainers <packages@beegfs.com>
Build-Depends: debhelper (>= 7.0.0), lsb-release, module-init-tools
Build-Depends: debhelper (>= 7.0.0), lsb-release, kmod
Standards-Version: 3.8.0
Package: beegfs-client
......
......@@ -74,8 +74,8 @@ chmod +x debian/rules
# build the package and supress lintian warnings. Lintian in Lenny cannot
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
debuild -B -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
yes | debuild -B -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || yes | debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR="/tmp/beegfs-debs-$BEEGFS_VERSION"
......
......@@ -1316,12 +1316,21 @@ void FhgfsOpsCommKit_writefileV2bCommunicate(App* app, RemotingIOInfo* ioInfo,
static enum CKTargetBadAction __commkit_fsync_selectedTargetBad(CommKitContext* context,
struct CommKitTargetInfo* info, const CombinedTargetState* targetState)
{
if(targetState->consistencyState != TargetConsistencyState_BAD)
return CK_CONTINUE_TARGET;
if(StripePattern_getPatternType(context->ioInfo->pattern) == STRIPEPATTERN_BuddyMirror &&
// we must not try to fsync a secondary that is currently offline, but we should fsync
// secondaries that are needs-resync (because a resync might be running, but our file was already
// resynced). we will also try to fsync a secondary that is poffline, just in case it comes back
// to online.
// bad targets should be silently ignored just like offline targets because they might do
// who-knows-what with our request and produce spurious errors.
if (StripePattern_getPatternType(context->ioInfo->pattern) == STRIPEPATTERN_BuddyMirror &&
info->useBuddyMirrorSecond)
info->nodeResult = -FhgfsOpsErr_SUCCESS;
{
if (targetState->reachabilityState == TargetReachabilityState_OFFLINE ||
targetState->consistencyState == TargetConsistencyState_BAD)
info->nodeResult = -FhgfsOpsErr_SUCCESS;
else if (targetState->consistencyState == TargetConsistencyState_NEEDS_RESYNC)
return CK_CONTINUE_TARGET;
}
return CK_SKIP_TARGET;
}
......
......@@ -142,7 +142,7 @@ bool LocalConnWorker::processIncomingData(
return false;
}
NetMessage::ResponseContext rctx(NULL, workerEndpoint, bufOut, bufOutLen, &stats);
NetMessage::ResponseContext rctx(NULL, workerEndpoint, bufOut, bufOutLen, &stats, true);
bool processRes = msg->processIncoming(rctx);
if(!processRes)
{
......
......@@ -125,9 +125,9 @@ class NetMessage
public:
ResponseContext(struct sockaddr_in* fromAddr, Socket* sock, char* respBuf,
unsigned bufLen, HighResolutionStats* stats)
unsigned bufLen, HighResolutionStats* stats, bool locallyGenerated = false)
: fromAddr(fromAddr), socket(sock), responseBuffer(respBuf),
responseBufferLength(bufLen), stats(stats)
responseBufferLength(bufLen), stats(stats), locallyGenerated(locallyGenerated)
{}
void sendResponse(const NetMessage& response) const
......@@ -148,12 +148,15 @@ class NetMessage
return fromAddr ? Socket::ipaddrToStr(&fromAddr->sin_addr) : socket->getPeername();
}
bool isLocallyGenerated() const { return locallyGenerated; }
private:
struct sockaddr_in* fromAddr;
Socket* socket;
char* responseBuffer;
unsigned responseBufferLength;
HighResolutionStats* stats;
bool locallyGenerated;
};
/**
......
......@@ -27,6 +27,18 @@ class MetaStorageTk
META_INODES_LEVEL1_SUBDIR_NUM, META_INODES_LEVEL2_SUBDIR_NUM);
}
/**
* Get directory for a (non-inlined) inode.
*
* @param inodePath path to inodes subdir of general storage directory
* @param fileName entryID of the inode
*/
static std::pair<unsigned, unsigned> getMetaInodeHash(const std::string& fileName)
{
return StorageTk::getHash(fileName,
META_INODES_LEVEL1_SUBDIR_NUM, META_INODES_LEVEL2_SUBDIR_NUM);
}
/**
* Get path to a contents directory (i.e. the dir containing the dentries by name).
*
......
......@@ -384,6 +384,20 @@ class StorageTk
return path + "/" + getBaseHashPath(entryID, numHashesLevel1, numHashesLevel2);
}
/**
* @return (hashDir1, hashDir2)
*/
static std::pair<unsigned, unsigned> getHash(const std::string& entryID,
size_t numHashesLevel1, size_t numHashesLevel2)
{
uint16_t hashLevel1;
uint16_t hashLevel2;
getHashes(entryID, numHashesLevel1, numHashesLevel2, hashLevel1, hashLevel2);
return {hashLevel1, hashLevel2};
}
/**
* @return hashDir1/hashDir2/entryID
*/
......
......@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet
# NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean
[ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
......@@ -955,6 +955,19 @@ void ModeCheckFS::checkAndRepair()
return;
}
for (auto it = secondariesSetBad.begin(); it != secondariesSetBad.end(); ++it)
{
auto secondary = *it;
FsckTkEx::fsckOutput(">>> Setting metadata node " + StringTk::intToStr(secondary.val())
+ " to needs-resync", OutputOptions_LINEBREAK);
auto setRes = MsgHelperRepair::setNodeState(secondary, TargetConsistencyState_NEEDS_RESYNC);
if (setRes != FhgfsOpsErr_SUCCESS)
FsckTkEx::fsckOutput(std::string("Failed: ") + FhgfsOpsErrTk::toErrString(setRes),
OutputOptions_LINEBREAK);
}
if(errorCount > 0)
FsckTkEx::fsckOutput(">>> Found " + StringTk::int64ToStr(errorCount) + " errors <<< ",
OutputOptions_ADDLINEBREAKBEFORE | OutputOptions_LINEBREAK);
......@@ -990,7 +1003,8 @@ void ModeCheckFS::repairDanglingDirEntry(db::DirEntry& entry,
case FsckRepairAction_DELETEDENTRY: {
MsgHelperRepair::deleteDanglingDirEntries(fsckEntry.getSaveNodeID(),
fsckEntry.getIsBuddyMirrored(), &entries, &failedEntries);
fsckEntry.getIsBuddyMirrored(), &entries, &failedEntries,
secondariesSetBad);
if(failedEntries.empty() )
{
......@@ -1007,7 +1021,8 @@ void ModeCheckFS::repairDanglingDirEntry(db::DirEntry& entry,
// create mirrored inodes iff the dentry was mirrored. if a contdir with the same id exists,
// a previous check will have created an inode for it, leaving this dentry not dangling.
MsgHelperRepair::createDefDirInodes(fsckEntry.getSaveNodeID(), fsckEntry.getIsBuddyMirrored(),
{std::make_tuple(fsckEntry.getID(), fsckEntry.getIsBuddyMirrored())}, &createdInodes);
{std::make_tuple(fsckEntry.getID(), fsckEntry.getIsBuddyMirrored())}, &createdInodes,
secondariesSetBad);
this->database->getDirInodesTable()->insert(createdInodes);
......@@ -1038,7 +1053,7 @@ void ModeCheckFS::repairWrongInodeOwner(FsckDirInode& inode, UserPrompter& promp
FsckDirInodeList failed;
MsgHelperRepair::correctInodeOwners(inode.getSaveNodeID(), inode.getIsBuddyMirrored(),
&inodes, &failed);
&inodes, &failed, secondariesSetBad);
if(failed.empty() )
this->database->getDirInodesTable()->update(inodes);
......@@ -1073,7 +1088,8 @@ void ModeCheckFS::repairWrongInodeOwnerInDentry(std::pair<db::DirEntry, NumNodeI
FsckDirEntryList failed;
MsgHelperRepair::correctInodeOwnersInDentry(fsckEntry.getSaveNodeID(),
fsckEntry.getIsBuddyMirrored(), &dentries, &owners, &failed);
fsckEntry.getIsBuddyMirrored(), &dentries, &owners, &failed,
secondariesSetBad);
if(failed.empty() )
this->database->getDentryTable()->updateFieldsExceptParent(dentries);
......@@ -1109,7 +1125,7 @@ void ModeCheckFS::repairOrphanedDirInode(FsckDirInode& inode, UserPrompter& prom
FsckDirInodeList failed;
MsgHelperRepair::linkToLostAndFound(*this->lostAndFoundNode, &this->lostAndFoundInfo, &inodes,
&failed, &created);
&failed, &created, secondariesSetBad);
if(failed.empty() )
this->database->getDentryTable()->insert(created);
......@@ -1147,7 +1163,7 @@ void ModeCheckFS::repairOrphanedFileInode(FsckFileInode& inode, UserPrompter& pr
StringList failed;
MsgHelperRepair::deleteFileInodes(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), inodes,
failed);
failed, secondariesSetBad);
if(failed.empty() )
this->database->getFileInodesTable()->remove(inodes);
......@@ -1224,7 +1240,7 @@ void ModeCheckFS::repairMissingContDir(FsckDirInode& inode, UserPrompter& prompt
StringList failed;
MsgHelperRepair::createContDirs(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), &inodes,
&failed);
&failed, secondariesSetBad);
if(failed.empty() )
{
......@@ -1256,7 +1272,8 @@ void ModeCheckFS::repairOrphanedContDir(FsckContDir& dir, UserPrompter& prompt)
case FsckRepairAction_CREATEDEFAULTDIRINODE: {
FsckDirInodeList createdInodes;
MsgHelperRepair::createDefDirInodes(dir.getSaveNodeID(), dir.getIsBuddyMirrored(),
{std::make_tuple(dir.getID(), dir.getIsBuddyMirrored())}, &createdInodes);
{std::make_tuple(dir.getID(), dir.getIsBuddyMirrored())}, &createdInodes,
secondariesSetBad);
this->database->getDirInodesTable()->insert(createdInodes);
......@@ -1288,7 +1305,7 @@ void ModeCheckFS::repairWrongFileAttribs(std::pair<FsckFileInode, checks::InodeA
FsckFileInodeList failed;
MsgHelperRepair::updateFileAttribs(error.first.getSaveNodeID(),
error.first.getIsBuddyMirrored(), &inodes, &failed);
error.first.getIsBuddyMirrored(), &inodes, &failed, secondariesSetBad);
if(failed.empty() )
this->database->getFileInodesTable()->update(inodes);
......@@ -1325,7 +1342,7 @@ void ModeCheckFS::repairWrongDirAttribs(std::pair<FsckDirInode, checks::InodeAtt
error.first.setNumHardLinks(error.second.nlinks);
MsgHelperRepair::updateDirAttribs(error.first.getSaveNodeID(),
error.first.getIsBuddyMirrored(), &inodes, &failed);
error.first.getIsBuddyMirrored(), &inodes, &failed, secondariesSetBad);
if(failed.empty() )
this->database->getDirInodesTable()->update(inodes);
......@@ -1391,7 +1408,7 @@ void ModeCheckFS::repairDirEntryWithBrokenByIDFile(db::DirEntry& entry, UserProm
FsckDirEntryList failed;
MsgHelperRepair::recreateFsIDs(fsckEntry.getSaveNodeID(), fsckEntry.getIsBuddyMirrored(),
&dentries, &failed);
&dentries, &failed, secondariesSetBad);
if(failed.empty() )
{
......@@ -1430,7 +1447,7 @@ void ModeCheckFS::repairOrphanedDentryByIDFile(FsckFsID& id, UserPrompter& promp
FsckFileInodeList createdInodes;
MsgHelperRepair::recreateDentries(id.getSaveNodeID(), id.getIsBuddyMirrored(), &fsIDs,
&failed, &createdDentries, &createdInodes);
&failed, &createdDentries, &createdInodes, secondariesSetBad);
if(failed.empty() )
{
......
......@@ -49,6 +49,8 @@ class ModeCheckFS : public Mode
EntryInfo lostAndFoundInfo;
boost::shared_ptr<FsckDirInode> lostAndFoundInode;
std::set<NumNodeID> secondariesSetBad;
int initDatabase();
void printHeaderInformation();
void disposeUnusedFiles();
......
......@@ -29,6 +29,7 @@
#include <common/net/message/nodes/GetNodesRespMsg.h>
#include <common/net/message/nodes/GetTargetMappingsRespMsg.h>
#include <common/net/message/nodes/GetTargetStatesRespMsg.h>
#include <common/net/message/nodes/SetTargetConsistencyStatesRespMsg.h>
#include <net/message/nodes/HeartbeatMsgEx.h>
// storage messages
......@@ -71,6 +72,7 @@ NetMessage* NetMessageFactory::createFromMsgType(unsigned short msgType)
case NETMSGTYPE_GetMirrorBuddyGroupsResp: { msg = new GetMirrorBuddyGroupsRespMsg(); } break;
case NETMSGTYPE_GetTargetMappingsResp: { msg = new GetTargetMappingsRespMsg(); } break;
case NETMSGTYPE_GetTargetStatesResp: { msg = new GetTargetStatesRespMsg(); } break;
case NETMSGTYPE_SetTargetConsistencyStatesResp: { msg = new SetTargetConsistencyStatesRespMsg(); } break;
// storage messages
case NETMSGTYPE_FindOwnerResp: { msg = new FindOwnerRespMsg(); } break;
......
......@@ -25,6 +25,10 @@
#include <common/net/message/fsck/UpdateFileAttribsRespMsg.h>
#include <common/net/message/fsck/UpdateDirAttribsMsg.h>
#include <common/net/message/fsck/UpdateDirAttribsRespMsg.h>
#include <common/net/message/nodes/SetTargetConsistencyStatesMsg.h>
#include <common/net/message/nodes/SetTargetConsistencyStatesRespMsg.h>
#include <common/net/message/storage/creating/MkDirMsg.h>
#include <common/net/message/storage/creating/MkDirRespMsg.h>
#include <common/net/message/storage/creating/UnlinkFileMsg.h>
......@@ -39,8 +43,75 @@
#include "MsgHelperRepair.h"
template<typename RepairItemT>
static bool setSecondaryBad(uint16_t groupID, std::set<NumNodeID>& secondariesWithRepair,
const std::list<RepairItemT>& args, std::list<RepairItemT>& failed)
{
auto* bgm = Program::getApp()->getMetaMirrorBuddyGroupMapper();
NumNodeID secondary(bgm->getSecondaryTargetID(groupID));
if (secondariesWithRepair.count(secondary))
return true;
auto setRes = MsgHelperRepair::setNodeState(secondary, TargetConsistencyState_BAD);
if (setRes == FhgfsOpsErr_SUCCESS)
{
secondariesWithRepair.insert(NumNodeID(bgm->getSecondaryTargetID(groupID)));
return true;
}
LOG(ERR, "Failed to set secondary consistency state, not attempting repair action.",
groupID, setRes);
failed = args;
return false;
}
FhgfsOpsErr MsgHelperRepair::setNodeState(NumNodeID node, TargetConsistencyState state)
{
std::list<uint16_t> targets(1, node.val());
std::list<uint8_t> states(1, state);
SetTargetConsistencyStatesMsg msg(NODETYPE_Meta, &targets, &states, false);
{
char* respBuf;
NetMessage* respMsg;
auto secondary = Program::getApp()->getMetaNodes()->referenceNode(node);
auto commRes = MessagingTk::requestResponse(*secondary, &msg,
NETMSGTYPE_SetTargetConsistencyStatesResp, &respBuf, &respMsg);
if (commRes == FhgfsOpsErr_SUCCESS)
{
delete respMsg;
free(respBuf);
}
}
{
char* respBuf;
NetMessage* respMsg;
auto mgmt = Program::getApp()->getMgmtNodes()->referenceFirstNode();
auto commRes = MessagingTk::requestResponse(*mgmt, &msg,
NETMSGTYPE_SetTargetConsistencyStatesResp, &respBuf, &respMsg);
if (!commRes)
return FhgfsOpsErr_COMMUNICATION;
auto result = static_cast<SetTargetConsistencyStatesRespMsg*>(respMsg)->getResult();
delete respMsg;
free(respBuf);
return result;
}
}
void MsgHelperRepair::deleteDanglingDirEntries(NumNodeID node, bool isBuddyMirrored,
FsckDirEntryList* dentries, FsckDirEntryList* failedDeletes)
FsckDirEntryList* dentries, FsckDirEntryList* failedDeletes,
std::set<NumNodeID>& secondariesWithRepair)
{
DeleteDirEntriesMsg deleteDirEntriesMsg(dentries);
......@@ -48,7 +119,11 @@ void MsgHelperRepair::deleteDanglingDirEntries(NumNodeID node, bool isBuddyMirro
RequestResponseArgs rrArgs(nullptr, &deleteDirEntriesMsg, NETMSGTYPE_DeleteDirEntriesResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, *dentries, *failedDeletes))
return;
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -74,7 +149,8 @@ void MsgHelperRepair::deleteDanglingDirEntries(NumNodeID node, bool isBuddyMirro
}
void MsgHelperRepair::createDefDirInodes(NumNodeID node, bool isBuddyMirrored,
const std::vector<std::tuple<std::string, bool>>& entries, FsckDirInodeList* createdInodes)
const std::vector<std::tuple<std::string, bool>>& entries, FsckDirInodeList* createdInodes,
std::set<NumNodeID>& secondariesWithRepair)
{
StringList failedInodeIDs;
......@@ -84,7 +160,15 @@ void MsgHelperRepair::createDefDirInodes(NumNodeID node, bool isBuddyMirrored,
RequestResponseArgs rrArgs(nullptr, &createDefDirInodesMsgEx, NETMSGTYPE_CreateDefDirInodesResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, {}, *createdInodes))
{
for (auto it = entries.begin(); it != entries.end(); ++it)
failedInodeIDs.push_back(std::get<0>(*it));
return;
}
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -112,15 +196,20 @@ void MsgHelperRepair::createDefDirInodes(NumNodeID node, bool isBuddyMirrored,
}
void MsgHelperRepair::correctInodeOwnersInDentry(NumNodeID node, bool isBuddyMirrored,
FsckDirEntryList* dentries, NumNodeIDList* owners, FsckDirEntryList* failedCorrections)
FsckDirEntryList* dentries, NumNodeIDList* owners, FsckDirEntryList* failedCorrections,
std::set<NumNodeID>& secondariesWithRepair)
{
FixInodeOwnersInDentryMsg fixInodeOwnersMsg(*dentries, *owners);
RequestResponseNode rrNode(node, Program::getApp()->getMetaNodes());
RequestResponseArgs rrArgs(nullptr, &fixInodeOwnersMsg, NETMSGTYPE_FixInodeOwnersResp);
RequestResponseArgs rrArgs(nullptr, &fixInodeOwnersMsg, NETMSGTYPE_FixInodeOwnersInDentryResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, *dentries, *failedCorrections))
return;
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -146,7 +235,8 @@ void MsgHelperRepair::correctInodeOwnersInDentry(NumNodeID node, bool isBuddyMir
}
void MsgHelperRepair::correctInodeOwners(NumNodeID node, bool isBuddyMirrored,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections)
FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections,
std::set<NumNodeID>& secondariesWithRepair)
{
FixInodeOwnersMsg fixInodeOwnersMsg(dirInodes);
......@@ -154,7 +244,11 @@ void MsgHelperRepair::correctInodeOwners(NumNodeID node, bool isBuddyMirrored,
RequestResponseArgs rrArgs(nullptr, &fixInodeOwnersMsg, NETMSGTYPE_FixInodeOwnersResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, *dirInodes, *failedCorrections))
return;
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -355,10 +449,18 @@ bool MsgHelperRepair::createLostAndFound(NodeHandle& outReferencedNode,
}
void MsgHelperRepair::linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedInodes, FsckDirEntryList* createdDentries)
FsckDirInodeList* dirInodes, FsckDirInodeList* failedInodes, FsckDirEntryList* createdDentries,
std::set<NumNodeID>& secondariesWithRepair)
{
const char* logContext = "MsgHelperRepair (linkToLostAndFound)";
if (lostAndFoundInfo->getIsBuddyMirrored() &&
!setSecondaryBad(lostAndFoundInfo->getOwnerNodeID().val(), secondariesWithRepair,
{}, *createdDentries))
{
return;
}
bool commRes;
char *respBuf = NULL;
NetMessage *respMsg = NULL;
......@@ -402,10 +504,17 @@ void MsgHelperRepair::linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lost
void MsgHelperRepair::linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckFileInodeList* fileInodes, FsckFileInodeList* failedInodes,
FsckDirEntryList* createdDentries)
FsckDirEntryList* createdDentries, std::set<NumNodeID>& secondariesWithRepair)
{
const char* logContext = "MsgHelperRepair (linkToLostAndFound)";
if (lostAndFoundInfo->getIsBuddyMirrored() &&
!setSecondaryBad(lostAndFoundInfo->getOwnerNodeID().val(), secondariesWithRepair,
*fileInodes, *failedInodes))
{
return;
}
bool commRes;
char *respBuf = NULL;
NetMessage *respMsg = NULL;
......@@ -448,7 +557,7 @@ void MsgHelperRepair::linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lost
}
void MsgHelperRepair::createContDirs(NumNodeID node, bool isBuddyMirrored, FsckDirInodeList* inodes,
StringList* failedCreates)
StringList* failedCreates, std::set<NumNodeID>& secondariesWithRepair)
{
// create a string list with the IDs
std::vector<CreateEmptyContDirsMsg::Item> items;
......@@ -458,10 +567,18 @@ void MsgHelperRepair::createContDirs(NumNodeID node, bool isBuddyMirrored, FsckD
CreateEmptyContDirsMsg createContDirsMsg(std::move(items));
RequestResponseNode rrNode(node, Program::getApp()->getMetaNodes());
RequestResponseArgs rrArgs(nullptr, &createContDirsMsg, NETMSGTYPE_CreateEmptyContDirs);
RequestResponseArgs rrArgs(nullptr, &createContDirsMsg, NETMSGTYPE_CreateEmptyContDirsResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, {}, *failedCreates))
{
for (auto it = inodes->begin(); it != inodes->end(); ++it)
failedCreates->push_back(it->getID());
return;
}
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -488,7 +605,7 @@ void MsgHelperRepair::createContDirs(NumNodeID node, bool isBuddyMirrored, FsckD
}
void MsgHelperRepair::updateFileAttribs(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList* inodes,
FsckFileInodeList* failedUpdates)
FsckFileInodeList* failedUpdates, std::set<NumNodeID>& secondariesWithRepair)
{
UpdateFileAttribsMsg updateFileAttribsMsg(inodes);
......@@ -496,7 +613,11 @@ void MsgHelperRepair::updateFileAttribs(NumNodeID node, bool isBuddyMirrored, Fs
RequestResponseArgs rrArgs(nullptr, &updateFileAttribsMsg, NETMSGTYPE_UpdateFileAttribsResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, *inodes, *failedUpdates))
return;
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -521,7 +642,8 @@ void MsgHelperRepair::updateFileAttribs(NumNodeID node, bool isBuddyMirrored, Fs
}
void MsgHelperRepair::updateDirAttribs(NumNodeID node, bool isBuddyMirrored,
FsckDirInodeList* inodes, FsckDirInodeList* failedUpdates)
FsckDirInodeList* inodes, FsckDirInodeList* failedUpdates,
std::set<NumNodeID>& secondariesWithRepair)
{
UpdateDirAttribsMsg updateDirAttribsMsg(inodes);
......@@ -529,7 +651,11 @@ void MsgHelperRepair::updateDirAttribs(NumNodeID node, bool isBuddyMirrored,
RequestResponseArgs rrArgs(nullptr, &updateDirAttribsMsg, NETMSGTYPE_UpdateDirAttribsResp);
if (isBuddyMirrored)
{
rrNode.setMirrorInfo(Program::getApp()->getMetaMirrorBuddyGroupMapper(), false);
if (!setSecondaryBad(node.val(), secondariesWithRepair, *inodes, *failedUpdates))
return;
}
FhgfsOpsErr commRes = MessagingTk::requestResponseNode(&rrNode, &rrArgs);
......@@ -555,7 +681,8 @@ void MsgHelperRepair::updateDirAttribs(NumNodeID node, bool isBuddyMirrored,
}
void MsgHelperRepair::recreateFsIDs(NumNodeID node, bool isBuddyMirrored,
FsckDirEntryList* dentries, FsckDirEntryList* failedEntries)
FsckDirEntryList* dentries, FsckDirEntryList* failedEntries,
std::set<NumNodeID>& secondariesWithRepair)
{
const char* logContext = "MsgHelperRepair (recreateFsIDs)";
......@@ -565,7 +692,11 @@ void MsgHelperRepair::recreateFsIDs(NumNodeID node, bool isBuddyMirrored,