PG full-text search to reduce 500s and improve performance
This is pretty similar to #249180 (closed), but it seems the root cause is related to the issue_ids
/ metadata.
There are 500 errors that appear when you search the issues list from time to time. In my case, these 2 errors happened back-to-back:
- https://gitlab.com/gitlab-com/www-gitlab-com/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=engineering+okr
- https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&utf8=%E2%9C%93&state=opened&search=500+searching+for+issues (oddly enough, I was searching to see if there was an issue like this already created)
https://sentry.gitlab.net/gitlab/gitlabcom/issues/2073828/?referrer=gitlab_plugin
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
@connection.exec_params(sql, type_casted_binds)
active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
@connection.exec_params(sql, type_casted_binds)
active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
yield
active_support/concurrency/share_lock.rb:187:in `yield_shares'
yield
active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
@lock.yield_shares(compatible: [:load]) do
...
(191 additional frame(s) were not displayed)
ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
Remaining todos
-
Fix minor bug with FT search and moved issues: !85886 (merged) (merged) -
Fix minor bug when a full web address is included in the search terms (#354784 (comment 905431920)) -
Finalize the background migration for self-hosted instances -
Enable by default / cleanup the feature flag
Edited by Heinrich Lee Yu