Merge "Use seastar::with_file_close_on_failure in commitlog" from Benny

"
`close_on_failure` was committed to seastar so use
the library version.

This requires making the lambda function passed to
it nothrow move constructible, so this series also
makes db::commitlog::descriptor move constructor noexcept
and changes allocate_segment_ex and segment::segment
to get a descriptor by value rather than by reference.

Test: unit(dev), commitlog_test(debug)
"

* tag 'commit-log-use-with_file_close_on_failure-v1' of github.com:bhalevy/scylla:
  commitlog: use seastar::with_file_close_on_failure
  commitlog: descriptor: make nothrow move constructible
  commitlog: allocate_segment_ex, segment: pass descriptor by value
  commitlog: allocate_segment_ex: filename capture is unused
This commit is contained in:
Avi Kivity
2020-07-23 19:23:23 +03:00
2 changed files with 14 additions and 42 deletions

View File

@@ -151,7 +151,7 @@ public:
static const std::string FILENAME_PREFIX;
static const std::string FILENAME_EXTENSION;
descriptor(descriptor&&) = default;
descriptor(descriptor&&) noexcept = default;
descriptor(const descriptor&) = default;
descriptor(segment_id_type i, const std::string& fname_prefix, uint32_t v = 1, sstring = {});
descriptor(replay_position p, const std::string& fname_prefix = FILENAME_PREFIX);