Order cluster token by last used
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
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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