You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #13683 I left a FIXME in storage_service::raft_check_and_repair_cdc_streams:
// FIXME: check if the current generation is optimal, don't request new one if it isn't
The behavior of the original (gossiper-based) implementation of this API would do exactly that: if the current CDC generation is fine, don't create a new one (hence the "check_and" part of the name).
The new implementation always creates a new generation.
It needs to be modified to do the check first. For that we should refactor the code from generation_service::check_and_repair_cdc_streams (the gossiper-based implementation) - take out the optimality check into a separate function and use it in both places. Note that generation_service::check_and_repair_cdc_streams has other checks which are not applicable to the group0-based implementation (the situation with group 0 is simpler, we don't need to do a distributed read and so on). We basically need only this part:
if (tmptr->sorted_tokens().size() != gen->entries().size()) {
// We probably have garbage streams from old generations
cdc_log.info("Generation size does not match the token ring, regenerating");
should_regenerate = true;
} else {
std::unordered_set<dht::token> gen_ends;
for (constauto& entry : gen->entries()) {
gen_ends.insert(entry.token_range_end);
}
for (constauto& metadata_token : tmptr->sorted_tokens()) {
if (!gen_ends.contains(metadata_token)) {
cdc_log.warn("CDC generation {} missing token {}. Regenerating.", latest, metadata_token);
should_regenerate = true;
break;
}
}
}
The test that was modified in #13683 should be modified further to call the API after a decommission multiple times concurrently; only one generation should be created.
The text was updated successfully, but these errors were encountered:
Follow-up to #13683.
In #13683 I left a FIXME in
storage_service::raft_check_and_repair_cdc_streams
:The behavior of the original (gossiper-based) implementation of this API would do exactly that: if the current CDC generation is fine, don't create a new one (hence the "check_and" part of the name).
The new implementation always creates a new generation.
It needs to be modified to do the check first. For that we should refactor the code from
generation_service::check_and_repair_cdc_streams
(the gossiper-based implementation) - take out the optimality check into a separate function and use it in both places. Note thatgeneration_service::check_and_repair_cdc_streams
has other checks which are not applicable to the group0-based implementation (the situation with group 0 is simpler, we don't need to do a distributed read and so on). We basically need only this part:The test that was modified in #13683 should be modified further to call the API after a decommission multiple times concurrently; only one generation should be created.
The text was updated successfully, but these errors were encountered: