Merge 'commitlog: Fix position adjustment in large allocation' from Calle Wilund

Refs SCYLLADB-1815
Refs SCYLLADB-1757

(Together with #29753, should be fix for the latter)

Typo/copy-paste error in previous fix for position checks vs. file max when calculating available allocation space.

Should be backported to same branches as original (broken) fix, #29753

Closes scylladb/scylladb#30179

* github.com:scylladb/scylladb:
  commitlog_test: Add test for segment size overflow
  commitlog: Fix position adjustment in large allocation
This commit is contained in:
Botond Dénes
2026-06-03 12:29:39 +03:00
committed by Avi Kivity
3 changed files with 85 additions and 5 deletions

View File

@@ -386,6 +386,12 @@ public:
// be replayed on the next reboot.
replay_position min_position() const;
// For testing only. Returns the active segments current position
// (ignoring chunk overhead etc)
replay_position current_position() const;
// Gets sector overhead for size in given segment
size_t sector_overhead(segment_id_type, size_t) const;
// (Re-)set data mix lifetime.
void update_max_data_lifetime(std::optional<uint64_t> commitlog_data_max_lifetime_in_seconds);