Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 895945 Details for
Bug 1098118
[linearstore] broker segfaults when recovering journal file with damaged header
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch proposal
QPID-5767.patch (text/plain), 4.92 KB, created by
Pavel Moravec
on 2014-05-15 13:59:01 UTC
(
hide
)
Description:
Patch proposal
Filename:
MIME Type:
Creator:
Pavel Moravec
Created:
2014-05-15 13:59:01 UTC
Size:
4.92 KB
patch
obsolete
>Index: cpp/src/qpid/linearstore/journal/RecoveryManager.h >=================================================================== >--- cpp/src/qpid/linearstore/journal/RecoveryManager.h (revision 1594860) >+++ cpp/src/qpid/linearstore/journal/RecoveryManager.h (working copy) >@@ -127,7 +127,7 @@ > std::string toString(const std::string& jid); > std::string toLog(const std::string& jid, const int indent); > protected: >- void analyzeJournalFileHeaders(efpIdentity_t& efpIdentity); >+ void analyzeJournalFileHeaders(EmptyFilePoolManager* emptyFilePoolManager, efpIdentity_t& efpIdentity); > void checkFileStreamOk(bool checkEof); > void checkJournalAlignment(const uint64_t start_fid, const std::streampos recordPosition); > bool decodeRecord(jrec& record, >Index: cpp/src/qpid/linearstore/journal/RecoveryManager.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/RecoveryManager.cpp (revision 1594860) >+++ cpp/src/qpid/linearstore/journal/RecoveryManager.cpp (working copy) >@@ -98,8 +98,18 @@ > EmptyFilePool** emptyFilePoolPtrPtr) { > // Analyze file headers of existing journal files > efpIdentity_t efpIdentity; >- analyzeJournalFileHeaders(efpIdentity); >+ analyzeJournalFileHeaders(emptyFilePoolManager, efpIdentity); > *emptyFilePoolPtrPtr = emptyFilePoolManager->getEmptyFilePool(efpIdentity); >+ if (! *emptyFilePoolPtrPtr) { // not known EFP identity from any journal file, try default >+ efpIdentity.pn_ = emptyFilePoolManager->get_defaultPartitionNumber(); >+ efpIdentity.ds_ = emptyFilePoolManager->get_defaultEfpDataSize_kib(); >+ *emptyFilePoolPtrPtr = emptyFilePoolManager->getEmptyFilePool(efpIdentity); >+ } >+ if (! *emptyFilePoolPtrPtr) { // not known EFP identity, even the default one >+ std::ostringstream oss; >+ oss << "Unknown EFP identity (pn=" << efpIdentity.pn_ << ",ds=" << efpIdentity.ds_ << ")"; >+ throw jexception(jerrno::JERR__FILEIO, oss.str(), "RecoveryManager", "analyzeJournals"); >+ } > efpFileSize_kib_ = (*emptyFilePoolPtrPtr)->fileSize_kib(); > > if (!journalEmptyFlag_) { >@@ -381,14 +391,19 @@ > > // --- protected functions --- > >-void RecoveryManager::analyzeJournalFileHeaders(efpIdentity_t& efpIdentity) { >+void RecoveryManager::analyzeJournalFileHeaders(EmptyFilePoolManager* emptyFilePoolManager, efpIdentity_t& efpIdentity) { > std::string headerQueueName; > ::file_hdr_t fileHeader; > stringList_t directoryList; > jdir::read_dir(journalDirectory_, directoryList, false, true, false, true); > for (stringListConstItr_t i = directoryList.begin(); i != directoryList.end(); ++i) { > readJournalFileHeader(*i, fileHeader, headerQueueName); >- if (headerQueueName.empty()) { >+ if (!(emptyFilePoolManager->getEmptyFilePool(fileHeader._efp_partition, fileHeader._data_size_kib))) { >+ std::ostringstream oss; >+ oss << "Journal file " << (*i) << " has unknown EFP identity (ep=" << fileHeader._efp_partition << ",ds=" << fileHeader._data_size_kib << "): ignoring"; >+ journalLogRef_.log(JournalLog::LOG_WARN, queueName_, oss.str()); >+ } >+ else if (headerQueueName.empty()) { > std::ostringstream oss; > oss << "Journal file " << (*i) << " is uninitialized"; > journalLogRef_.log(JournalLog::LOG_WARN, queueName_, oss.str()); >@@ -409,15 +424,14 @@ > if (fileHeader._file_number > highestFileNumber_) { > highestFileNumber_ = fileHeader._file_number; > } >+ // TODO: Logic weak here for detecting error conditions in journal, specifically when no >+ // valid files exist, or files from mixed EFPs. Currently last properly read file header determines >+ // efpIdentity. >+ efpIdentity.pn_ = fileHeader._efp_partition; >+ efpIdentity.ds_ = fileHeader._data_size_kib; > } > } > >- // TODO: Logic weak here for detecting error conditions in journal, specifically when no >- // valid files exist, or files from mixed EFPs. Currently last read file header determines >- // efpIdentity. >- efpIdentity.pn_ = fileHeader._efp_partition; >- efpIdentity.ds_ = fileHeader._data_size_kib; >- > if (fileNumberMap_.empty()) { > journalEmptyFlag_ = true; > } else { >Index: cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.h >=================================================================== >--- cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.h (revision 1594860) >+++ cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.h (working copy) >@@ -70,6 +70,8 @@ > void getEmptyFilePools(std::vector<EmptyFilePool*>& emptyFilePoolList, > const efpPartitionNumber_t efpPartitionNumber = 0); > uint16_t getNumEfpPartitions() const; >+ efpPartitionNumber_t get_defaultPartitionNumber() { return defaultPartitionNumber_; }; >+ efpDataSize_kib_t get_defaultEfpDataSize_kib() { return defaultEfpDataSize_kib_; }; > }; > > }}}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1098118
: 895945 |
897321
|
897664