]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: ignore flush on closed/overflowed object
authorJason Dillaman <dillaman@redhat.com>
Fri, 13 May 2016 20:17:37 +0000 (16:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 20 May 2016 00:28:49 +0000 (20:28 -0400)
The journal would be in-progress on transitioning to a new
object recorder in a newer object set.  Once the records
re-attach to the new object player they will automatically
flush.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit a13cb821f71b6b1b3378464bcc2d8318eb0da48a)

src/journal/ObjectRecorder.cc

index c7f62b4c37a8ab60d3f112fbfe5873fa73649a4a..f9a41100111f286b8d7b7632baf1ed1d723559f3 100644 (file)
@@ -119,7 +119,10 @@ void ObjectRecorder::flush(const FutureImplPtr &future) {
     return;
   }
 
-  assert(!m_object_closed);
+  if (m_object_closed || m_overflowed) {
+    return;
+  }
+
   AppendBuffers::iterator it;
   for (it = m_append_buffers.begin(); it != m_append_buffers.end(); ++it) {
     if (it->first == future) {
@@ -184,7 +187,11 @@ bool ObjectRecorder::append(const AppendBuffer &append_buffer,
                             bool *schedule_append) {
   assert(m_lock.is_locked());
 
-  bool flush_requested = append_buffer.first->attach(&m_flush_handler);
+  bool flush_requested = false;
+  if (!m_object_closed && !m_overflowed) {
+    flush_requested = append_buffer.first->attach(&m_flush_handler);
+  }
+
   m_append_buffers.push_back(append_buffer);
   m_pending_bytes += append_buffer.second.length();