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 897664 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]
Proposed alternative patch #2
RHBZ1098118.diff (text/plain), 6.67 KB, created by
Kim van der Riet
on 2014-05-20 16:37:40 UTC
(
hide
)
Description:
Proposed alternative patch #2
Filename:
MIME Type:
Creator:
Kim van der Riet
Created:
2014-05-20 16:37:40 UTC
Size:
6.67 KB
patch
obsolete
>Index: cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp (revision 1592994) >+++ cpp/src/qpid/linearstore/journal/EmptyFilePoolManager.cpp (working copy) >@@ -184,9 +184,9 @@ > > EmptyFilePool* EmptyFilePoolManager::getEmptyFilePool(const efpPartitionNumber_t partitionNumber, > const efpDataSize_kib_t efpDataSize_kib) { >- EmptyFilePoolPartition* efppp = getEfpPartition(partitionNumber); >+ EmptyFilePoolPartition* efppp = getEfpPartition(partitionNumber > 0 ? partitionNumber : defaultPartitionNumber_); > if (efppp != 0) >- return efppp->getEmptyFilePool(efpDataSize_kib); >+ return efppp->getEmptyFilePool(efpDataSize_kib > 0 ? efpDataSize_kib : defaultEfpDataSize_kib_); > return 0; > } > >Index: cpp/src/qpid/linearstore/journal/jcntl.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/jcntl.cpp (revision 1594215) >+++ cpp/src/qpid/linearstore/journal/jcntl.cpp (working copy) >@@ -116,6 +116,7 @@ > // Verify journal dir and journal files > _jdir.verify_dir(); > _recoveryManager.analyzeJournals(prep_txn_list_ptr, efpmp, &_emptyFilePoolPtr); >+ assert(_emptyFilePoolPtr != 0); > > highest_rid = _recoveryManager.getHighestRecordId(); > _jrnl_log.log(/*LOG_DEBUG*/JournalLog::LOG_INFO, _jid, _recoveryManager.toLog(_jid, 5)); >Index: cpp/src/qpid/linearstore/journal/jerrno.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/jerrno.cpp (revision 1594215) >+++ cpp/src/qpid/linearstore/journal/jerrno.cpp (working copy) >@@ -95,6 +95,7 @@ > const uint32_t jerrno::JERR_RCVM_NULLXID = 0x0904; > const uint32_t jerrno::JERR_RCVM_NOTDBLKALIGNED = 0x0905; > const uint32_t jerrno::JERR_RCVM_NULLFID = 0x0907; >+const uint32_t jerrno::JERR_RCVM_INVALIDEFPID = 0x0908; > > // class data_tok > const uint32_t jerrno::JERR_DTOK_ILLEGALSTATE = 0x0a00; >@@ -188,6 +189,7 @@ > _err_map[JERR_RCVM_NULLXID] = "JERR_RCVM_NULLXID: Null XID when XID length non-null in header"; > _err_map[JERR_RCVM_NOTDBLKALIGNED] = "JERR_RCVM_NOTDBLKALIGNED: Offset is not data block (dblk)-aligned"; > _err_map[JERR_RCVM_NULLFID] = "JERR_RCVM_NULLFID: Null file id (FID)"; >+ _err_map[JERR_RCVM_INVALIDEFPID] = "JERR_RCVM_INVALIDEFPID: Invalid EFP identity (partition/size)"; > > // class data_tok > _err_map[JERR_DTOK_ILLEGALSTATE] = "JERR_MTOK_ILLEGALSTATE: Attempted to change to illegal state."; >Index: cpp/src/qpid/linearstore/journal/jerrno.h >=================================================================== >--- cpp/src/qpid/linearstore/journal/jerrno.h (revision 1594215) >+++ cpp/src/qpid/linearstore/journal/jerrno.h (working copy) >@@ -113,6 +113,7 @@ > static const uint32_t JERR_RCVM_NULLXID; ///< Null XID when XID length non-null in header > static const uint32_t JERR_RCVM_NOTDBLKALIGNED; ///< Offset is not data block (dblk)-aligned > static const uint32_t JERR_RCVM_NULLFID; ///< Null file ID (FID) >+ static const uint32_t JERR_RCVM_INVALIDEFPID; ///< Invalid EFP identity (partition/size) > > // class data_tok > static const uint32_t JERR_DTOK_ILLEGALSTATE; ///< Attempted to change to illegal state >Index: cpp/src/qpid/linearstore/journal/LinearFileController.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/LinearFileController.cpp (revision 1592994) >+++ cpp/src/qpid/linearstore/journal/LinearFileController.cpp (working copy) >@@ -102,6 +102,7 @@ > } > > void LinearFileController::restoreEmptyFile(const std::string& fileName) { >+ // TODO: Add checks that this file is of a valid size; if not, delete this and get one from the EFP > addJournalFile(fileName, emptyFilePoolPtr_->getIdentity(), getNextFileSeqNum(), 0); > } > >Index: cpp/src/qpid/linearstore/journal/RecoveryManager.cpp >=================================================================== >--- cpp/src/qpid/linearstore/journal/RecoveryManager.cpp (revision 1594215) >+++ cpp/src/qpid/linearstore/journal/RecoveryManager.cpp (working copy) >@@ -99,10 +99,22 @@ > // Analyze file headers of existing journal files > efpIdentity_t efpIdentity; > analyzeJournalFileHeaders(efpIdentity); >- *emptyFilePoolPtrPtr = emptyFilePoolManager->getEmptyFilePool(efpIdentity); >- efpFileSize_kib_ = (*emptyFilePoolPtrPtr)->fileSize_kib(); > >- if (!journalEmptyFlag_) { >+ if (journalEmptyFlag_) { >+ *emptyFilePoolPtrPtr = emptyFilePoolManager->getEmptyFilePool(0, 0); // Use default EFP >+ } else { >+ *emptyFilePoolPtrPtr = emptyFilePoolManager->getEmptyFilePool(efpIdentity); >+ if (! *emptyFilePoolPtrPtr) { >+ // TODO: At a later time, this could be used to establish a new pool size provided the partition exists. >+ // If the partition does not exist, this is always an error. For now, throw an exception, as this should >+ // not occur in any practical application. Once multiple partitions and mixed EFPs are supported, this >+ // needs to be resolved. Note that EFP size is always a multiple of QLS_SBLK_SIZE_BYTES (currently 4096 >+ // bytes, any other value cannot be used and should be rejected as an error. >+ std::ostringstream oss; >+ oss << "Invalid EFP identity: Partition=" << efpIdentity.pn_ << " Size=" << efpIdentity.ds_ << "k"; >+ throw jexception(jerrno::JERR_RCVM_INVALIDEFPID, oss.str(), "RecoveryManager", "analyzeJournals"); >+ } >+ efpFileSize_kib_ = (*emptyFilePoolPtrPtr)->fileSize_kib(); > > // Read all records, establish remaining enqueued records > if (inFileStream_.is_open()) { >@@ -409,15 +421,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 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 {
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