Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ed24da25 authored by Mohammed-Yacine Taleb's avatar Mohammed-Yacine Taleb
Browse files

Fixed sync appendlock bug in MultiLog

parent a02b3f78
No related branches found
No related tags found
No related merge requests found
......@@ -168,7 +168,7 @@ Log::sync()
CycleCounter<uint64_t> __(&PerfStats::threadStats.logSyncCycles);
Tub<SpinLock::Guard> lock;
//lock.construct(appendLock);
lock.construct(appendLock);
metrics.totalSyncCalls++;
// The only time 'head' should be NULL is after construction and before the
......@@ -198,9 +198,9 @@ Log::sync()
// lock and grab the sync lock. This allows other writers to append to the
// log while we wait. Once we grab the sync lock, take the append lock again
// to ensure our new view of the head is consistent.
//lock.destroy();
//SpinLock::Guard _(syncLock);
//lock.construct(appendLock);
lock.destroy();
SpinLock::Guard _(syncLock);
lock.construct(appendLock);
// See if we still have work to do. It's possible that another thread
// already did the syncing we needed for us.
......
......@@ -149,7 +149,8 @@ bool MultiLog::appendMultipleObjects(uint64_t tableId, Buffer& objectsBuffer,
throw FatalError(HERE, "Guaranteed append managed to fail");
*numberObjectsAppended += recordsCount;
lock.~lock_guard();
log->sync();
return true;
......@@ -421,7 +422,7 @@ MultiLog::writeDigest(LogSegment* newHead, LogSegment* prevHead, Log* log) {
digest.appendToBuffer(buffer);
bool success = newHead->append(LOG_ENTRY_TYPE_LOGDIGEST, buffer);
if (!success) {
throw FatalError(HERE, format("Could not append log digest of %u bytes "
throw FatalError(HERE, format("Could not append log digest of %u bytes"
"to segment", buffer.size()));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment