diff options
author | Jason Dillaman <dillaman@redhat.com> | 2016-05-15 00:58:41 +0200 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2016-05-18 17:02:29 +0200 |
commit | de830057d0f7286914e019540c6263423cb60428 (patch) | |
tree | c739825d80f65167d6dd439a6400cf978f7cade1 /src/journal/JournalRecorder.h | |
parent | journal: new ObjectRecorder closed callback (diff) | |
download | ceph-de830057d0f7286914e019540c6263423cb60428.tar.xz ceph-de830057d0f7286914e019540c6263423cb60428.zip |
journal: close, advance, and open object set ordering
Flush in-flight appends to open objects before advancing the
active object set. Additionally, don't start recording to the
new objects until after advancing the active set.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/journal/JournalRecorder.h')
-rw-r--r-- | src/journal/JournalRecorder.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/journal/JournalRecorder.h b/src/journal/JournalRecorder.h index dbd289883d4..68a1d8f50e3 100644 --- a/src/journal/JournalRecorder.h +++ b/src/journal/JournalRecorder.h @@ -62,6 +62,17 @@ private: } }; + struct C_AdvanceObjectSet : public Context { + JournalRecorder *journal_recorder; + + C_AdvanceObjectSet(JournalRecorder *_journal_recorder) + : journal_recorder(_journal_recorder) { + } + virtual void finish(int r) { + journal_recorder->handle_advance_object_set(r); + } + }; + librados::IoCtx m_ioctx; CephContext *m_cct; std::string m_object_oid_prefix; @@ -77,12 +88,21 @@ private: Mutex m_lock; + uint32_t m_in_flight_advance_sets = 0; + uint32_t m_in_flight_object_closes = 0; uint64_t m_current_set; ObjectRecorderPtrs m_object_ptrs; FutureImplPtr m_prev_future; - void close_object_set(uint64_t object_set); + void open_object_set(); + bool close_object_set(uint64_t active_set); + + void advance_object_set(); + void handle_advance_object_set(int r); + + void close_and_advance_object_set(uint64_t object_set); + ObjectRecorderPtr create_object_recorder(uint64_t object_number); void create_next_object_recorder(ObjectRecorderPtr object_recorder); |