Files
scylladb/service
Tomasz Grabiec 0239ba4527 Merge 'fencing: handle counter_mutations' from Gusev Petr
In this PR we add proper fencing handling to the `counter_mutation` verb.

As for regular mutations, we do the check twice in `handle_counter_mutation`, before and after applying the mutations. The last is important in case fence was moved while we were handling the request - some post-fence actions might have already happened at this time, so we can't treat the request as successful. For example, if topology change coordinator was switching to `write_both_read_new`, streaming might have already started and missed this update.

In `mutate_counters` we can use a single `fencing_token` for all leaders, since all the erms are processed without yields and should underneath share the same `token_metadata`.

We don't pass fencing token for replication explicitly in `replicate_counter_from_leader` since `mutate_counter_on_leader_and_replicate` doesn't capture erm and if the drain on the coordinator timed out the erm for replication might be different and we should use the corresponding (maybe the new one) topology version for outgoing write replication requests. This delayed replication is similar to any other background activity (e.g. writing hints) - it takes the current erm and the current `token_metadata` version for outgoing requests.

Closes #14564

* github.com:scylladb/scylladb:
  counter_mutation: add fencing
  encode_replica_exception_for_rpc: handle the case when result type is a single exception_variant
  counter_mutation: add replica::exception_variant to signature
2023-08-01 12:41:22 +02:00
..
2023-06-06 13:29:16 +03:00