Skip to content

Commit

Permalink
journal: prevent race injecting new records into overflowed object
Browse files Browse the repository at this point in the history
The recorded added after the overflow will not have been detached
from the object recorder.

Fixes: #15202

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Mar 18, 2016
1 parent 8b9ed00 commit 9722dee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/journal/ObjectRecorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ bool ObjectRecorder::append(const AppendBuffers &append_buffers) {
bool schedule_append = false;
{
Mutex::Locker locker(m_lock);
if (m_overflowed) {
m_append_buffers.insert(m_append_buffers.end(),
append_buffers.begin(), append_buffers.end());
return false;
}

for (AppendBuffers::const_iterator iter = append_buffers.begin();
iter != append_buffers.end(); ++iter) {
if (append(*iter, &schedule_append)) {
Expand Down

0 comments on commit 9722dee

Please sign in to comment.