Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting pg_trgm.similarity_threshold on new connection #1084

Merged
merged 2 commits into from
Dec 1, 2020

Conversation

raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Dec 1, 2020

Trello Card Link

https://trello.com/c/B8dTGjQO/1706-determine-why-some-search-results-in-api-are-not-returning-successfully-https-discoveryprovideraudiusco-v1-tracks-searchquery3la

Description

Sets (resets) pg_trgm.similarity_threshold every time the session manager engine creates a new connection. The setting persists across connections (which I had misunderstood before). Once set on the connection, any session that uses the connection will have the setting.

Services

  • Discovery Provider

Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?

Delete an option.

  • ✅ Nope

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
Include log analysis if applicable.

Repro of bug (before change)

  1. Ran local discovery provider pointed at a db clone.
  2. Updated connection pool timeout to be 60s (instead of 3600s) and pool count to 2.
  3. Added a log statement to query + SHOW pg_trgm.similarity_threshold every time the search endpoint would hit.
  4. Successfully ran one search query for 3lau+touch+carly+paige
  5. Waited 60s
  6. Reran search query for 3lau+touch+carly+paige and saw error message that pg_trgm.similarity_threshold was unset

Rolled out this code change & repeated 1-5 and #6 returned successfully

Copy link
Contributor

@dmanjunath dmanjunath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding comments

@raymondjacobson raymondjacobson merged commit c316ad0 into master Dec 1, 2020
@raymondjacobson raymondjacobson deleted the rj-fix-pgtrgm-sim-set branch December 1, 2020 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants