-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat (sync service): multi tenancy #1886
Draft
kevin-dp
wants to merge
44
commits into
main
Choose a base branch
from
kevin/multi-tenancy-continued
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
a7635b4
Add TenantManager that spawns the necessary processes per tenant.
kevin-dp 5d043dd
Initialize separate storage backend for each tenant
alco bdeaa7d
Fix tests
alco b5e82c3
mix format
alco 411920d
Fix missing :storage and :tenant_id options where needed
alco a474bb2
Support configuring a default tenant when running in any environment,…
alco 36706cc
Use default tenant for TS integration tests on CI
alco fa9a30f
Adjust the health check endpoint for CI
alco 0ec2d47
fixup! Support configuring a default tenant when running in any envir…
alco 967eda1
(tmp) Load requested or default tenant in DeleteShapePlug
alco 73a97d1
Add tenant id to .env.dev
msfstef 92cffbb
Fix typo in options passed to plug.
kevin-dp 3635359
Remove commented tests because they are either obsolete or included i…
kevin-dp 3e56275
Fix unit tests.
kevin-dp b3c1b6d
Make default tenant optional
kevin-dp d3e576a
rename TENANT_ID env var to DATABASE_ID
kevin-dp 236416f
Modify health check endpoint to take a database_id
kevin-dp 0164741
Restore allow_shape_deletion config option needed for delete shape plug.
kevin-dp 8658cde
Fix react hooks test
kevin-dp 59ac1e5
Fix rolling deploy integration test
kevin-dp 57bb217
Unit tests for add database plug.
kevin-dp ae23e4e
Add optional databaseId parameter the ShapeStream for selecting a DB …
kevin-dp 9039c2a
Integration test for multi tenancy
kevin-dp 1d270ec
Fix error message in delete shape plug
kevin-dp 9908d56
Plug for deleting a tenant
kevin-dp 64977ae
Fix clearShape in test setup
kevin-dp c20052c
Do not take the tenant ID of the 2nd tenant for tge integration test …
kevin-dp 944a136
Rename delete DB plug to remove DB plug.
kevin-dp 1a4911a
Unit tests for remove DB plug
kevin-dp d65aa58
Remove obsolete comment
kevin-dp b39272d
Extract duplicated functions for loading tenant to utility module.
kevin-dp f41a678
Return 404 if tenant is not found
kevin-dp f2e8bb0
Update OpenAPI spec
kevin-dp f797d47
Rename id parameter to database_id in add DB plug
kevin-dp a33d72b
Disable file parallelism in vitest to avoid flaky tests due to some u…
kevin-dp c068bb3
Handle failure to parse connection string
kevin-dp 02bc39b
Store references to per-tenant ETS tables in a global ETS table.
kevin-dp 305a3c3
WIP shutting down
kevin-dp 1fdcb2a
Reverse error messages
msfstef cdda115
Shutdown tenant processes and clean up ETS table when tenant is deleted.
kevin-dp ed2dbd9
Introduce a with_supervised_tenant in component_setup.
kevin-dp fc9ec7c
Rebase on top of main
kevin-dp de5360f
Pass tenant_id option to stop_tenant
kevin-dp 6fd3b59
WIP tenant persistence
kevin-dp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
LOG_LEVEL=info | ||
DATABASE_URL=postgresql://postgres:password@localhost:54321/postgres?sslmode=disable | ||
DATABASE_ID=test_tenant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
listen_addresses = '*' | ||
wal_level = logical # minimal, replica, or logical | ||
port = 5433 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nitpick: why do you need to change the internal listening port instead of using existing pg conf? The PGs are always different either on mapped port from the POV of host machine, or on hostname from POV of other docker containers in the compose file