Skip to content

Order cluster token by last used

Tiger Watson requested to merge 322128-token-order-attempt-2 into master

What does this MR do?

Re-attempt of !57520 (merged), which was reverted.

Migrations

== 20210420012909 IndexClusterAgentTokensOnLastUsedAt: reverting ==============
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:cluster_agent_tokens, :agent_id, {:name=>"index_cluster_agent_tokens_on_agent_id", :algorithm=>:concurrently})
   -> 0.0034s
-- execute("SET statement_timeout TO 0")
   -> 0.0007s
-- add_index(:cluster_agent_tokens, :agent_id, {:name=>"index_cluster_agent_tokens_on_agent_id", :algorithm=>:concurrently})
   -> 0.0059s
-- execute("RESET ALL")
   -> 0.0006s
-- transaction_open?()
   -> 0.0000s
-- indexes(:cluster_agent_tokens)
   -> 0.0021s
-- remove_index(:cluster_agent_tokens, {:algorithm=>:concurrently, :name=>"index_cluster_agent_tokens_on_agent_id_and_last_used_at"})
   -> 0.0051s
== 20210420012909 IndexClusterAgentTokensOnLastUsedAt: reverted (0.0198s) =====

== 20210420012909 IndexClusterAgentTokensOnLastUsedAt: migrating ==============
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:cluster_agent_tokens, "agent_id, last_used_at DESC NULLS LAST", {:name=>"index_cluster_agent_tokens_on_agent_id_and_last_used_at", :algorithm=>:concurrently})
   -> 0.0060s
-- execute("SET statement_timeout TO 0")
   -> 0.0009s
-- add_index(:cluster_agent_tokens, "agent_id, last_used_at DESC NULLS LAST", {:name=>"index_cluster_agent_tokens_on_agent_id_and_last_used_at", :algorithm=>:concurrently})
   -> 0.0083s
-- execute("RESET ALL")
   -> 0.0014s
-- transaction_open?()
   -> 0.0000s
-- indexes(:cluster_agent_tokens)
   -> 0.0040s
-- remove_index(:cluster_agent_tokens, {:algorithm=>:concurrently, :name=>"index_cluster_agent_tokens_on_agent_id"})
   -> 0.0050s
== 20210420012909 IndexClusterAgentTokensOnLastUsedAt: migrated (0.0290s) =====

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #327316 (closed)

Edited by Tiger Watson

Merge request reports