mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
truncate: create session during request handling
Currently, the session ID under which the truncate for tablets request is running is created during the request creation and queuing. This is a problem because this could overwrite the session ID of any ongoing operation on system.topology#session This change moves the creation of the session ID for truncate from the request creation to the request handling. Fixes #22613 Closes scylladb/scylladb#22615
This commit is contained in:
committed by
Tomasz Grabiec
parent
f2d5819645
commit
a59618e83d
@@ -1093,7 +1093,6 @@ private:
|
||||
updates.emplace_back(topology_mutation_builder(guard.write_timestamp())
|
||||
.set_global_topology_request(global_topology_request::truncate_table)
|
||||
.set_global_topology_request_id(global_request_id)
|
||||
.set_session(session_id(global_request_id))
|
||||
.build());
|
||||
|
||||
updates.emplace_back(topology_request_tracking_mutation_builder(global_request_id)
|
||||
|
||||
@@ -933,6 +933,7 @@ class topology_coordinator : public endpoint_lifecycle_subscriber {
|
||||
std::vector<canonical_mutation> updates;
|
||||
updates.push_back(topology_mutation_builder(guard.write_timestamp())
|
||||
.set_transition_state(topology::transition_state::truncate_table)
|
||||
.set_session(session_id(_topo_sm._topology.global_request_id.value()))
|
||||
.build());
|
||||
co_await update_topology_state(std::move(guard), std::move(updates), "TRUNCATE TABLE requested");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user