raft: remove empty() from fsm_output
Nobody remembered to keep this function up to date when adding stuff to `fsm_output`. Turns out that it's not being used by any Raft logic but only in some tests. That use case can now be replaced with `fsm::has_output()` which is also being used by `raft::server` code.
This commit is contained in:
@@ -46,14 +46,6 @@ struct fsm_output {
|
||||
bool state_changed = false;
|
||||
// Set to true if a leadership transfer was aborted since the last output
|
||||
bool abort_leadership_transfer;
|
||||
|
||||
// True if there is no new output
|
||||
bool empty() const {
|
||||
return !term_and_vote &&
|
||||
log_entries.size() == 0 && messages.size() == 0 &&
|
||||
committed.size() == 0 && !snp && snps_to_drop.empty() &&
|
||||
!configuration && !max_read_id_with_quorum;
|
||||
}
|
||||
};
|
||||
|
||||
struct fsm_config {
|
||||
|
||||
@@ -94,7 +94,8 @@ communicate_impl(std::function<bool()> stop_pred, raft_routing_map& map) {
|
||||
has_traffic = false;
|
||||
for (auto e : map) {
|
||||
raft::fsm& from = *e.second;
|
||||
for (auto output = from.get_output(); !output.empty(); output = from.get_output()) {
|
||||
for (bool has_output = from.has_output(); has_output; has_output = from.has_output()) {
|
||||
auto output = from.get_output();
|
||||
if (stop_pred()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user