{"action":"created","issue":{"url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/298","repository_url":"https://api.github.com/repos/sourcegraph/sourcegraph","labels_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/298/comments","events_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/298/events","html_url":"https://github.com/sourcegraph/sourcegraph/pull/298","id":166976762,"number":298,"title":"reenable defs2 ref_ct update","user":{"login":"beyang","id":1646931,"avatar_url":"https://avatars.githubusercontent.com/u/1646931?v=3","gravatar_id":"","url":"https://api.github.com/users/beyang","html_url":"https://github.com/beyang","followers_url":"https://api.github.com/users/beyang/followers","following_url":"https://api.github.com/users/beyang/following{/other_user}","gists_url":"https://api.github.com/users/beyang/gists{/gist_id}","starred_url":"https://api.github.com/users/beyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyang/subscriptions","organizations_url":"https://api.github.com/users/beyang/orgs","repos_url":"https://api.github.com/users/beyang/repos","events_url":"https://api.github.com/users/beyang/events{/privacy}","received_events_url":"https://api.github.com/users/beyang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"keegancsmith","id":187831,"avatar_url":"https://avatars.githubusercontent.com/u/187831?v=3","gravatar_id":"","url":"https://api.github.com/users/keegancsmith","html_url":"https://github.com/keegancsmith","followers_url":"https://api.github.com/users/keegancsmith/followers","following_url":"https://api.github.com/users/keegancsmith/following{/other_user}","gists_url":"https://api.github.com/users/keegancsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/keegancsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keegancsmith/subscriptions","organizations_url":"https://api.github.com/users/keegancsmith/orgs","repos_url":"https://api.github.com/users/keegancsmith/repos","events_url":"https://api.github.com/users/keegancsmith/events{/privacy}","received_events_url":"https://api.github.com/users/keegancsmith/received_events","type":"User","site_admin":false},"assignees":[{"login":"keegancsmith","id":187831,"avatar_url":"https://avatars.githubusercontent.com/u/187831?v=3","gravatar_id":"","url":"https://api.github.com/users/keegancsmith","html_url":"https://github.com/keegancsmith","followers_url":"https://api.github.com/users/keegancsmith/followers","following_url":"https://api.github.com/users/keegancsmith/following{/other_user}","gists_url":"https://api.github.com/users/keegancsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/keegancsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keegancsmith/subscriptions","organizations_url":"https://api.github.com/users/keegancsmith/orgs","repos_url":"https://api.github.com/users/keegancsmith/repos","events_url":"https://api.github.com/users/keegancsmith/events{/privacy}","received_events_url":"https://api.github.com/users/keegancsmith/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-07-22T06:11:32Z","updated_at":"2016-07-22T07:59:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sourcegraph/sourcegraph/pulls/298","html_url":"https://github.com/sourcegraph/sourcegraph/pull/298","diff_url":"https://github.com/sourcegraph/sourcegraph/pull/298.diff","patch_url":"https://github.com/sourcegraph/sourcegraph/pull/298.patch"},"body":"The update of `defs2.ref_ct` has been disabled since July 1st because it was leading to deadlocks in the database that resulted in p0 performance degradation of search. Without the ref count update, search rankings are based on text similarity only, which means oftentimes results from popular libraries don't show up in results. We've worked around this with the search filter buttons, but these are cumbersome to use and severely limit the power and usefulness of search. This change re-enables the ref count update while ensuring that the row-level update locks are acquired in a consistent order to prevent deadlocks.\r\n\r\nFor explanation of why this works, see:\r\n- https://www.postgresql.org/docs/current/static/sql-select.html#SQL-FOR-UPDATE-SHARE\r\n- http://dba.stackexchange.com/questions/68388/optimizing-concurrent-updates-in-postgres"},"comment":{"url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/comments/234479253","html_url":"https://github.com/sourcegraph/sourcegraph/pull/298#issuecomment-234479253","issue_url":"https://api.github.com/repos/sourcegraph/sourcegraph/issues/298","id":234479253,"user":{"login":"keegancsmith","id":187831,"avatar_url":"https://avatars.githubusercontent.com/u/187831?v=3","gravatar_id":"","url":"https://api.github.com/users/keegancsmith","html_url":"https://github.com/keegancsmith","followers_url":"https://api.github.com/users/keegancsmith/followers","following_url":"https://api.github.com/users/keegancsmith/following{/other_user}","gists_url":"https://api.github.com/users/keegancsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/keegancsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keegancsmith/subscriptions","organizations_url":"https://api.github.com/users/keegancsmith/orgs","repos_url":"https://api.github.com/users/keegancsmith/repos","events_url":"https://api.github.com/users/keegancsmith/events{/privacy}","received_events_url":"https://api.github.com/users/keegancsmith/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T07:59:09Z","updated_at":"2016-07-22T07:59:09Z","body":"@beyang LGTM, but monitor https://grafana.sgdev.org/dashboard/db/build-metrics\r\nCurrently the async queue size as well as number of errors is always close to zero. IE the async queue works very well at the moment. I'm concerned this change might either make updates a lot slower (so the queue size grows), or introduce errors (from lock acquisition). But best way to find out is in prod :P\r\n\r\nFYI I can finish off a change where we ensure only one update to a repo happens at a time. I'll timebox 15min to see if I can finish it off. That should mean we can remove the concurrent lock hacks."}}
{"actor":{"display_login":"keegancsmith"}}