Skip to content

Commit 0a68c87

Browse files
jimwwalkerdaverigby
authored andcommitted
MB-25238: Add logging to destruction of store
The MB shows lots of time missing between unregisterTaskable and back in memcached when EvpDestroy has returned, this covers deletion of various objects and interestingly the destruction and flush of the mutation log objects. Change-Id: I3dd7913a5fb02e777b931a11eac97657584b79ee Reviewed-on: http://review.couchbase.org/81481 Well-Formed: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 73d8447 commit 0a68c87

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

src/ep.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,24 @@ EventuallyPersistentStore::~EventuallyPersistentStore() {
447447
ExecutorPool::get()->unregisterTaskable(engine.getTaskable(),
448448
stats.forceShutdown);
449449

450+
LOG(EXTENSION_LOG_NOTICE, "Deleting vb_mutexes");
450451
delete [] vb_mutexes;
452+
LOG(EXTENSION_LOG_NOTICE, "Deleting stats.schedulingHisto");
451453
delete [] stats.schedulingHisto;
454+
LOG(EXTENSION_LOG_NOTICE, "Deleting stats.taskRuntimeHisto");
452455
delete [] stats.taskRuntimeHisto;
456+
LOG(EXTENSION_LOG_NOTICE, "Deleting warmupTask");
453457
delete warmupTask;
458+
LOG(EXTENSION_LOG_NOTICE, "Deleting storageProperties");
454459
delete storageProperties;
460+
LOG(EXTENSION_LOG_NOTICE, "Deleting defragmenterTask");
455461
defragmenterTask.reset();
456462

457-
std::vector<MutationLog*>::iterator it;
458-
for (it = accessLog.begin(); it != accessLog.end(); it++) {
459-
delete *it;
463+
for (size_t ii = 0; ii < accessLog.size(); ii++) {
464+
LOG(EXTENSION_LOG_NOTICE, "Deleting accessLog %" PRIu64, uint64_t(ii));
465+
delete accessLog[ii];
460466
}
467+
LOG(EXTENSION_LOG_NOTICE, "~EventuallyPersistentStore done");
461468
}
462469

463470
const Flusher* EventuallyPersistentStore::getFlusher(uint16_t shardId) {

src/mutation_log.cc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ MutationLog::MutationLog(const std::string &path,
285285
}
286286

287287
MutationLog::~MutationLog() {
288+
std::stringstream ss;
289+
ss << *this;
290+
LOG(EXTENSION_LOG_NOTICE, "%s", ss.str().c_str());
291+
LOG(EXTENSION_LOG_NOTICE, "MutationLog::~MutationLog flush");
288292
flush();
293+
LOG(EXTENSION_LOG_NOTICE, "MutationLog::~MutationLog close");
289294
close();
295+
LOG(EXTENSION_LOG_NOTICE, "MutationLog::~MutationLog done");
290296
}
291297

292298
void MutationLog::disable() {
@@ -1019,3 +1025,19 @@ std::ostream& operator <<(std::ostream &out, const MutationLogEntry &mle) {
10191025
<< ", key=``" << mle.key() << "''";
10201026
return out;
10211027
}
1028+
1029+
std::ostream& operator<<(std::ostream& out, const MutationLog& mlog) {
1030+
out << "MutationLog{logPath:" << mlog.logPath << ", "
1031+
<< "blockSize:" << mlog.blockSize << ", "
1032+
<< "blockPos:" << mlog.blockPos << ", "
1033+
<< "file:" << mlog.file << ", "
1034+
<< "disabled:" << mlog.disabled << ", "
1035+
<< "entries:" << mlog.entries << ", "
1036+
<< "entryBuffer:" << reinterpret_cast<void*>(mlog.entryBuffer.get())
1037+
<< ", "
1038+
<< "blockBuffer:" << reinterpret_cast<void*>(mlog.blockBuffer.get())
1039+
<< ", "
1040+
<< "syncConfig:" << int(mlog.syncConfig) << ", "
1041+
<< "readOnly:" << mlog.readOnly << "}";
1042+
return out;
1043+
}

src/mutation_log.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,13 @@ class MutationLog {
555555
uint8_t syncConfig;
556556
bool readOnly;
557557

558+
friend std::ostream& operator<<(std::ostream& os, const MutationLog& mlog);
559+
558560
DISALLOW_COPY_AND_ASSIGN(MutationLog);
559561
};
560562

563+
std::ostream& operator<<(std::ostream& os, const MutationLog& mlog);
564+
561565
/// @cond DETAILS
562566

563567
//! rowid, (uint8_t)mutation_log_type_t

0 commit comments

Comments
 (0)