-
Notifications
You must be signed in to change notification settings - Fork 663
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
Postgres read replica support #2019
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
9387833 | Triggered | Generic Password | 259c01c | docker-compose.dev-read-replica.yml | View secret |
9387833 | Triggered | Generic Password | 259c01c | docker-compose.dev-read-replica.yml | View secret |
9387833 | Triggered | Generic Password | 259c01c | docker-compose.dev-read-replica.yml | View secret |
π Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
π¦ GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
β¦for replication
0320498
to
5d59fe8
Compare
backend/src/ee/services/dynamic-secret-lease/dynamic-secret-lease-dal.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tested on my end, works well
@@ -1,4 +1,4 @@ | |||
import { Knex } from "knex"; | |||
import { Knex as KnexOriginal } from "knex"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: if KnexOriginal is the same as Knex, what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!readReplicaDbs.length) return db; | ||
|
||
const selectedReplica = readReplicaDbs[Math.floor(Math.random() * readReplicaDbs.length)]; | ||
return selectedReplica; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to round robin so there is even distribution of queries to read dbs. Maybe in the future we can add this counter to Redis to make it better
Description π£
This PR introduces the feature for Infisical to use postgres read replica. The write operation and transactions goes through the primary/master instance. The read operation go through read replica.
If read replicas are not provided master instance is used.
Type β¨
Tests π οΈ
# Here's some code block to paste some code snippets