Skip to content

Commit

Permalink
cluster: ignore _last_replicate value in destructor
Browse files Browse the repository at this point in the history
Last replicate future is an internal barrier for sync operations. Ignore
its value if we're shutting down to prevent seastar logging warnings for
unhandled exception.

Couldn't come up with a test for this.
  • Loading branch information
nvartolomei committed Dec 12, 2023
1 parent 3a7d9ff commit e221a0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/v/cluster/archival_metadata_stm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,15 @@ archival_metadata_stm::archival_metadata_stm(
, _cloud_storage_api(remote)
, _feature_table(ft) {}

archival_metadata_stm::~archival_metadata_stm() {
// Last replicate future is an internal barrier for sync operations. Ignore
// its value if we're shutting down to prevent seastar logging warnings for
// unhandled exception.
if (_last_replicate.has_value()) {
_last_replicate->ignore_ready_future();
}
}

ss::future<std::error_code> archival_metadata_stm::truncate(
model::offset start_rp_offset,
ss::lowres_clock::time_point deadline,
Expand Down
1 change: 1 addition & 0 deletions src/v/cluster/archival_metadata_stm.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class archival_metadata_stm final : public raft::persisted_stm<> {
features::feature_table&,
ss::logger& logger,
ss::shared_ptr<util::mem_tracker> partition_mem_tracker = nullptr);
~archival_metadata_stm() override;

/// Add segments to the raft log, replicate them and
/// wait until it is applied to the STM.
Expand Down

0 comments on commit e221a0a

Please sign in to comment.