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 issue with concurrent identical searches (Fixes #233), Change "log" level messaging to "debug1" (Fixes #242) #258

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

bitner
Copy link
Collaborator

@bitner bitner commented Apr 17, 2024

Fixed

  • Change all "RAISE LOG" instances to "RAISE DEBUG1" (Fixes Excessive growth of database logs #242)
    • In client_min_messages, "LOG" level is lower than "NOTICE", but in log_min_messages "LOG" level is higher leading to huge growth in messages going to the log even though they don't show up with client_min_messages. This changes the use of "RAISE LOG" to "RAISE DEBUG1" which is lower than "NOTICE" in both client_min_messages and log_min_messages to allow for multiple levels of verbosity.
  • Refactor search_query and search_where functions to eliminate race condition when running identical new searches concurrently. (Fixes Occasional syntax errors from well formed search queries #233)
    • Reorders how we check if we need to run stats so that we can return as early as possible when we know we don't need to update statistics.
    • Does not use cache for where and order by statements any more. These functions are quite fast and there are no mechanisms to clear cached values when any changes in search to SQL function code changes.
    • Improve timing of using SKIP LOCKED to allow for better ability to reduce lock contention by skipping updates to lastused and usecount fields under concurrent identical queries.
    • Fix some issues with read only mode to make sure we don't try to update statistics when using read only mode.

@bitner
Copy link
Collaborator Author

bitner commented Apr 17, 2024

@drnextgis or @mrob95 can one of you try to get the race condition using this branch? I haven't been able to replicate it.

@bitner bitner marked this pull request as ready for review April 17, 2024 20:42
@bitner bitner requested a review from drnextgis April 17, 2024 22:05
@drnextgis
Copy link
Collaborator

drnextgis commented Apr 17, 2024

I've tested it using this branch and no longer encountered the problem.

@bitner bitner merged commit a993d2c into main Apr 18, 2024
15 checks passed
@drnextgis
Copy link
Collaborator

Glad to see it's been merged. Looking forward to the new release!

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.

Excessive growth of database logs Occasional syntax errors from well formed search queries
2 participants