-
Notifications
You must be signed in to change notification settings - Fork 176
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
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
6f776ba
Add TenantManager that spawns the necessary processes per tenant.
kevin-dp dc0352d
Initialize separate storage backend for each tenant
alco ebbb2aa
Fix tests
alco ed497e1
mix format
alco 8d55fee
Fix missing :storage and :tenant_id options where needed
alco e53a144
Support configuring a default tenant when running in any environment,…
alco 7227b24
Use default tenant for TS integration tests on CI
alco e091d1c
Adjust the health check endpoint for CI
alco bebbcdc
fixup! Support configuring a default tenant when running in any envir…
alco 1b9a3ba
(tmp) Load requested or default tenant in DeleteShapePlug
alco 76d9512
Add tenant id to .env.dev
msfstef badc5e1
Fix typo in options passed to plug.
kevin-dp 566626b
Remove commented tests because they are either obsolete or included i…
kevin-dp 3213d22
Fix unit tests.
kevin-dp 5769825
Make default tenant optional
kevin-dp f879573
rename TENANT_ID env var to DATABASE_ID
kevin-dp 904589e
Modify health check endpoint to take a database_id
kevin-dp 5698fce
Restore allow_shape_deletion config option needed for delete shape plug.
kevin-dp 7404df8
Fix react hooks test
kevin-dp e647177
Fix rolling deploy integration test
kevin-dp a4556f7
Unit tests for add database plug.
kevin-dp f72bdb7
Add optional databaseId parameter the ShapeStream for selecting a DB …
kevin-dp 86a4060
Integration test for multi tenancy
kevin-dp 0e47e49
Fix error message in delete shape plug
kevin-dp 33205ba
Plug for deleting a tenant
kevin-dp 6d122af
Fix clearShape in test setup
kevin-dp 3dab5d5
Do not take the tenant ID of the 2nd tenant for tge integration test …
kevin-dp 224d892
Rename delete DB plug to remove DB plug.
kevin-dp 9ef0dcf
Unit tests for remove DB plug
kevin-dp 4a02174
Remove obsolete comment
kevin-dp 3c23385
Extract duplicated functions for loading tenant to utility module.
kevin-dp 350ea8c
Return 404 if tenant is not found
kevin-dp 551e56d
Update OpenAPI spec
kevin-dp 859ac13
Rename id parameter to database_id in add DB plug
kevin-dp e2be9e6
Disable file parallelism in vitest to avoid flaky tests due to some u…
kevin-dp 918389d
Handle failure to parse connection string
kevin-dp aafb9a5
Store references to per-tenant ETS tables in a global ETS table.
kevin-dp 4300bfd
WIP shutting down
kevin-dp ad1cb56
Reverse error messages
msfstef 23909e7
Shutdown tenant processes and clean up ETS table when tenant is deleted.
kevin-dp 4659b15
Introduce a with_supervised_tenant in component_setup.
kevin-dp 73649fb
Rebase on top of main
kevin-dp c92ea4d
Pass tenant_id option to stop_tenant
kevin-dp 0915711
Persist tenants
kevin-dp 53a1629
Unit test tenant persistence module
kevin-dp e57db87
Remove obsolete tenant deletion in component setup
kevin-dp 71a528f
Remove tenant from disk when the tenant is deleted.
kevin-dp 30ae9b4
Unit test that tenant manager loads tenants from storage
kevin-dp 92cb589
Formatting
kevin-dp fc77fc7
Generate unique tenant ID if DB URL is provided but no tenant ID is p…
kevin-dp c92e74b
Log message when tenant is reloaded from storage
kevin-dp 8537861
fixes
icehaunter 673d80d
Fixed compilation warnings
icehaunter 9733e96
fixed tests
icehaunter 77750ac
Fixed API spec
icehaunter 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