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;
......
......@@ -3,6 +3,7 @@
#include <common/Common.h>
#include <common/nodes/Node.h>
#include <common/nodes/TargetStateInfo.h>
#include <common/fsck/FsckChunk.h>
#include <common/fsck/FsckDirEntry.h>
#include <common/fsck/FsckDirInode.h>
......@@ -11,17 +12,23 @@
class MsgHelperRepair
{
public:
static FhgfsOpsErr setNodeState(NumNodeID node, TargetConsistencyState state);
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,
const std::vector<std::tuple<std::string, bool>>& entries,
FsckDirInodeList* createdInodes);
FsckDirInodeList* createdInodes,
std::set<NumNodeID>& secondariesWithRepair);
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,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections);
FsckDirInodeList* dirInodes, FsckDirInodeList* failedCorrections,
std::set<NumNodeID>& secondariesWithRepair);
static void deleteFiles(NumNodeID node, bool isBuddyMirrored, FsckDirEntryList* dentries,
FsckDirEntryList* failedDeletes);
......@@ -32,27 +39,27 @@ class MsgHelperRepair
EntryInfo& outLostAndFoundEntryInfo);
static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckDirInodeList* dirInodes, FsckDirInodeList* failedInodes,
FsckDirEntryList* createdDentries);
FsckDirEntryList* createdDentries, std::set<NumNodeID>& secondariesWithRepair);
static void linkToLostAndFound(Node& lostAndFoundNode, EntryInfo* lostAndFoundInfo,
FsckFileInodeList* fileInodes, FsckFileInodeList* failedInodes,
FsckDirEntryList* createdDentries);
FsckDirEntryList* createdDentries, std::set<NumNodeID>& secondariesWithRepair);
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,
FsckFileInodeList* failedUpdates);
FsckFileInodeList* failedUpdates, std::set<NumNodeID>& secondariesWithRepair);
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,
FsckDirEntryList* failedEntries);
FsckDirEntryList* failedEntries, std::set<NumNodeID>& secondariesWithRepair);
static void recreateDentries(NumNodeID node, bool isBuddyMirrored, FsckFsIDList* fsIDs,
FsckFsIDList* failedCreates, FsckDirEntryList* createdDentries,
FsckFileInodeList* createdInodes);
FsckFileInodeList* createdInodes, std::set<NumNodeID>& secondariesWithRepair);
static void fixChunkPermissions(Node& node, FsckChunkList& chunkList,
PathInfoList& pathInfoList, FsckChunkList& failedChunks);
static bool moveChunk(Node& node, FsckChunk& chunk, const std::string& moveTo,
bool allowOverwrite);
static void deleteFileInodes(NumNodeID node, bool isBuddyMirrored, FsckFileInodeList& inodes,
StringList& failedDeletes);
StringList& failedDeletes, std::set<NumNodeID>& secondariesWithRepair);
private:
......
......@@ -62,7 +62,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`
......
......@@ -62,7 +62,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`
......
......@@ -40,6 +40,14 @@ void BuddyResyncerBulkSyncSlave::syncLoop()
if (candidate.getType() == MetaSyncDirType::InodesHashDir ||
candidate.getType() == MetaSyncDirType::DentriesHashDir)
{
// lock the hash path in accordance with MkLocalDir, RmLocalDir and RmDir.
const auto& hashDir = candidate.getRelativePath();
auto slash1 = hashDir.find('/');
auto slash2 = hashDir.find('/', slash1 + 1);
auto hash1 = StringTk::strHexToUInt(hashDir.substr(slash1 + 1, slash2 - slash1 - 1));
auto hash2 = StringTk::strHexToUInt(hashDir.substr(slash2 + 1));
HashDirLock hashLock = {lockStore, {hash1, hash2}};
const FhgfsOpsErr resyncRes = resyncDirectory(candidate, "");
if (resyncRes == FhgfsOpsErr_SUCCESS)
continue;
......
......@@ -23,9 +23,12 @@ class MirroredMessage : public BaseT
protected:
typedef MirroredMessage BaseType;
BuddyResyncJob* resyncJob;
LockStateT lockState;
MirroredMessage() {}
MirroredMessage():
resyncJob(nullptr)
{}
virtual FhgfsOpsErr processSecondaryResponse(NetMessage& resp) = 0;
......@@ -38,10 +41,12 @@ class MirroredMessage : public BaseT
// IMPORTANT NOTE ON LOCKING ORDER:
// * always take locks the order
// - HashDirLock
// - DirIDLock
// - ParentNameLock
// - FileIDLock
// * always take locks of each type with the order induced by:
// - HashDirLock: id
// - DirIDLock: (id, forWrite)
// - ParentNameLock: (parentID, name)
// - FileIDLock: id
......@@ -55,7 +60,6 @@ class MirroredMessage : public BaseT
{
Session* session = nullptr;
bool isNewState = true;
BuddyResyncJob* resyncJob = nullptr;
if (isMirrored() && !this->hasFlag(NetMessageHeader::Flag_BuddyMirrorSecond))
{
......@@ -179,14 +183,6 @@ class MirroredMessage : public BaseT
// pairs with the memory barrier before acquireMirrorStateSlot
__sync_synchronize();
if (responsePtr && buddyCommSuccessful)
responsePtr->sendResponse(ctx);
else if (!buddyCommSuccessful)
ctx.sendResponse(
GenericResponseMsg(
GenericRespMsgCode_INDIRECTCOMMERR_NOTAGAIN,
"Communication with secondary failed"));
if (BuddyResyncer::getSyncChangeset())
{
if (isMirrored() &&
......@@ -198,6 +194,14 @@ class MirroredMessage : public BaseT
BuddyResyncer::abandonSyncChangeset();
}
if (responsePtr && buddyCommSuccessful)
responsePtr->sendResponse(ctx);
else if (!buddyCommSuccessful)
ctx.sendResponse(
GenericResponseMsg(
GenericRespMsgCode_INDIRECTCOMMERR_NOTAGAIN,
"Communication with secondary failed"));
lockState = {};
}
......
......@@ -52,9 +52,6 @@ bool CreateDefDirInodesMsgEx::processIncoming(ResponseContext& ctx)
statData.getNumHardlinks(), stripeTargets, FsckStripePatternType_RAID0,
ownerNodeID, isBuddyMirrored, true, false);
createdInodes.push_back(fsckDirInode);
if (isBuddyMirrored)
BuddyCommTk::setBuddyNeedsResyncState(true);
}
else
failedInodeIDs.push_back(inodeID);
......
......@@ -57,9 +57,6 @@ bool CreateEmptyContDirsMsgEx::processIncoming(ResponseContext& ctx)
}
metaStore->releaseDir(dirID);
if (isBuddyMirrored)
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(CreateEmptyContDirsRespMsg(&failedIDs) );
......
......@@ -58,8 +58,6 @@ bool DeleteDirEntriesMsgEx::processIncoming(ResponseContext& ctx)
entryName + "; Err: " + FhgfsOpsErrTk::toErrString(unlinkRes));
failedEntries.push_back(*iter);
}
else if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(DeleteDirEntriesRespMsg(&failedEntries) );
......
......@@ -63,8 +63,6 @@ bool FixInodeOwnersInDentryMsgEx::processIncoming(ResponseContext& ctx)
" entryName: " + entryName);
failedEntries.push_back(*dentryIter);
}
else if (dentryIter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
if (parentDirInodeIsTemp)
SAFE_DELETE(parentDirInode);
......
......@@ -44,8 +44,6 @@ bool FixInodeOwnersMsgEx::processIncoming(ResponseContext& ctx)
+ entryID);
failedInodes.push_back(*iter);
}
else if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(FixInodeOwnersRespMsg(&failedInodes) );
......
......@@ -112,9 +112,6 @@ void LinkToLostAndFoundMsgEx::linkDirInodes(FsckDirInodeList* outFailedInodes,
ownerNodeID, FsckDirEntryType_DIRECTORY, false, localNodeNumID,
saveDevice, saveInode, lostAndFoundInfo->getIsBuddyMirrored());
outCreatedDirEntries->push_back(newFsckDirEntry);
if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
}
}
......
......@@ -135,9 +135,6 @@ bool RecreateDentriesMsgEx::processIncoming(ResponseContext& ctx)
+ iter->getID());
}
if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
metaStore->releaseDir(dirID);
}
......
......@@ -59,9 +59,6 @@ bool RecreateFsIDsMsgEx::processIncoming(ResponseContext& ctx)
failedEntries.push_back(*iter);
continue;
}
if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(RecreateFsIDsRespMsg(&failedEntries) );
......
......@@ -42,8 +42,6 @@ bool RemoveInodesMsgEx::processIncoming(ResponseContext& ctx)
if (rmRes != FhgfsOpsErr_SUCCESS)
failedIDList.push_back(entryID);
else if (isBuddyMirrored)
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(RemoveInodesRespMsg(std::move(failedIDList)));
......
......@@ -44,8 +44,6 @@ bool UpdateDirAttribsMsgEx::processIncoming(ResponseContext& ctx)
"entryID: " + dirID);
failedInodes.push_back(*iter);
}
else if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);
}
ctx.sendResponse(UpdateDirAttribsRespMsg(&failedInodes) );
......
......@@ -44,8 +44,6 @@ bool UpdateFileAttribsMsgEx::processIncoming(ResponseContext& ctx)
"entryID: " + iter->getID());
failedInodes.push_back(*iter);
}
else if (iter->getIsBuddyMirrored())
BuddyCommTk::setBuddyNeedsResyncState(true);