Skip to content
Snippets Groups Projects

Receptive cluster agents

Closed Tiger Watson requested to merge receptive-cluster-agents into master
5 unresolved threads

What does this MR do and why?

Draft: Receptive cluster agents

Changelog: added

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #463427 (closed) #463426 (closed)

Edited by Timo Furrer

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 ---
2 name: cluster_agent_incoming_connections
3 feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/463427
4 introduced_by_url:
  • 6 Warnings
    :warning: This merge request is quite big (1521 lines changed), please consider splitting it into multiple merge requests.
    :warning: 141e0313: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    :warning: 2c618985: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    :warning: da8659fa: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    :warning: :hourglass: Migration Timestamp Out of Date
    The following migrations have timestamps that are over three weeks old:
    • db/migrate/20240725223931_create_cluster_agent_url_configurations.rb
    • db/migrate/20240725224013_add_cluster_agent_url_configurations_fks.rb

    Please double check the timestamps and update them if possible. Why does this matter?

    :warning:

    featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.

    For more information, see:

    2 Messages
    :book: CHANGELOG missing:

    If this merge request needs a changelog entry, add the Changelog trailer to the commit message you want to add to the changelog.

    If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.

    :book: This merge request adds or changes files that require a review from the Database team.

    This merge request requires a database review. To make sure these changes are reviewed, take the following steps:

    1. Ensure the merge request has database and databasereview pending labels. If the merge request modifies database files, Danger will do this for you.
    2. Prepare your MR for database review according to the docs.
    3. Assign and mention the database reviewer suggested by Reviewer Roulette.

    The following files require a review from the Database team:

    • db/docs/cluster_agent_url_configurations.yml
    • db/migrate/20240725223931_create_cluster_agent_url_configurations.rb
    • db/migrate/20240725224013_add_cluster_agent_url_configurations_fks.rb
    • db/migrate/20240813074143_add_is_receptive_column_to_cluster_agents.rb
    • db/schema_migrations/20240725223931
    • db/schema_migrations/20240725224013
    • db/schema_migrations/20240813074143
    • db/structure.sql

    Reviewer roulette

    Category Reviewer Maintainer
    backend @shreyasagarwal profile link current availability (UTC+5.5, 6.5 hours behind author) @dblessing profile link current availability (UTC-5, 17 hours behind author)
    database @bala.kumar profile link current availability (UTC+5.5, 6.5 hours behind author) @OmarQunsulGitlab profile link current availability (UTC+2, 10 hours behind author)

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Tiger Watson added 1 commit

    added 1 commit

    • a84687bb - Draft: Receptive cluster agents

    Compare with previous version

  • Tiger Watson added 1 commit

    added 1 commit

    • 0f1d3489 - Draft: Receptive cluster agents

    Compare with previous version

  • Tiger Watson added 1 commit

    added 1 commit

    • 21243ee6 - Draft: Receptive cluster agents

    Compare with previous version

  • Timo Furrer
  • 1 ---
    2 table_name: cluster_agent_url_configurations
    3 classes:
    4 - Clusters::Agents::UrlConfiguration
    5 feature_categories:
    6 - deployment_management
    7 description:
    8 introduced_by_url:
    9 milestone: '17.1'
  • Nicolò Maria Mezzopera changed the description

    changed the description

  • Security policy violations have been resolved.

    Edited by GitLab Security Bot
  • Timo Furrer added 2606 commits

    added 2606 commits

    Compare with previous version

  • Timo Furrer
  • Timo Furrer
  • Timo Furrer
  • Timo Furrer
    • Resolved by Timo Furrer

      Regarding the public REST API to register receptive agents we have multiple options:

      • Extend the current endpoint for registering agents
        • There we can introduce an optional field is_receptive (or similar depending on what we come up with in !160989 (comment 2041249914))
        • And optionally even add optional fields for all the "url configurations"
      • Alternatively to having the "url configurations" in the registering endpoint we could have an additional one to create new url configurations for an existing agent (similar to tokens) - this depends on !160989 (comment 2041214930)
      • Maybe having an additional endpoint to register receptive agents.

      ... let me make some proposals:

      Option 1: all-in-one

      API endpoints:

      • POST [..]/cluster_agents
        • Registers receptive and normal agents depending on a field
        • Optional fields for url configuration

      This would also support only one url configuration per agent. See !160989 (comment 2041214930)

      Option 2:

      API endpoints:

      • POST [..]/cluster_agents
        • Registers receptive and normal agents depending on a field
      • POST [..]/cluster_agents/:id/url_configurations
        • Registers url configuration for a receptive agent

      To have a fully functional receptive agent a registration call must always be followed by a url configuration call. An agent is always registered as either receptive or not.

      Option 3:

      • POST [..]/cluster_agents
      • POST [..]/cluster_agents/:id/url_configurations
        • Registers url configuration for a receptive agent

      Similar to "Option 2" BUT if an agent is considered receptive or not depends on the existence of a url configuration.

      Option 4:

      • POST [..]/clusters_agents/receptive (or maybe at [..]/cluster_receptive_agents)

      This can be combined with an additional endpoint for url configurations or not. However, I kinda dislike this option just because it's confusing from an API design point so I'm not fully writing it up here. Please object if you want to explore it further.


      @tigerwnz @ash2k WDYT about the options above? Other ideas and preferences?

  • Timo Furrer added 9 commits

    added 9 commits

    • 8188b4a0 - Ignore unused connection_mode column in cluster agents table
    • f5b9cd6f - Add is_receptive column to cluster agents table
    • 3093d238 - Expose is_receptive agent field in REST API
    • b5df02ab - Introduce feature flag for receptive agents
    • b30e25da - Implement cluster agent url configuration model
    • 53bdc2c1 - Implement create service for agent url configuration
    • c2dc2d21 - Implement delete service for agent url configuration
    • ba05acce - Implement REST API for cluster agent url configurations
    • 4eeebaf0 - Implement internal REST API for receptive agents

    Compare with previous version

  • Ghost User
  • 60 params: url_cfg_params
    61 ).execute
    62
    63 bad_request!(result[:message]) if result[:status] == :error
    64
    65 present result[:url_configuration], with: Entities::Clusters::AgentUrlConfiguration
    66 end
    67
    68 desc 'Delete an agent url configuration' do
    69 detail 'This feature was introduced in GitLab 17.4. Deletes an agent url configuration.'
    70 tags %w[cluster_agents]
    71 end
    72 params do
    73 requires :url_configuration_id, type: Integer, desc: 'The ID of the agent url configuration'
    74 end
    75 delete ':url_configuration_id' do
    • When using update, upsert, delete, destroy, update_all, upsert_all, delete_all or destroy_all you must include the full database query and query execution plan in the merge request description, and request a database review.

      This comment can be ignored if the object is not an ActiveRecord class, since no database query would be generated.


      For more information, see Database Review documentation.

    • Please register or sign in to reply
  • Timo Furrer added 1 commit

    added 1 commit

    • 070a452b - Implement internal REST API for receptive agents

    Compare with previous version

  • Timo Furrer changed milestone to %17.4

    changed milestone to %17.4

  • Timo Furrer
  • Timo Furrer added 5 commits

    added 5 commits

    • f36be034 - Implement cluster agent url configuration model
    • bde50d29 - Implement create service for agent url configuration
    • ffbf6ceb - Implement delete service for agent url configuration
    • 2e514b54 - Implement REST API for cluster agent url configurations
    • 6c5affd8 - Implement internal REST API for receptive agents

    Compare with previous version

  • Tiger Watson mentioned in merge request !162514 (merged)

    mentioned in merge request !162514 (merged)

  • Timo Furrer added 9 commits

    added 9 commits

    • 308feb41 - Ignore unused connection_mode column in cluster agents table
    • f0593bbf - Add is_receptive column to cluster agents table
    • 4c6b1a81 - Expose is_receptive agent field in REST API
    • 3f054ddb - Introduce feature flag for receptive agents
    • 5ba2b742 - Implement cluster agent url configuration model
    • 44c750f7 - Implement create service for agent url configuration
    • b499d592 - Implement delete service for agent url configuration
    • dbc88b38 - Implement REST API for cluster agent url configurations
    • 226a8a86 - Implement internal REST API for receptive agents

    Compare with previous version

  • Ghost User
  • 45
    46 after_create :set_agent_receptive!
    47 after_destroy :unset_agent_receptive!
    48
    49 private
    50
    51 def public_key_auth?
    52 public_key.present?
    53 end
    54
    55 def certificate_auth?
    56 !public_key_auth?
    57 end
    58
    59 def set_agent_receptive!
    60 agent.update!(is_receptive: true)
    • When using update, upsert, delete, destroy, update_all, upsert_all, delete_all or destroy_all you must include the full database query and query execution plan in the merge request description, and request a database review.

      This comment can be ignored if the object is not an ActiveRecord class, since no database query would be generated.


      For more information, see Database Review documentation.

    • Please register or sign in to reply
  • Ghost User
  • 49 private
    50
    51 def public_key_auth?
    52 public_key.present?
    53 end
    54
    55 def certificate_auth?
    56 !public_key_auth?
    57 end
    58
    59 def set_agent_receptive!
    60 agent.update!(is_receptive: true)
    61 end
    62
    63 def unset_agent_receptive!
    64 agent.update!(is_receptive: false)
    • When using update, upsert, delete, destroy, update_all, upsert_all, delete_all or destroy_all you must include the full database query and query execution plan in the merge request description, and request a database review.

      This comment can be ignored if the object is not an ActiveRecord class, since no database query would be generated.


      For more information, see Database Review documentation.

    • Please register or sign in to reply
  • Timo Furrer added 1 commit

    added 1 commit

    • 9d2c3402 - Implement internal REST API for receptive agents

    Compare with previous version

  • Timo Furrer added 2 commits

    added 2 commits

    • 6c884233 - Implement REST API for cluster agent url configurations
    • 5a9355f1 - Implement internal REST API for receptive agents

    Compare with previous version

  • Timo Furrer added 5 commits

    added 5 commits

    • 19f70e11 - Implement cluster agent url configuration model
    • 76e5d38b - Implement create service for agent url configuration
    • a5852f39 - Implement delete service for agent url configuration
    • 70672be4 - Implement REST API for cluster agent url configurations
    • e8599ade - Implement internal REST API for receptive agents

    Compare with previous version

  • Timo Furrer added 705 commits

    added 705 commits

    • e8599ade...a5caed79 - 696 commits from branch master
    • fbcfc81d - Ignore unused connection_mode column in cluster agents table
    • 27a41ebb - Add is_receptive column to cluster agents table
    • d54feef1 - Expose is_receptive agent field in REST API
    • 6363f517 - Introduce feature flag for receptive agents
    • bda38621 - Implement cluster agent url configuration model
    • 5b7f9cf1 - Implement create service for agent url configuration
    • d33907e2 - Implement delete service for agent url configuration
    • ee385218 - Implement REST API for cluster agent url configurations
    • 2efccb3c - Implement internal REST API for receptive agents

    Compare with previous version

  • mentioned in issue #479143 (closed)

  • Timo Furrer marked this merge request as ready

    marked this merge request as ready

  • Timo Furrer changed the description

    changed the description

  • Timo Furrer added 3 commits

    added 3 commits

    • 4e2ef312 - Implement delete service for agent url configuration
    • 4fab58fb - Implement REST API for cluster agent url configurations
    • 515a86ca - Implement internal REST API for receptive agents

    Compare with previous version

  • Database migrations (on the main database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20240725223931 - CreateClusterAgentUrlConfigurations Regular 5.9 s :white_check_mark: +56.00 KiB
    20240725224013 - AddClusterAgentUrlConfigurationsFks Regular 8.0 s :white_check_mark: +8.00 KiB [note]
    20240813074143 - AddIsReceptiveColumnToClusterAgents Regular 4.5 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 29
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20240725223931 - CreateClusterAgentUrlConfigurations

    • Type: Regular
    • Duration: 5.9 s
    • Database size change: +56.00 KiB
    Calls Total Time Max Time Mean Time Rows Query
    1 44.0 ms 44.0 ms 44.0 ms 0
    CREATE TABLE "cluster_agent_url_configurations" ("id" bigserial primary key, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, "agent_id" bigint NOT NULL, "project_id" bigint NOT NULL, "created_by_user_id" bigint, "status" smallint DEFAULT 0 NOT NULL, "url" text NOT NULL, "ca_cert" text, "client_key" text, "client_cert" text, "tls_host" text, "public_key" bytea, "encrypted_private_key" bytea, "encrypted_private_key_iv" bytea, CONSTRAINT check_ed21ced327 CHECK (char_length("url") <= 2048), CONSTRAINT check_25ef8c679c CHECK (char_length("ca_cert") <= 16384), CONSTRAINT check_e3736d97df CHECK (char_length("client_key") <= 16384), CONSTRAINT check_93a57284e5 CHECK (char_length("client_cert") <= 16384), CONSTRAINT check_1ffcfef6d6 CHECK (char_length("tls_host") <= 2048))
    1 3.4 ms 3.4 ms 3.4 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_user_id" ON "cluster_agent_url_configurations" ("created_by_user_id")
    WHERE created_by_user_id IS NOT NULL
    1 1.8 ms 1.8 ms 1.8 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_project_id" ON "cluster_agent_url_configurations" ("project_id")
    1 1.8 ms 1.8 ms 1.8 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_agent_id" ON "cluster_agent_url_configurations" ("agent_id")
    1 0.1 ms 0.1 ms 0.1 ms 1
    SELECT "feature_gates"."key", "feature_gates"."value"  FROM "feature_gates"  WHERE "feature_gates"."feature_key" = $1
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for CreateClusterAgentUrlConfigurations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 8
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20240725224013 - AddClusterAgentUrlConfigurationsFks

    • Type: Regular
    • Duration: 8.0 s
    • Database size change: +8.00 KiB [note]
    Calls Total Time Max Time Mean Time Rows Query
    1 92.6 ms 92.6 ms 92.6 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_49b126e246
    1 58.2 ms 58.2 ms 58.2 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_12d4a33b65
    1 9.7 ms 9.7 ms 9.7 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_02c2a4f060 FOREIGN KEY (agent_id) REFERENCES cluster_agents (id) ON DELETE CASCADE NOT VALID
    1 9.3 ms 9.3 ms 9.3 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_12d4a33b65 FOREIGN KEY (created_by_user_id) REFERENCES users (id) ON DELETE
    SET NULL NOT VALID
    1 8.8 ms 8.8 ms 8.8 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_02c2a4f060
    1 6.2 ms 6.2 ms 6.2 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_49b126e246 FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE NOT VALID
    3 1.2 ms 0.7 ms 0.4 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    6 1.5 ms 0.3 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddClusterAgentUrlConfigurationsFks
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 17
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20240813074143 - AddIsReceptiveColumnToClusterAgents

    • Type: Regular
    • Duration: 4.5 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 1.5 ms 1.5 ms 1.5 ms 0
    ALTER TABLE "cluster_agents" ADD "is_receptive" bool DEFAULT FALSE NOT NULL
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    Histogram for AddIsReceptiveColumnToClusterAgents
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 4
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20240705103503 - RemoveProjectsSbomOccurrencesProjectIdFk Post deploy 5.1 s :white_check_mark: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3610444-15036244-main 2024-08-16T09:53:57Z 2024-08-16T08:09:58Z 2024-08-16 22:03:02 +0000
    database-testing-3610444-15036244-ci 2024-08-16T09:53:57Z 2024-08-16T08:44:55Z 2024-08-16 22:03:02 +0000

    Job artifacts

    Database migrations (on the ci database)

    1 Warnings
    :warning: 20240725223931 - CreateClusterAgentUrlConfigurations had a query that exceeded timing
    guidelines
    . Run time should not exceed 100ms, but it was 167.62ms. Please consider possible options
    to improve the query performance.
    CREATE TABLE "cluster_agent_url_configurations" ("id"
    bigserial primary key, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL,
    "agent_id" bigint NOT NULL, "project_id" bigint NOT NULL, "created_by_user_id" bigint, "status"
    smallint DEFAULT 0 NOT NULL, "url" text NOT NULL, "ca_cert" text, "client_key" text, "client_cert"
    text, "tls_host" text, "public_key" bytea, "encrypted_private_key" bytea, "encrypted_private_key_iv"
    bytea, CONSTRAINT check_ed21ced327 CHECK (char_length("url") <= 2048), CONSTRAINT check_25ef8c679c
    CHECK (char_length("ca_cert") <= 16384), CONSTRAINT check_e3736d97df CHECK
    (char_length("client_key") <= 16384), CONSTRAINT check_93a57284e5 CHECK (char_length("client_cert")
    <= 16384), CONSTRAINT check_1ffcfef6d6 CHECK (char_length("tls_host") <= 2048))

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20240725223931 - CreateClusterAgentUrlConfigurations Regular 8.2 s :warning: +72.00 KiB
    20240725224013 - AddClusterAgentUrlConfigurationsFks Regular 10.1 s :white_check_mark: +0.00 B
    20240813074143 - AddIsReceptiveColumnToClusterAgents Regular 6.5 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 31
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    :warning: Migration: 20240725223931 - CreateClusterAgentUrlConfigurations

    • Type: Regular
    • Duration: 8.2 s
    • Database size change: +72.00 KiB
    Calls Total Time Max Time Mean Time Rows Query
    1 167.6 ms 167.6 ms 167.6 ms 0
    CREATE TABLE "cluster_agent_url_configurations" ("id" bigserial primary key, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, "agent_id" bigint NOT NULL, "project_id" bigint NOT NULL, "created_by_user_id" bigint, "status" smallint DEFAULT 0 NOT NULL, "url" text NOT NULL, "ca_cert" text, "client_key" text, "client_cert" text, "tls_host" text, "public_key" bytea, "encrypted_private_key" bytea, "encrypted_private_key_iv" bytea, CONSTRAINT check_ed21ced327 CHECK (char_length("url") <= 2048), CONSTRAINT check_25ef8c679c CHECK (char_length("ca_cert") <= 16384), CONSTRAINT check_e3736d97df CHECK (char_length("client_key") <= 16384), CONSTRAINT check_93a57284e5 CHECK (char_length("client_cert") <= 16384), CONSTRAINT check_1ffcfef6d6 CHECK (char_length("tls_host") <= 2048))
    1 8.9 ms 8.9 ms 8.9 ms 0
    CREATE TRIGGER gitlab_schema_write_trigger_for_cluster_agent_url_configurations BEFORE INSERT OR
    UPDATE OR DELETE OR TRUNCATE ON cluster_agent_url_configurations FOR EACH STATEMENT EXECUTE FUNCTION gitlab_schema_prevent_write()
    1 2.9 ms 2.9 ms 2.9 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_agent_id" ON "cluster_agent_url_configurations" ("agent_id")
    1 1.6 ms 1.6 ms 1.6 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_user_id" ON "cluster_agent_url_configurations" ("created_by_user_id")
    WHERE created_by_user_id IS NOT NULL
    1 1.4 ms 1.4 ms 1.4 ms 0
    CREATE INDEX "index_cluster_agent_url_configurations_on_project_id" ON "cluster_agent_url_configurations" ("project_id")
    1 1.0 ms 1.0 ms 1.0 ms 1
    SELECT COUNT(*) from information_schema.triggers
    WHERE event_object_table = $1 AND trigger_name = $2
    1 0.1 ms 0.1 ms 0.1 ms 1
    SELECT table_name
    FROM information_schema.tables
    WHERE table_name = $1 AND table_schema = current_schema()
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    Histogram for CreateClusterAgentUrlConfigurations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 10
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20240725224013 - AddClusterAgentUrlConfigurationsFks

    • Type: Regular
    • Duration: 10.1 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 52.5 ms 52.5 ms 52.5 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_49b126e246 FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE NOT VALID
    1 32.3 ms 32.3 ms 32.3 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_49b126e246
    1 29.8 ms 29.8 ms 29.8 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_12d4a33b65 FOREIGN KEY (created_by_user_id) REFERENCES users (id) ON DELETE
    SET NULL NOT VALID
    1 17.7 ms 17.7 ms 17.7 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_12d4a33b65
    1 14.1 ms 14.1 ms 14.1 ms 0
    ALTER TABLE cluster_agent_url_configurations ADD CONSTRAINT fk_02c2a4f060 FOREIGN KEY (agent_id) REFERENCES cluster_agents (id) ON DELETE CASCADE NOT VALID
    1 4.1 ms 4.1 ms 4.1 ms 0
    ALTER TABLE cluster_agent_url_configurations VALIDATE CONSTRAINT fk_02c2a4f060
    3 1.4 ms 0.7 ms 0.5 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    6 1.2 ms 0.3 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddClusterAgentUrlConfigurationsFks
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 17
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20240813074143 - AddIsReceptiveColumnToClusterAgents

    • Type: Regular
    • Duration: 6.5 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 1.4 ms 1.4 ms 1.4 ms 0
    ALTER TABLE "cluster_agents" ADD "is_receptive" bool DEFAULT FALSE NOT NULL
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT $1::regtype::oid
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddIsReceptiveColumnToClusterAgents
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 4
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20240705103503 - RemoveProjectsSbomOccurrencesProjectIdFk Post deploy 7.1 s :white_check_mark: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3610444-15036244-main 2024-08-16T09:53:57Z 2024-08-16T08:09:58Z 2024-08-16 22:03:02 +0000
    database-testing-3610444-15036244-ci 2024-08-16T09:53:57Z 2024-08-16T08:44:55Z 2024-08-16 22:03:02 +0000

    Job artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

    Edited by ****
  • Timo Furrer added 668 commits

    added 668 commits

    • 515a86ca...10235fc0 - 660 commits from branch master
    • 8a66bb92 - Ignore unused connection_mode column in cluster agents table
    • 8df6e138 - Add is_receptive column to cluster agents table
    • f855f209 - Expose is_receptive agent field in REST API
    • da8659fa - Implement cluster agent url configuration model
    • 9f2d12fe - Implement create service for agent url configuration
    • 57c45fd6 - Implement delete service for agent url configuration
    • 2c618985 - Implement REST API for cluster agent url configurations
    • 141e0313 - Implement internal REST API for receptive agents

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading