diff options
-rw-r--r-- | src/journal/Journaler.cc | 8 | ||||
-rw-r--r-- | src/journal/Settings.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/journal/Journaler.cc b/src/journal/Journaler.cc index 05d80693dc8..27cc33845c0 100644 --- a/src/journal/Journaler.cc +++ b/src/journal/Journaler.cc @@ -395,7 +395,13 @@ void Journaler::stop_append(Context *on_safe) { } uint64_t Journaler::get_max_append_size() const { - return m_metadata->get_object_size() - Entry::get_fixed_size(); + uint64_t max_payload_size = m_metadata->get_object_size() - + Entry::get_fixed_size(); + if (m_metadata->get_settings().max_payload_bytes > 0) { + max_payload_size = MIN(max_payload_size, + m_metadata->get_settings().max_payload_bytes); + } + return max_payload_size; } Future Journaler::append(uint64_t tag_tid, const bufferlist &payload_bl) { diff --git a/src/journal/Settings.h b/src/journal/Settings.h index d8f5e746930..603770cbaf6 100644 --- a/src/journal/Settings.h +++ b/src/journal/Settings.h @@ -11,6 +11,7 @@ namespace journal { struct Settings { double commit_interval = 5; ///< commit position throttle (in secs) uint64_t max_fetch_bytes = 0; ///< 0 implies no limit + uint64_t max_payload_bytes = 0; ///< 0 implies object size limit }; } // namespace journal |