mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
Now, if CDC is enabled, `paxos_response_handler::learn_decision()` augments the base table mutation. The differences in logic between: (1) `mutate_internal<std::vector<mutation>>()` and (2) `mutate_internal<std::vector<std::tuple<paxos::proposal, schema_ptr, ...>>>()` make it necessary to separate "CDC mutations" from "base mutation" and send them, respectively, to (1) and (2). Gleb explained in #5869 why it became necessary to add CDC code to LWT writes specifically, instead of doing it somewhere central that affects all writes: "All paths that do write goes through mutate_internally() eventually so it would have been best to do augmentations there, but cdc chose to log only certain writes and not others (unlike MV that does not care how write happened) and mutate_internal have no idea which is which so I do not have other choice but code duplication. ... paxos_response_handler::learn_decision is probably the place to add cdc augmentation." Fixes #5869