Skip to content

Commit

Permalink
cluster: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
rystsov committed Jul 9, 2022
1 parent 1a72446 commit 1dfd8d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
53 changes: 0 additions & 53 deletions src/v/cluster/partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,59 +187,6 @@ raft::replicate_stages partition::replicate_in_stages(
}
}

ss::future<result<raft::replicate_result>> partition::replicate(
model::batch_identity bid,
model::record_batch_reader&& r,
raft::replicate_options opts) {
if (bid.is_transactional) {
if (!_is_tx_enabled) {
vlog(
clusterlog.error,
"Can't process a transactional request to {}. Transactional "
"processing isn't enabled.",
_raft->ntp());
return ss::make_ready_future<result<raft::replicate_result>>(
raft::errc::timeout);
}

if (!_rm_stm) {
vlog(
clusterlog.error,
"Topic {} doesn't support transactional processing.",
_raft->ntp());
return ss::make_ready_future<result<raft::replicate_result>>(
raft::errc::timeout);
}
}

if (bid.has_idempotent()) {
if (!_is_idempotence_enabled) {
vlog(
clusterlog.error,
"Can't process an idempotent request to {}. Idempotency isn't "
"enabled.",
_raft->ntp());
return ss::make_ready_future<result<raft::replicate_result>>(
raft::errc::timeout);
}

if (!_rm_stm) {
vlog(
clusterlog.error,
"Topic {} doesn't support idempotency.",
_raft->ntp());
return ss::make_ready_future<result<raft::replicate_result>>(
raft::errc::timeout);
}
}

if (_rm_stm) {
return _rm_stm->replicate(bid, std::move(r), opts);
} else {
return _raft->replicate(std::move(r), opts);
}
}

ss::future<> partition::start() {
auto ntp = _raft->ntp();

Expand Down
5 changes: 0 additions & 5 deletions src/v/cluster/partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ class partition {
ss::future<result<raft::replicate_result>> replicate(
model::term_id, model::record_batch_reader&&, raft::replicate_options);

ss::future<result<raft::replicate_result>> replicate(
model::batch_identity,
model::record_batch_reader&&,
raft::replicate_options);

raft::replicate_stages replicate_in_stages(
model::batch_identity,
model::record_batch_reader&&,
Expand Down

0 comments on commit 1dfd8d9

Please sign in to comment.