-
Notifications
You must be signed in to change notification settings - Fork 18
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
P0 | Disable pg_statements extension with CI test pipeline #1406
Comments
CI working and test passed. But off course we disable Although this extension is needed because we build query tracking with WIthout this extension we can make it work the monitoring built |
@CarlosQ96 Avoid using |
Currently CI test pipeline works perfectly fine without that extension. It's a temporary solution, now we need to figure it out how to disabling it from the test, specifically the |
@Rolazo @geleeroyale After thinking about this, and instead of modifying anything in the tests. I would suggest going with the below solution:
WDYT?? |
I left this PR: Giveth/postgres-givethio#9 to add this feature and tested it. What is left to do is:
Let me know if this helps @Rolazo @geleeroyale |
Explaining the current problem: We can enable and disable functions on our current RDS Postgres database, which is why also we use AWS. Others host providers doesn't allow us to do it. Those functions once enabled, are 100% always enabled. Therefore when we do backups of our databases, those backups will contains all details (data-functions-procedures-schema) The current staging-pipeline, is not using our staging database. It's using the backup store in s3. So it's not a problem for enabling and disabling functions. Why we shoudn't: 1. Disabling and enabling it: Since we have query tracking, we have prometheus containers and grafana dashboards expecting pg_stat_statements. I'm aiming to build alerts based on query-timings. This means disabling that function from our database is gonna make the whole thing failed. So regardles to your PR After searching there's a easy solution for this: Backups excluding function (pg_stat_statements): There's info our there: |
@Rolazo It seems to me you are not 100% aware of how we are using our own testing Docker Container in the CI that is found in the repository here: https://github.com/Giveth/postgres-givethio Again, I am not able to understand why you need to over-complicate this. As I see it: Currently, the scenario is:
And after Adding the
Why dig very deep into postgres if we can try simpler approaches?? Please don't do anything regarding the backups (Don't do any exclusions) Before we all meet up and agree on this. @geleeroyale FYI |
@mhmdksh The current scenario is:
|
It's actually pretty straighfoward. Just modifying in the options here with: |
@Rolazo I thought this option was added already, but it seems it might be a different thing. Please go ahead and try it. And update us how it goes. |
Hey @mhmdksh - I am not as deep into the thing as you guys when it comes to postgres, but from what I have seen, I do think that we should try @Rolazo 's approach. Excluding the extension from the backup is a great thing - saves us some trouble. Also - you should know that we met together with Carlos to find a way to solve it and Krati signed off on these changes. We are getting to a place where we can have better planning before work starts. But I have one question to @Rolazo - can you think of a negative implication removing the extension. We definitely need to test that we can use the backups to fully restore a Giveth db |
Alright I came to the following conclusions:
For future reference, how did I solve it. I create another schema called List of our current schemas
Then I created the extension under that schema: This query proof that the extension belongs to the
Since Commit excluding the schema: This will allow us to make use of pg_stat_statements, passing the test without affecting our database =) @geleeroyale @mhmdksh FYI |
I re run the problematic CI with the latest backups, excluding stats_schema and it worked. |
@Rolazo Regardless of the CI working again or not, Is the query monitoring (The original Functionality that we need) performing the same with this change?? |
@mhmdksh This is going to make our tracking work and passing the test |
Good job @Rolazo let's do a final review together before we close this issue |
Pls move it to QA in zenhub once you have finalized the solution and deployed. |
@jainkrati I moved it, and reviewed it. It seems to be working as intended. We can close this now |
Yep, it was deployed and tested! Worked as intended |
We need to use the postgres extension pg_statements in our databases to improve query monitoring. It is the prime reason why we switched hosted databases from Digitalocean to AWS.
Now - when we use a backup of our staging database as part of our
CI-pipelines
we get the following error:Possible fix: Try to remove the whole extension instead of just dropping the view
The text was updated successfully, but these errors were encountered: