Drop partitioned sent_notifications table by RANGE
What does this MR do and why?
We need to repartition the sent_notifications table
using a different strategy.
Migration output
UP
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43125
main: == 20250808211506 CleanSentNotificationsFirstBackfill: migrating ==============
main: == 20250808211506 CleanSentNotificationsFirstBackfill: migrated (0.0360s) =====
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43125
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43126
ci: == 20250808211506 CleanSentNotificationsFirstBackfill: migrating ==============
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_ci_cell_local, :gitlab_internal, :gitlab_shared].
ci: == 20250808211506 CleanSentNotificationsFirstBackfill: migrated (0.0071s) =====
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43126
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43128
main: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: migrating
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- remove_foreign_key(:sent_notifications_7abbf02cb6, :issue_email_participants, {:column=>:issue_email_participant_id})
main: -> 0.0027s
main: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: migrated (0.0222s)
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43128
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43129
ci: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: migrating
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- remove_foreign_key(:sent_notifications_7abbf02cb6, :issue_email_participants, {:column=>:issue_email_participant_id})
ci: -> 0.0026s
ci: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: migrated (0.0177s)
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43129
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43131
main: == 20250808212723 DropPartitionedIndexInSentNotifications: migrating ==========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_issue_email_participant_id")
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_issue_email_participant_id"})
main: -> 0.0011s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_namespace_id")
main: -> 0.0005s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_namespace_id"})
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_noteable_type_noteable_id_and_id")
main: -> 0.0006s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_noteable_type_noteable_id_and_id"})
main: -> 0.0007s
main: == 20250808212723 DropPartitionedIndexInSentNotifications: migrated (0.0301s) =
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43131
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43132
ci: == 20250808212723 DropPartitionedIndexInSentNotifications: migrating ==========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_issue_email_participant_id")
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_issue_email_participant_id"})
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_namespace_id")
ci: -> 0.0006s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_namespace_id"})
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_noteable_type_noteable_id_and_id")
ci: -> 0.0006s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- remove_index(:sent_notifications_7abbf02cb6, {:name=>"idx_p_sent_notifications_on_noteable_type_noteable_id_and_id"})
ci: -> 0.0007s
ci: == 20250808212723 DropPartitionedIndexInSentNotifications: migrated (0.0341s) =
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43132
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43139
main: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: migrating =
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("DROP TRIGGER IF EXISTS table_sync_trigger_a747bc4a6e ON sent_notifications")
main: -> 0.0007s
main: -- execute("DROP FUNCTION IF EXISTS table_sync_function_d452a5847a()")
main: -> 0.0005s
main: -- drop_table("sent_notifications_7abbf02cb6")
main: -> 0.0083s
main: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: migrated (0.0153s)
main: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43139
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43144
ci: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: migrating =
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("DROP TRIGGER IF EXISTS table_sync_trigger_a747bc4a6e ON sent_notifications")
ci: -> 0.0006s
ci: -- execute("DROP FUNCTION IF EXISTS table_sync_function_d452a5847a()")
ci: -> 0.0004s
ci: -- drop_table("sent_notifications_7abbf02cb6")
ci: -> 0.0085s
ci: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: migrated (0.0221s)
ci: == [advisory_lock_connection] object_id: 146820, pg_backend_pid: 43144
DOWN
main: == [advisory_lock_connection] object_id: 147240, pg_backend_pid: 42904
main: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: reverting =
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction(nil)
main: -- transaction(nil)
main: -- execute("CREATE TABLE sent_notifications_7abbf02cb6 (\n LIKE sent_notifications INCLUDING ALL EXCLUDING INDEXES,\n partition_key_bfab5f7bb7 timestamp with time zone NOT NULL,\n PRIMARY KEY (id, partition_key_bfab5f7bb7)\n) PARTITION BY RANGE (partition_key_bfab5f7bb7)\n")
main: -> 0.0020s
main: -- remove_column("sent_notifications_7abbf02cb6", "created_at")
main: -> 0.0007s
main: -- rename_column("sent_notifications_7abbf02cb6", "partition_key_bfab5f7bb7", "created_at")
main: -> 0.0012s
main: -- change_column_default("sent_notifications_7abbf02cb6", "id", nil)
main: -> 0.0014s
main: -- change_column("sent_notifications_7abbf02cb6", "id", :bigint)
main: -> 0.0009s
main: -> 0.0071s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM (MINVALUE) TO ('2025-04-01')\n")
main: -> 0.0027s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-04-01') TO ('2025-05-01')\n")
main: -> 0.0022s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-05-01') TO ('2025-06-01')\n")
main: -> 0.0013s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-06-01') TO ('2025-07-01')\n")
main: -> 0.0018s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-07-01') TO ('2025-08-01')\n")
main: -> 0.0039s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-08-01') TO ('2025-09-01')\n")
main: -> 0.0015s
main: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-09-01') TO ('2025-10-01')\n")
main: -> 0.0017s
main: -> 0.0252s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("CREATE FUNCTION table_sync_function_d452a5847a()\nRETURNS TRIGGER AS\n$$\nBEGIN\nIF (TG_OP = 'DELETE') THEN\n DELETE FROM sent_notifications_7abbf02cb6 where \"id\" = OLD.\"id\";\nELSIF (TG_OP = 'UPDATE') THEN\n UPDATE sent_notifications_7abbf02cb6\n SET \"project_id\" = NEW.\"project_id\",\n \"noteable_id\" = NEW.\"noteable_id\",\n \"noteable_type\" = NEW.\"noteable_type\",\n \"recipient_id\" = NEW.\"recipient_id\",\n \"commit_id\" = NEW.\"commit_id\",\n \"reply_key\" = NEW.\"reply_key\",\n \"in_reply_to_discussion_id\" = NEW.\"in_reply_to_discussion_id\",\n \"issue_email_participant_id\" = NEW.\"issue_email_participant_id\",\n \"namespace_id\" = NEW.\"namespace_id\",\n \"created_at\" = NEW.\"created_at\"\n WHERE sent_notifications_7abbf02cb6.\"id\" = NEW.\"id\";\nELSIF (TG_OP = 'INSERT') THEN\n INSERT INTO sent_notifications_7abbf02cb6 (\"project_id\",\n \"noteable_id\",\n \"noteable_type\",\n \"recipient_id\",\n \"commit_id\",\n \"reply_key\",\n \"in_reply_to_discussion_id\",\n \"id\",\n \"issue_email_participant_id\",\n \"namespace_id\",\n \"created_at\")\n VALUES (NEW.\"project_id\",\n NEW.\"noteable_id\",\n NEW.\"noteable_type\",\n NEW.\"recipient_id\",\n NEW.\"commit_id\",\n NEW.\"reply_key\",\n NEW.\"in_reply_to_discussion_id\",\n NEW.\"id\",\n NEW.\"issue_email_participant_id\",\n NEW.\"namespace_id\",\n NEW.\"created_at\");\nEND IF;\nRETURN NULL;\n\nEND\n$$ LANGUAGE PLPGSQL\n")
main: -> 0.0024s
main: -- execute("COMMENT ON FUNCTION table_sync_function_d452a5847a IS 'Partitioning migration: table sync for sent_notifications table'")
main: -> 0.0006s
main: -- execute("CREATE TRIGGER table_sync_trigger_a747bc4a6e\nAFTER INSERT OR UPDATE OR DELETE ON sent_notifications\nFOR EACH ROW\n\nEXECUTE FUNCTION table_sync_function_d452a5847a()\n")
main: -> 0.0007s
main: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: reverted (0.0825s)
main: == 20250808212723 DropPartitionedIndexInSentNotifications: reverting ==========
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_issue_email_participant_id")
main: -> 0.0005s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :issue_email_participant_id, {:name=>"index_40578c5783", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :issue_email_participant_id, {:name=>"index_40578c5783", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :issue_email_participant_id, {:name=>"index_ce54154efb", :algorithm=>:concurrently})
main: -> 0.0006s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :issue_email_participant_id, {:name=>"index_ce54154efb", :algorithm=>:concurrently})
main: -> 0.0013s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :issue_email_participant_id, {:name=>"index_b5d8642b32", :algorithm=>:concurrently})
main: -> 0.0005s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :issue_email_participant_id, {:name=>"index_b5d8642b32", :algorithm=>:concurrently})
main: -> 0.0009s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :issue_email_participant_id, {:name=>"index_86d2eeef11", :algorithm=>:concurrently})
main: -> 0.0006s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :issue_email_participant_id, {:name=>"index_86d2eeef11", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :issue_email_participant_id, {:name=>"index_a3fba6af13", :algorithm=>:concurrently})
main: -> 0.0005s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :issue_email_participant_id, {:name=>"index_a3fba6af13", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :issue_email_participant_id, {:name=>"index_776383d979", :algorithm=>:concurrently})
main: -> 0.0005s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :issue_email_participant_id, {:name=>"index_776383d979", :algorithm=>:concurrently})
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :issue_email_participant_id, {:name=>"index_7457060051", :algorithm=>:concurrently})
main: -> 0.0006s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :issue_email_participant_id, {:name=>"index_7457060051", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- add_index(:sent_notifications_7abbf02cb6, :issue_email_participant_id, {:name=>"idx_p_sent_notifications_on_issue_email_participant_id"})
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_namespace_id")
main: -> 0.0004s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :namespace_id, {:name=>"index_401fa5056c", :algorithm=>:concurrently})
main: -> 0.0013s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :namespace_id, {:name=>"index_401fa5056c", :algorithm=>:concurrently})
main: -> 0.0009s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :namespace_id, {:name=>"index_055d233ac6", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :namespace_id, {:name=>"index_055d233ac6", :algorithm=>:concurrently})
main: -> 0.0011s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :namespace_id, {:name=>"index_59dc18e9c9", :algorithm=>:concurrently})
main: -> 0.0112s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :namespace_id, {:name=>"index_59dc18e9c9", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :namespace_id, {:name=>"index_bac445a0ad", :algorithm=>:concurrently})
main: -> 0.0011s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :namespace_id, {:name=>"index_bac445a0ad", :algorithm=>:concurrently})
main: -> 0.0009s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :namespace_id, {:name=>"index_9404e368e6", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :namespace_id, {:name=>"index_9404e368e6", :algorithm=>:concurrently})
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :namespace_id, {:name=>"index_ab01f4ae3f", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :namespace_id, {:name=>"index_ab01f4ae3f", :algorithm=>:concurrently})
main: -> 0.0011s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :namespace_id, {:name=>"index_1b371ee0bd", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :namespace_id, {:name=>"index_1b371ee0bd", :algorithm=>:concurrently})
main: -> 0.0008s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- add_index(:sent_notifications_7abbf02cb6, :namespace_id, {:name=>"idx_p_sent_notifications_on_namespace_id"})
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_noteable_type_noteable_id_and_id")
main: -> 0.0005s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", [:noteable_id, :id], {:name=>"index_8d57da74a4", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0012s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", [:noteable_id, :id], {:name=>"index_8d57da74a4", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0021s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", [:noteable_id, :id], {:name=>"index_fa325a0544", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0015s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", [:noteable_id, :id], {:name=>"index_fa325a0544", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0021s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", [:noteable_id, :id], {:name=>"index_7e17ffc913", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", [:noteable_id, :id], {:name=>"index_7e17ffc913", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0028s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", [:noteable_id, :id], {:name=>"index_267bf71cfc", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0018s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", [:noteable_id, :id], {:name=>"index_267bf71cfc", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0023s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", [:noteable_id, :id], {:name=>"index_4d9f7ef196", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0016s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", [:noteable_id, :id], {:name=>"index_4d9f7ef196", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0018s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", [:noteable_id, :id], {:name=>"index_7cf605249b", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", [:noteable_id, :id], {:name=>"index_7cf605249b", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0021s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", [:noteable_id, :id], {:name=>"index_da13615773", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0010s
main: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", [:noteable_id, :id], {:name=>"index_da13615773", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
main: -> 0.0025s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- add_index(:sent_notifications_7abbf02cb6, [:noteable_id, :id], {:name=>"idx_p_sent_notifications_on_noteable_type_noteable_id_and_id", :where=>"noteable_type = 'Issue'"})
main: -> 0.0020s
main: == 20250808212723 DropPartitionedIndexInSentNotifications: reverted (0.1394s) =
main: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: reverting
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0015s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0023s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0007s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0009s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0008s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0008s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0006s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0007s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0006s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0010s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0008s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0006s
main: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE sent_notifications_7abbf02cb6 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE ;")
main: -> 0.0012s
main: -- execute("ALTER TABLE sent_notifications_7abbf02cb6 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
main: -> 0.0008s
main: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: reverted (0.1053s)
main: == 20250808211506 CleanSentNotificationsFirstBackfill: reverting ==============
main: == 20250808211506 CleanSentNotificationsFirstBackfill: reverted (0.0038s) =====
main: == [advisory_lock_connection] object_id: 147240, pg_backend_pid: 42904
ci: == [advisory_lock_connection] object_id: 147240, pg_backend_pid: 42921
ci: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: reverting =
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction(nil)
ci: -- transaction(nil)
ci: -- execute("CREATE TABLE sent_notifications_7abbf02cb6 (\n LIKE sent_notifications INCLUDING ALL EXCLUDING INDEXES,\n partition_key_bfab5f7bb7 timestamp with time zone NOT NULL,\n PRIMARY KEY (id, partition_key_bfab5f7bb7)\n) PARTITION BY RANGE (partition_key_bfab5f7bb7)\n")
ci: -> 0.0037s
ci: -- remove_column("sent_notifications_7abbf02cb6", "created_at")
ci: -> 0.0005s
ci: -- rename_column("sent_notifications_7abbf02cb6", "partition_key_bfab5f7bb7", "created_at")
ci: -> 0.0012s
ci: -- change_column_default("sent_notifications_7abbf02cb6", "id", nil)
ci: -> 0.0015s
ci: -- change_column("sent_notifications_7abbf02cb6", "id", :bigint)
ci: -> 0.0009s
ci: -> 0.0087s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM (MINVALUE) TO ('2025-04-01')\n")
ci: -> 0.0032s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-04-01') TO ('2025-05-01')\n")
ci: -> 0.0021s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-05-01') TO ('2025-06-01')\n")
ci: -> 0.0020s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-06-01') TO ('2025-07-01')\n")
ci: -> 0.0021s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-07-01') TO ('2025-08-01')\n")
ci: -> 0.0018s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-08-01') TO ('2025-09-01')\n")
ci: -> 0.0024s
ci: -- execute("CREATE TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 PARTITION OF sent_notifications_7abbf02cb6\nFOR VALUES FROM ('2025-09-01') TO ('2025-10-01')\n")
ci: -> 0.0021s
ci: -> 0.0286s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("CREATE FUNCTION table_sync_function_d452a5847a()\nRETURNS TRIGGER AS\n$$\nBEGIN\nIF (TG_OP = 'DELETE') THEN\n DELETE FROM sent_notifications_7abbf02cb6 where \"id\" = OLD.\"id\";\nELSIF (TG_OP = 'UPDATE') THEN\n UPDATE sent_notifications_7abbf02cb6\n SET \"project_id\" = NEW.\"project_id\",\n \"noteable_id\" = NEW.\"noteable_id\",\n \"noteable_type\" = NEW.\"noteable_type\",\n \"recipient_id\" = NEW.\"recipient_id\",\n \"commit_id\" = NEW.\"commit_id\",\n \"reply_key\" = NEW.\"reply_key\",\n \"in_reply_to_discussion_id\" = NEW.\"in_reply_to_discussion_id\",\n \"issue_email_participant_id\" = NEW.\"issue_email_participant_id\",\n \"namespace_id\" = NEW.\"namespace_id\",\n \"created_at\" = NEW.\"created_at\"\n WHERE sent_notifications_7abbf02cb6.\"id\" = NEW.\"id\";\nELSIF (TG_OP = 'INSERT') THEN\n INSERT INTO sent_notifications_7abbf02cb6 (\"project_id\",\n \"noteable_id\",\n \"noteable_type\",\n \"recipient_id\",\n \"commit_id\",\n \"reply_key\",\n \"in_reply_to_discussion_id\",\n \"id\",\n \"issue_email_participant_id\",\n \"namespace_id\",\n \"created_at\")\n VALUES (NEW.\"project_id\",\n NEW.\"noteable_id\",\n NEW.\"noteable_type\",\n NEW.\"recipient_id\",\n NEW.\"commit_id\",\n NEW.\"reply_key\",\n NEW.\"in_reply_to_discussion_id\",\n NEW.\"id\",\n NEW.\"issue_email_participant_id\",\n NEW.\"namespace_id\",\n NEW.\"created_at\");\nEND IF;\nRETURN NULL;\n\nEND\n$$ LANGUAGE PLPGSQL\n")
ci: -> 0.0019s
ci: -- execute("COMMENT ON FUNCTION table_sync_function_d452a5847a IS 'Partitioning migration: table sync for sent_notifications table'")
ci: -> 0.0007s
ci: -- execute("CREATE TRIGGER table_sync_trigger_a747bc4a6e\nAFTER INSERT OR UPDATE OR DELETE ON sent_notifications\nFOR EACH ROW\n\nEXECUTE FUNCTION table_sync_function_d452a5847a()\n")
ci: -> 0.0006s
ci: == 20250808212947 DropPartitionedByCreatedAtSentNotificationsTable: reverted (0.0484s)
ci: == 20250808212723 DropPartitionedIndexInSentNotifications: reverting ==========
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_issue_email_participant_id")
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :issue_email_participant_id, {:name=>"index_40578c5783", :algorithm=>:concurrently})
ci: -> 0.0007s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0003s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :issue_email_participant_id, {:name=>"index_40578c5783", :algorithm=>:concurrently})
ci: -> 0.0018s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0004s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :issue_email_participant_id, {:name=>"index_ce54154efb", :algorithm=>:concurrently})
ci: -> 0.0007s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :issue_email_participant_id, {:name=>"index_ce54154efb", :algorithm=>:concurrently})
ci: -> 0.0011s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :issue_email_participant_id, {:name=>"index_b5d8642b32", :algorithm=>:concurrently})
ci: -> 0.0007s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :issue_email_participant_id, {:name=>"index_b5d8642b32", :algorithm=>:concurrently})
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :issue_email_participant_id, {:name=>"index_86d2eeef11", :algorithm=>:concurrently})
ci: -> 0.0006s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :issue_email_participant_id, {:name=>"index_86d2eeef11", :algorithm=>:concurrently})
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :issue_email_participant_id, {:name=>"index_a3fba6af13", :algorithm=>:concurrently})
ci: -> 0.0006s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :issue_email_participant_id, {:name=>"index_a3fba6af13", :algorithm=>:concurrently})
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :issue_email_participant_id, {:name=>"index_776383d979", :algorithm=>:concurrently})
ci: -> 0.0006s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :issue_email_participant_id, {:name=>"index_776383d979", :algorithm=>:concurrently})
ci: -> 0.0010s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :issue_email_participant_id, {:name=>"index_7457060051", :algorithm=>:concurrently})
ci: -> 0.0007s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :issue_email_participant_id, {:name=>"index_7457060051", :algorithm=>:concurrently})
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- add_index(:sent_notifications_7abbf02cb6, :issue_email_participant_id, {:name=>"idx_p_sent_notifications_on_issue_email_participant_id"})
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_namespace_id")
ci: -> 0.0005s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :namespace_id, {:name=>"index_401fa5056c", :algorithm=>:concurrently})
ci: -> 0.0010s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", :namespace_id, {:name=>"index_401fa5056c", :algorithm=>:concurrently})
ci: -> 0.0010s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :namespace_id, {:name=>"index_055d233ac6", :algorithm=>:concurrently})
ci: -> 0.0009s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", :namespace_id, {:name=>"index_055d233ac6", :algorithm=>:concurrently})
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :namespace_id, {:name=>"index_59dc18e9c9", :algorithm=>:concurrently})
ci: -> 0.0011s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", :namespace_id, {:name=>"index_59dc18e9c9", :algorithm=>:concurrently})
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :namespace_id, {:name=>"index_bac445a0ad", :algorithm=>:concurrently})
ci: -> 0.0013s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", :namespace_id, {:name=>"index_bac445a0ad", :algorithm=>:concurrently})
ci: -> 0.0010s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :namespace_id, {:name=>"index_9404e368e6", :algorithm=>:concurrently})
ci: -> 0.0016s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", :namespace_id, {:name=>"index_9404e368e6", :algorithm=>:concurrently})
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :namespace_id, {:name=>"index_ab01f4ae3f", :algorithm=>:concurrently})
ci: -> 0.0018s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", :namespace_id, {:name=>"index_ab01f4ae3f", :algorithm=>:concurrently})
ci: -> 0.0017s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :namespace_id, {:name=>"index_1b371ee0bd", :algorithm=>:concurrently})
ci: -> 0.0010s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", :namespace_id, {:name=>"index_1b371ee0bd", :algorithm=>:concurrently})
ci: -> 0.0012s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- add_index(:sent_notifications_7abbf02cb6, :namespace_id, {:name=>"idx_p_sent_notifications_on_namespace_id"})
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_name_exists?(:sent_notifications_7abbf02cb6, "idx_p_sent_notifications_on_noteable_type_noteable_id_and_id")
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", [:noteable_id, :id], {:name=>"index_8d57da74a4", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0013s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000", [:noteable_id, :id], {:name=>"index_8d57da74a4", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0027s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", [:noteable_id, :id], {:name=>"index_fa325a0544", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0015s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504", [:noteable_id, :id], {:name=>"index_fa325a0544", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0024s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", [:noteable_id, :id], {:name=>"index_7e17ffc913", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0012s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505", [:noteable_id, :id], {:name=>"index_7e17ffc913", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0023s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", [:noteable_id, :id], {:name=>"index_267bf71cfc", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0014s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506", [:noteable_id, :id], {:name=>"index_267bf71cfc", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0023s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", [:noteable_id, :id], {:name=>"index_4d9f7ef196", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0013s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507", [:noteable_id, :id], {:name=>"index_4d9f7ef196", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0022s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", [:noteable_id, :id], {:name=>"index_7cf605249b", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0012s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508", [:noteable_id, :id], {:name=>"index_7cf605249b", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0022s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- index_exists?("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", [:noteable_id, :id], {:name=>"index_da13615773", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0012s
ci: -- add_index("gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509", [:noteable_id, :id], {:name=>"index_da13615773", :where=>"noteable_type = 'Issue'", :algorithm=>:concurrently})
ci: -> 0.0024s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- add_index(:sent_notifications_7abbf02cb6, [:noteable_id, :id], {:name=>"idx_p_sent_notifications_on_noteable_type_noteable_id_and_id", :where=>"noteable_type = 'Issue'"})
ci: -> 0.0026s
ci: == 20250808212723 DropPartitionedIndexInSentNotifications: reverted (0.1473s) =
ci: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: reverting
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0012s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_000000 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0024s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0006s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202504 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0091s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0006s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202505 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0006s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202506 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0007s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202507 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0011s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202508 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0011s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0010s
ci: -- execute("ALTER TABLE gitlab_partitions_dynamic.sent_notifications_7abbf02cb6_202509 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0008s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE sent_notifications_7abbf02cb6 ADD CONSTRAINT fk_rails_091ff9020c FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants (id) ON DELETE CASCADE ;")
ci: -> 0.0013s
ci: -- execute("ALTER TABLE sent_notifications_7abbf02cb6 VALIDATE CONSTRAINT fk_rails_091ff9020c;")
ci: -> 0.0004s
ci: == 20250808212545 DropPartitionedSentNotificationsEmailParticipantFk: reverted (0.1118s)
ci: == 20250808211506 CleanSentNotificationsFirstBackfill: reverting ==============
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_ci_cell_local, :gitlab_internal, :gitlab_shared].
ci: == 20250808211506 CleanSentNotificationsFirstBackfill: reverted (0.0070s) =====
ci: == [advisory_lock_connection] object_id: 147240, pg_backend_pid: 42921
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #514591 (closed)
Edited by Mario Celi