replica/table: adjust the view read-before-write to return static rows when needed

Adjusts the read-before-write query issued in
`table::do_push_view_replica_updates` so that, when needed, requests
static columns and makes sure that the static row is present.
This commit is contained in:
Piotr Dulikowski
2022-07-28 18:56:43 +02:00
parent 18be90b1e6
commit 6ab41d76e6
3 changed files with 24 additions and 6 deletions

View File

@@ -1510,6 +1510,12 @@ future<query::clustering_row_ranges> calculate_affected_clustering_ranges(const
}
bool needs_static_row(const mutation_partition& mp, const std::vector<view_and_base>& views) {
// TODO: We could also check whether any of the views need static rows
// and return false if none of them do
return mp.partition_tombstone() || !mp.static_row().empty();
}
// Calculate the node ("natural endpoint") to which this node should send
// a view update.
//

View File

@@ -305,6 +305,8 @@ future<query::clustering_row_ranges> calculate_affected_clustering_ranges(
const mutation_partition& mp,
const std::vector<view_and_base>& views);
bool needs_static_row(const mutation_partition& mp, const std::vector<view_and_base>& views);
struct wait_for_all_updates_tag {};
using wait_for_all_updates = bool_class<wait_for_all_updates_tag>;
future<> mutate_MV(