mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
ALTER tablets-enabled KEYSPACES (KS) may fail due to group0_concurrent_modification, in which case it's repeated by a for loop surrounding the code. But because raft's add_entry consumes the raft's guard (by std::move'ing the guard object), retries of ALTER KS will use a moved-from guard object, which is UB, potentially a crash. The fix is to remove the before mentioned for loop altogether and rethrow the exception, as the rf_change event will be repeated by the topology state machine if it receives the concurrent modification exception, because the event will remain present in the global requests queue, hence it's going to be executed as the very next event. Note: refactor is implemented in the follow-up commit. Fixes: https://github.com/scylladb/scylladb/issues/21102 Should be backported to every 6.x branch, as it may lead to a crash. (cherry picked from commitde511f56ac) (cherry picked from commit3f4c8a30e3) (cherry picked from commit522bede8ec) Refs https://github.com/scylladb/scylladb/pull/21121 Closes scylladb/scylladb#21340 * github.com:scylladb/scylladb: test: topology: add disable_schema_agreement_wait utility function test: add UT to test retrying ALTER tablets KEYSPACE cql/tablets: fix indentation in `rf_change` event handler cql/tablets: fix retrying ALTER tablets KEYSPACE