tablets: Fail gracefully when migrating tablet has no pending replica
Before the patch we SIGSEGV trying to access pending replica in this case. Fail early instead.
This commit is contained in:
@@ -213,6 +213,10 @@ future<tablet_metadata> read_tablet_metadata(cql3::query_processor& qp) {
|
||||
for (auto&& r : tablet_replicas) {
|
||||
pending.erase(r);
|
||||
}
|
||||
if (pending.size() == 0) {
|
||||
throw std::runtime_error(format("Stage set but no pending replica for table {} tablet {}",
|
||||
table, current->tid));
|
||||
}
|
||||
if (pending.size() > 1) {
|
||||
throw std::runtime_error(format("Too many pending replicas for table {} tablet {}: {}",
|
||||
table, current->tid, pending));
|
||||
|
||||
Reference in New Issue
Block a user