Commit 367a4e9d authored by Yannis Roussos's avatar Yannis Roussos

Merge branch 'ab/partitioning-race' into 'master'

Atomically create table and its partitions

Closes omnibus-gitlab#5597

See merge request gitlab-org/gitlab!41773
parents ce1d9584 79a95be4
......@@ -62,8 +62,10 @@ module Gitlab
partitioned_table_name = make_partitioned_table_name(table_name)
create_range_partitioned_copy(table_name, partitioned_table_name, partition_column, primary_key)
create_daterange_partitions(partitioned_table_name, partition_column.name, min_date, max_date)
transaction do
create_range_partitioned_copy(table_name, partitioned_table_name, partition_column, primary_key)
create_daterange_partitions(partitioned_table_name, partition_column.name, min_date, max_date)
end
create_trigger_to_sync_tables(table_name, partitioned_table_name, primary_key)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment