replica/table::do_apply : do not check for async gate's closure

The `table::do_apply()` method verifies if the compaction group's async
gate is open to determine if the compaction group is active. Closing
this async gate prevents any new operations but waits for existing
holders to exit, allowing their operations to complete. When holding a
gate, holders will observe the gate as closed when it is being closed,
but this is irrelevant as they are already inside the gate and are
allowed to complete. All the callers of `table::do_apply()` already
enter the gate before calling the method. So, the async gate check
inside `table::do_apply()` will erroneously throw an exception when the
compaction group is closing despite holding the gate. This commit
removes the check to prevent this from happening.

Fixes #23348

Signed-off-by: Lakshmi Narayanan Sreethar <lakshmi.sreethar@scylladb.com>

Closes scylladb/scylladb#23579

(cherry picked from commit 750f4baf44)

Closes scylladb/scylladb#23645
This commit is contained in:
Lakshmi Narayanan Sreethar
2025-04-03 18:06:53 +05:30
committed by Pavel Emelyanov
parent 98359dbfb1
commit b7e72b3167

View File

@@ -3424,10 +3424,6 @@ db::replay_position table::set_low_replay_position_mark() {
template<typename... Args>
void table::do_apply(compaction_group& cg, db::rp_handle&& h, Args&&... args) {
if (cg.async_gate().is_closed()) [[unlikely]] {
on_internal_error(tlogger, "async_gate of table's compaction group is closed");
}
utils::latency_counter lc;
_stats.writes.set_latency(lc);
db::replay_position rp = h;