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 ...@@ -49,7 +49,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -69,7 +69,7 @@ cd $builddir ...@@ -69,7 +69,7 @@ cd $builddir
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -53,7 +53,7 @@ chmod +x debian/rules ...@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -53,7 +53,7 @@ chmod +x debian/rules ...@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -52,7 +52,7 @@ chmod +x debian/rules ...@@ -52,7 +52,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -69,7 +69,7 @@ if [ ! -f ../*.deb ]; then ...@@ -69,7 +69,7 @@ if [ ! -f ../*.deb ]; then
fi fi
debuild clean [ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -6,6 +6,5 @@ public enum StripePatternEnum ...@@ -6,6 +6,5 @@ public enum StripePatternEnum
{ {
STRIPE_PATTERN_INVALID, STRIPE_PATTERN_INVALID,
STRIPE_PATTERN_RAID_0, STRIPE_PATTERN_RAID_0,
STRIPE_PATTERN_RAID_10,
STRIPE_PATTERN_BUDDY_MIRROR STRIPE_PATTERN_BUDDY_MIRROR
} }
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<Component class="javax.swing.JComboBox" name="jComboStripingStripePattern"> <Component class="javax.swing.JComboBox" name="jComboStripingStripePattern">
<Properties> <Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> <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> </Property>
</Properties> </Properties>
<AuxValues> <AuxValues>
......
...@@ -368,7 +368,7 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame ...@@ -368,7 +368,7 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
jPanelStriping.add(jLabelStripingStripePattern, gridBagConstraints); 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 = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3; gridBagConstraints.gridy = 3;
...@@ -538,12 +538,6 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame ...@@ -538,12 +538,6 @@ public class JInternalFrameStriping extends javax.swing.JInternalFrame
JOptionPane.showMessageDialog(this, msg, "Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(this, msg, "Error", JOptionPane.ERROR_MESSAGE);
} }
else 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 // get a nonce for authentication from server
XMLParser parser = new XMLParser(HttpTk.generateAdmonUrl("/XML_GetNonce"), THREAD_NAME); XMLParser parser = new XMLParser(HttpTk.generateAdmonUrl("/XML_GetNonce"), THREAD_NAME);
......
...@@ -2,7 +2,7 @@ Source: beegfs-client ...@@ -2,7 +2,7 @@ Source: beegfs-client
Section: misc Section: misc
Priority: optional Priority: optional
Maintainer: BeeGFS Maintainers <packages@beegfs.com> 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 Standards-Version: 3.8.0
Package: beegfs-client Package: beegfs-client
......
...@@ -74,8 +74,8 @@ chmod +x debian/rules ...@@ -74,8 +74,8 @@ chmod +x debian/rules
# build the package and supress lintian warnings. Lintian in Lenny cannot # build the package and supress lintian warnings. Lintian in Lenny cannot
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
debuild -B -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" yes | debuild -B -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir"
debuild clean [ "${DEBIAN_VERSION}" = "9" ] && yes | debuild -- clean || yes | debuild clean
if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR="/tmp/beegfs-debs-$BEEGFS_VERSION" DEBIAN_ARCHIVE_DIR="/tmp/beegfs-debs-$BEEGFS_VERSION"
......
...@@ -1316,12 +1316,21 @@ void FhgfsOpsCommKit_writefileV2bCommunicate(App* app, RemotingIOInfo* ioInfo, ...@@ -1316,12 +1316,21 @@ void FhgfsOpsCommKit_writefileV2bCommunicate(App* app, RemotingIOInfo* ioInfo,
static enum CKTargetBadAction __commkit_fsync_selectedTargetBad(CommKitContext* context, static enum CKTargetBadAction __commkit_fsync_selectedTargetBad(CommKitContext* context,
struct CommKitTargetInfo* info, const CombinedTargetState* targetState) struct CommKitTargetInfo* info, const CombinedTargetState* targetState)
{ {
if(targetState->consistencyState != TargetConsistencyState_BAD) // we must not try to fsync a secondary that is currently offline, but we should fsync
return CK_CONTINUE_TARGET; // 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
if(StripePattern_getPatternType(context->ioInfo->pattern) == STRIPEPATTERN_BuddyMirror && // 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->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; return CK_SKIP_TARGET;
} }
......
...@@ -142,7 +142,7 @@ bool LocalConnWorker::processIncomingData( ...@@ -142,7 +142,7 @@ bool LocalConnWorker::processIncomingData(
return false; return false;
} }
NetMessage::ResponseContext rctx(NULL, workerEndpoint, bufOut, bufOutLen, &stats); NetMessage::ResponseContext rctx(NULL, workerEndpoint, bufOut, bufOutLen, &stats, true);
bool processRes = msg->processIncoming(rctx); bool processRes = msg->processIncoming(rctx);
if(!processRes) if(!processRes)
{ {
......
...@@ -125,9 +125,9 @@ class NetMessage ...@@ -125,9 +125,9 @@ class NetMessage
public: public:
ResponseContext(struct sockaddr_in* fromAddr, Socket* sock, char* respBuf, 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), : fromAddr(fromAddr), socket(sock), responseBuffer(respBuf),
responseBufferLength(bufLen), stats(stats) responseBufferLength(bufLen), stats(stats), locallyGenerated(locallyGenerated)
{} {}
void sendResponse(const NetMessage& response) const void sendResponse(const NetMessage& response) const
...@@ -148,12 +148,15 @@ class NetMessage ...@@ -148,12 +148,15 @@ class NetMessage
return fromAddr ? Socket::ipaddrToStr(&fromAddr->sin_addr) : socket->getPeername(); return fromAddr ? Socket::ipaddrToStr(&fromAddr->sin_addr) : socket->getPeername();
} }
bool isLocallyGenerated() const { return locallyGenerated; }
private: private:
struct sockaddr_in* fromAddr; struct sockaddr_in* fromAddr;
Socket* socket; Socket* socket;
char* responseBuffer; char* responseBuffer;
unsigned responseBufferLength; unsigned responseBufferLength;
HighResolutionStats* stats; HighResolutionStats* stats;
bool locallyGenerated;
}; };
/** /**
......
...@@ -27,6 +27,18 @@ class MetaStorageTk ...@@ -27,6 +27,18 @@ class MetaStorageTk
META_INODES_LEVEL1_SUBDIR_NUM, META_INODES_LEVEL2_SUBDIR_NUM); 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). * Get path to a contents directory (i.e. the dir containing the dentries by name).
* *
......
...@@ -384,6 +384,20 @@ class StorageTk ...@@ -384,6 +384,20 @@ class StorageTk
return path + "/" + getBaseHashPath(entryID, numHashesLevel1, numHashesLevel2); 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 * @return hashDir1/hashDir2/entryID
*/ */
......
...@@ -53,7 +53,7 @@ chmod +x debian/rules ...@@ -53,7 +53,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc) # NOTE: package not signed yet! (-us -uc)
yes | debuild -us -uc 2>&1 | egrep -v "dir-or-file-in-opt | file-in-unusual-dir" 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 if [ -z "$DEBIAN_ARCHIVE_DIR" ]; then
DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX` DEBIAN_ARCHIVE_DIR=`mktemp -d /tmp/debian_archive.XXXXXXXXX`
......
...@@ -955,6 +955,19 @@ void ModeCheckFS::checkAndRepair() ...@@ -955,6 +955,19 @@ void ModeCheckFS::checkAndRepair()
return; 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) if(errorCount > 0)
FsckTkEx::fsckOutput(">>> Found " + StringTk::int64ToStr(errorCount) + " errors <<< ", FsckTkEx::fsckOutput(">>> Found " + StringTk::int64ToStr(errorCount) + " errors <<< ",
OutputOptions_ADDLINEBREAKBEFORE | OutputOptions_LINEBREAK); OutputOptions_ADDLINEBREAKBEFORE | OutputOptions_LINEBREAK);
...@@ -990,7 +1003,8 @@ void ModeCheckFS::repairDanglingDirEntry(db::DirEntry& entry, ...@@ -990,7 +1003,8 @@ void ModeCheckFS::repairDanglingDirEntry(db::DirEntry& entry,
case FsckRepairAction_DELETEDENTRY: { case FsckRepairAction_DELETEDENTRY: {
MsgHelperRepair::deleteDanglingDirEntries(fsckEntry.getSaveNodeID(), MsgHelperRepair::deleteDanglingDirEntries(fsckEntry.getSaveNodeID(),
fsckEntry.getIsBuddyMirrored(), &entries, &failedEntries); fsckEntry.getIsBuddyMirrored(), &entries, &failedEntries,
secondariesSetBad);
if(failedEntries.empty() ) if(failedEntries.empty() )
{ {
...@@ -1007,7 +1021,8 @@ void ModeCheckFS::repairDanglingDirEntry(db::DirEntry& entry, ...@@ -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, // 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. // a previous check will have created an inode for it, leaving this dentry not dangling.
MsgHelperRepair::createDefDirInodes(fsckEntry.getSaveNodeID(), fsckEntry.getIsBuddyMirrored(), 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); this->database->getDirInodesTable()->insert(createdInodes);
...@@ -1038,7 +1053,7 @@ void ModeCheckFS::repairWrongInodeOwner(FsckDirInode& inode, UserPrompter& promp ...@@ -1038,7 +1053,7 @@ void ModeCheckFS::repairWrongInodeOwner(FsckDirInode& inode, UserPrompter& promp
FsckDirInodeList failed; FsckDirInodeList failed;
MsgHelperRepair::correctInodeOwners(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), MsgHelperRepair::correctInodeOwners(inode.getSaveNodeID(), inode.getIsBuddyMirrored(),
&inodes, &failed); &inodes, &failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getDirInodesTable()->update(inodes); this->database->getDirInodesTable()->update(inodes);
...@@ -1073,7 +1088,8 @@ void ModeCheckFS::repairWrongInodeOwnerInDentry(std::pair<db::DirEntry, NumNodeI ...@@ -1073,7 +1088,8 @@ void ModeCheckFS::repairWrongInodeOwnerInDentry(std::pair<db::DirEntry, NumNodeI
FsckDirEntryList failed; FsckDirEntryList failed;
MsgHelperRepair::correctInodeOwnersInDentry(fsckEntry.getSaveNodeID(), MsgHelperRepair::correctInodeOwnersInDentry(fsckEntry.getSaveNodeID(),
fsckEntry.getIsBuddyMirrored(), &dentries, &owners, &failed); fsckEntry.getIsBuddyMirrored(), &dentries, &owners, &failed,
secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getDentryTable()->updateFieldsExceptParent(dentries); this->database->getDentryTable()->updateFieldsExceptParent(dentries);
...@@ -1109,7 +1125,7 @@ void ModeCheckFS::repairOrphanedDirInode(FsckDirInode& inode, UserPrompter& prom ...@@ -1109,7 +1125,7 @@ void ModeCheckFS::repairOrphanedDirInode(FsckDirInode& inode, UserPrompter& prom
FsckDirInodeList failed; FsckDirInodeList failed;
MsgHelperRepair::linkToLostAndFound(*this->lostAndFoundNode, &this->lostAndFoundInfo, &inodes, MsgHelperRepair::linkToLostAndFound(*this->lostAndFoundNode, &this->lostAndFoundInfo, &inodes,
&failed, &created); &failed, &created, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getDentryTable()->insert(created); this->database->getDentryTable()->insert(created);
...@@ -1147,7 +1163,7 @@ void ModeCheckFS::repairOrphanedFileInode(FsckFileInode& inode, UserPrompter& pr ...@@ -1147,7 +1163,7 @@ void ModeCheckFS::repairOrphanedFileInode(FsckFileInode& inode, UserPrompter& pr
StringList failed; StringList failed;
MsgHelperRepair::deleteFileInodes(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), inodes, MsgHelperRepair::deleteFileInodes(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), inodes,
failed); failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getFileInodesTable()->remove(inodes); this->database->getFileInodesTable()->remove(inodes);
...@@ -1224,7 +1240,7 @@ void ModeCheckFS::repairMissingContDir(FsckDirInode& inode, UserPrompter& prompt ...@@ -1224,7 +1240,7 @@ void ModeCheckFS::repairMissingContDir(FsckDirInode& inode, UserPrompter& prompt
StringList failed; StringList failed;
MsgHelperRepair::createContDirs(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), &inodes, MsgHelperRepair::createContDirs(inode.getSaveNodeID(), inode.getIsBuddyMirrored(), &inodes,
&failed); &failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
{ {
...@@ -1256,7 +1272,8 @@ void ModeCheckFS::repairOrphanedContDir(FsckContDir& dir, UserPrompter& prompt) ...@@ -1256,7 +1272,8 @@ void ModeCheckFS::repairOrphanedContDir(FsckContDir& dir, UserPrompter& prompt)
case FsckRepairAction_CREATEDEFAULTDIRINODE: { case FsckRepairAction_CREATEDEFAULTDIRINODE: {
FsckDirInodeList createdInodes; FsckDirInodeList createdInodes;
MsgHelperRepair::createDefDirInodes(dir.getSaveNodeID(), dir.getIsBuddyMirrored(), 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); this->database->getDirInodesTable()->insert(createdInodes);
...@@ -1288,7 +1305,7 @@ void ModeCheckFS::repairWrongFileAttribs(std::pair<FsckFileInode, checks::InodeA ...@@ -1288,7 +1305,7 @@ void ModeCheckFS::repairWrongFileAttribs(std::pair<FsckFileInode, checks::InodeA
FsckFileInodeList failed; FsckFileInodeList failed;
MsgHelperRepair::updateFileAttribs(error.first.getSaveNodeID(), MsgHelperRepair::updateFileAttribs(error.first.getSaveNodeID(),
error.first.getIsBuddyMirrored(), &inodes, &failed); error.first.getIsBuddyMirrored(), &inodes, &failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getFileInodesTable()->update(inodes); this->database->getFileInodesTable()->update(inodes);
...@@ -1325,7 +1342,7 @@ void ModeCheckFS::repairWrongDirAttribs(std::pair<FsckDirInode, checks::InodeAtt ...@@ -1325,7 +1342,7 @@ void ModeCheckFS::repairWrongDirAttribs(std::pair<FsckDirInode, checks::InodeAtt
error.first.setNumHardLinks(error.second.nlinks); error.first.setNumHardLinks(error.second.nlinks);
MsgHelperRepair::updateDirAttribs(error.first.getSaveNodeID(), MsgHelperRepair::updateDirAttribs(error.first.getSaveNodeID(),
error.first.getIsBuddyMirrored(), &inodes, &failed); error.first.getIsBuddyMirrored(), &inodes, &failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
this->database->getDirInodesTable()->update(inodes); this->database->getDirInodesTable()->update(inodes);
...@@ -1391,7 +1408,7 @@ void ModeCheckFS::repairDirEntryWithBrokenByIDFile(db::DirEntry& entry, UserProm ...@@ -1391,7 +1408,7 @@ void ModeCheckFS::repairDirEntryWithBrokenByIDFile(db::DirEntry& entry, UserProm
FsckDirEntryList failed; FsckDirEntryList failed;
MsgHelperRepair::recreateFsIDs(fsckEntry.getSaveNodeID(), fsckEntry.getIsBuddyMirrored(), MsgHelperRepair::recreateFsIDs(fsckEntry.getSaveNodeID(), fsckEntry.getIsBuddyMirrored(),
&dentries, &failed); &dentries, &failed, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
{ {
...@@ -1430,7 +1447,7 @@ void ModeCheckFS::repairOrphanedDentryByIDFile(FsckFsID& id, UserPrompter& promp ...@@ -1430,7 +1447,7 @@ void ModeCheckFS::repairOrphanedDentryByIDFile(FsckFsID& id, UserPrompter& promp
FsckFileInodeList createdInodes; FsckFileInodeList createdInodes;
MsgHelperRepair::recreateDentries(id.getSaveNodeID(), id.getIsBuddyMirrored(), &fsIDs, MsgHelperRepair::recreateDentries(id.getSaveNodeID(), id.getIsBuddyMirrored(), &fsIDs,
&failed, &createdDentries, &createdInodes); &failed, &createdDentries, &createdInodes, secondariesSetBad);
if(failed.empty() ) if(failed.empty() )
{ {
......
...@@ -49,6 +49,8 @@ class ModeCheckFS : public Mode ...@@ -49,6 +49,8 @@ class ModeCheckFS : public Mode
EntryInfo lostAndFoundInfo; EntryInfo lostAndFoundInfo;
boost::shared_ptr<FsckDirInode> lostAndFoundInode; boost::shared_ptr<FsckDirInode> lostAndFoundInode;
std::set<NumNodeID> secondariesSetBad;
int initDatabase(); int initDatabase();
void printHeaderInformation(); void printHeaderInformation();
void disposeUnusedFiles(); void disposeUnusedFiles();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <common/net/message/nodes/GetNodesRespMsg.h> #include <common/net/message/nodes/GetNodesRespMsg.h>
#include <common/net/message/nodes/GetTargetMappingsRespMsg.h> #include <common/net/message/nodes/GetTargetMappingsRespMsg.h>
#include <common/net/message/nodes/GetTargetStatesRespMsg.h> #include <common/net/message/nodes/GetTargetStatesRespMsg.h>
#include <common/net/message/nodes/SetTargetConsistencyStatesRespMsg.h>
#include <net/message/nodes/HeartbeatMsgEx.h> #include <net/message/nodes/HeartbeatMsgEx.h>
// storage messages // storage messages
...@@ -71,6 +72,7 @@ NetMessage* NetMessageFactory::createFromMsgType(unsigned short msgType) ...@@ -71,6 +72,7 @@ NetMessage* NetMessageFactory::createFromMsgType(unsigned short msgType)
case NETMSGTYPE_GetMirrorBuddyGroupsResp: { msg = new GetMirrorBuddyGroupsRespMsg(); } break; case NETMSGTYPE_GetMirrorBuddyGroupsResp: { msg = new GetMirrorBuddyGroupsRespMsg(); } break;
case NETMSGTYPE_GetTargetMappingsResp: { msg = new GetTargetMappingsRespMsg(); } break; case NETMSGTYPE_GetTargetMappingsResp: { msg = new GetTargetMappingsRespMsg(); } break;
case NETMSGTYPE_GetTargetStatesResp: { msg = new GetTargetStatesRespMsg(); } break; case NETMSGTYPE_GetTargetStatesResp: { msg = new GetTargetStatesRespMsg(); } break;
case NETMSGTYPE_SetTargetConsistencyStatesResp: { msg = new SetTargetConsistencyStatesRespMsg(); } break;
// storage messages // storage messages
case NETMSGTYPE_FindOwnerResp: { msg = new FindOwnerRespMsg(); } break; case NETMSGTYPE_FindOwnerResp: { msg = new FindOwnerRespMsg(); } break;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <common/Common.h> #include <common/Common.h>
#include <common/nodes/Node.h> #include <common/nodes/Node.h>
#include <common/nodes/TargetStateInfo.h>
#include <common/fsck/FsckChunk.h> #include <common/fsck/FsckChunk.h>
#include <common/fsck/FsckDirEntry.h> #include <common/fsck/FsckDirEntry.h>
#include <common/fsck/FsckDirInode.h> #include <common/fsck/FsckDirInode.h>
...@@ -11,17 +12,23 @@ ...@@ -11,17 +12,23 @@
class MsgHelperRepair class MsgHelperRepair
{ {
public: public:
static FhgfsOpsErr setNodeState(NumNodeID node, TargetConsistencyState state);
static void deleteDanglingDirEntries(NumNodeID node, bool isBuddyMirrored, static void deleteDanglingDirEntries(NumNodeID node, bool isBuddyMirrored,
FsckDirEntryList* dentries, FsckDirEntryList* failedDeletes); FsckDirEntryList* dentries, FsckDirEntryList* failedDeletes,
std::set<NumNodeID>& secondariesWithRepair);
static void createDefDirInodes(NumNodeID node, bool isBuddyMirrored, static void createDefDirInodes(NumNodeID node, bool isBuddyMirrored,
const std::vector<std::tuple<std::string, bool>>& entries, const std::vector<std::tuple<std::string, bool>>& entries,
FsckDirInodeList* createdInodes); FsckDirInodeList* createdInodes,
std::set<NumNodeID>& secondariesWithRepair);
static void correctInodeOwnersInDentry(NumNodeID node, bool isBuddyMirrored, static void correctInodeOwnersInDentry(NumNodeID node, bool isBuddyMirrored,
FsckDirEntryList* dentries, NumNodeIDList* owners, FsckDirEntryList* failedCorrections); FsckDirEntryList* dentries, NumNodeIDList* owners, FsckDirEntryList* failedCorrections,
std::set<NumNodeID>& secondariesWithRepair);
static void correctInodeOwners(NumNodeID node, bool isBuddyMirrored, static void correctInodeOwners(NumNodeID node, bool isBuddyMirrored,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections); FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections,
std::set<NumNodeID>& secondariesWithRepair);
static void deleteFiles(NumNodeID node, bool isBuddyMirrored, FsckDirEntryList* dentries, static void deleteFiles(NumNodeID node, bool isBuddyMirrored, FsckDirEntryList* dentries,
FsckDirEntryList* failedDeletes); FsckDirEntryList* failedDeletes);
...@@ -32,27 +39,27 @@ class MsgHelperRepair ...@@ -32,27 +39,27 @@ class MsgHelperRepair
EntryInfo& outLostAndFoundEntryInfo); EntryInfo& outLostAndFoundEntryInfo);
static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo, static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedInodes, FsckDirInodeList* dirInodes, FsckDirInodeList* failedInodes,
FsckDirEntryList* createdDentries); FsckDirEntryList* createdDentries, std::set<NumNodeID>& secondariesWithRepair);
static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo, static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckFileInodeList* fileInodes, FsckFileInodeList* failedInodes, FsckFileInodeList* fileInodes, FsckFileInodeList* failedInodes,
FsckDirEntryList* createdDentries); FsckDirEntryList* createdDentries, std::set<NumNodeID>& secondariesWithRepair);
static void createContDirs(NumNodeID node, bool isBuddyMirrored, FsckDirInodeList* inodes, static void createContDirs(NumNodeID node, bool isBuddyMirrored, FsckDirInodeList* inodes,
StringList* failedCreates); StringList* failedCreates, std::set<NumNodeID>& secondariesWithRepair);
static void updateFileAttribs(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList* inodes, static void updateFileAttribs(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList* inodes,
FsckFileInodeList* failedUpdates); FsckFileInodeList* failedUpdates, std::set<NumNodeID>& secondariesWithRepair);
static void updateDirAttribs(NumNodeID node, bool isBuddyMirrored, FsckDirInodeList* inodes, static void updateDirAttribs(NumNodeID node, bool isBuddyMirrored, FsckDirInodeList* inodes,
FsckDirInodeList* failedUpdates); FsckDirInodeList* failedUpdates, std::set<NumNodeID>& secondariesWithRepair);
static void recreateFsIDs(NumNodeID node, bool isBuddyMirrored, FsckDirEntryList* dentries, static void recreateFsIDs(NumNodeID node, bool isBuddyMirrored, FsckDirEntryList* dentries,
FsckDirEntryList* failedEntries); FsckDirEntryList* failedEntries, std::set<NumNodeID>& secondariesWithRepair);
static void recreateDentries(NumNodeID node, bool isBuddyMirrored, FsckFsIDList* fsIDs, static void recreateDentries(NumNodeID node, bool isBuddyMirrored, FsckFsIDList* fsIDs,
FsckFsIDList* failedCreates, FsckDirEntryList* createdDentries, FsckFsIDList* failedCreates, FsckDirEntryList* createdDentries,
FsckFileInodeList* createdInodes); FsckFileInodeList* createdInodes, std::set<NumNodeID>& secondariesWithRepair);
static void fixChunkPermissions(Node& node, FsckChunkList& chunkList, static void fixChunkPermissions(Node& node, FsckChunkList& chunkList,
PathInfoList& pathInfoList, FsckChunkList& failedChunks); PathInfoList& pathInfoList, FsckChunkList& failedChunks);
static bool moveChunk(Node& node, FsckChunk& chunk, const std::string& moveTo, static bool moveChunk(Node& node, FsckChunk& chunk, const std::string& moveTo,
bool allowOverwrite); bool allowOverwrite);
static void deleteFileInodes(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList& inodes, static void deleteFileInodes(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList& inodes,
StringList& failedDeletes); StringList& failedDeletes, std::set<NumNodeID>& secondariesWithRepair);
private: private:
......
...@@ -62,7 +62,7 @@ chmod +x debian/rules ...@@ -62,7 +62,7 @@ chmod +x debian/rules
# do that itself yet # do that itself yet
# NOTE: package not signed yet! (-us -uc)