-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Not works with Amazon Aurora #270
Comments
@mats16 did you make sure you have everything configured according to instructions found here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Replication.Logical.html#AuroraPostgreSQL.Replication.Logical.Configure |
Thanks! I already checked it... I had created supabase_admin as rds_superuser, but it does not work. |
@mats16 can you please share your Realtime server config, if possible? |
Thanks. ParameterGroup (for Amazon Aurora PostgreSQL 14): const parameterGroup = new rds.ParameterGroup(scope, 'ParameterGroup', {
engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.of('14.3', '14') }),
parameters: {
'rds.logical_replication': '1',
'max_replication_slots': '5', // Default Aurora:20, Supabase:5
'max_wal_senders': '10', // Default Aurora:20, Supabase:10
'max_logical_replication_workers': '2',
'autovacuum_max_workers': 'GREATEST({DBInstanceClassMemory/64371566592},2)', // Default: GREATEST({DBInstanceClassMemory/64371566592},3)
'max_parallel_workers': '4', // Default: GREATEST(${DBInstanceVCPU/2},8)
'max_slot_wal_keep_size': '1024', // https://github.com/supabase/realtime
},
}); Realtime server config as docker-compose.yml: version: '3'
services:
realtime:
image: supabase/realtime:v0.22.7
ports:
- 4000:4000
environment:
DB_HOST: "xxxxx.cluster-xxxxx.us-west-2.rds.amazonaws.com"
DB_NAME: postgres
DB_USER: supabase_admin # it is rds_superuser
DB_PASSWORD: "xxxx"
DB_PORT: 5432
DB_SSL: "false"
PORT: 4000
JWT_SECRET: "xxx"
REPLICATION_MODE: RLS
REPLICATION_POLL_INTERVAL: 100
SECURE_CHANNELS: "false"
SLOT_NAME: realtime_rls
TEMPORARY_SLOT: "true"
MAX_REPLICATION_LAG_MB: 1000
command: >
bash -c "./prod/rel/realtime/bin/realtime eval Realtime.Release.migrate
&& ./prod/rel/realtime/bin/realtime start" Test CDK project: https://github.com/mats16/supabase-on-aws |
@mats16 can you take a look at https://github.com/supabase/realtime/blob/master/dev/postgres/mnt/00-setup.sql and make sure you have everything like a |
@w3b6x9 My referrence is https://github.com/supabase/supabase/blob/master/docker/volumes/db/init/00-initial-schema.sql, so I have already created schema and publication. I noticed that logs published at intervals of the value of SUBSCRIPTION_SYNC_INTERVAL. Logs about
Which query is to confirm connected subscribers and the tables? |
@mats16 do you see a |
@w3b6x9 My latest migration version is 20220712093339. |
@mats16 This should be the culprit:
I do want to back up and mention that Otherwise, make sure that you set |
@w3b6x9 thanks. I also noticed the following error about web socket connection and no record existed in {
"event":"phx_reply",
"payload":{
"response":{
"reason":"error occurred when joining realtime:public:messages with user token"
},
"status":"error"
},
"ref":"1",
"topic":"realtime:public:messages"
} It is probably error related pgjwt or permissions. |
We cannot use pgjwt on RDS, so we need to install it via SQL. If functions such as (Also, sorry for creating the issue as a bug.) |
@mats16 ah, that's my bad. We've had a few versions of Realtime and the latest one no longer respects the Realtime doesn't use the
No worries, just want to make sure you're unblocked as soon as possible. |
@w3b6x9 Thanks I think I have found the root cause. I confirmed that Aurora had received a query But we can not have permission to Is it possible to change using |
@mats16 you're right, switching to |
@w3b6x9 I tried it and confirmed it works with replacing |
@mats16 thanks for the PR! |
Bug report
Describe the bug
The supabase-realtime server does not work with Amazon Aurora PostgreSQL.
To Reproduce
Create PostgreSQL Cluster (v14.3)
Launch supabase-realtime server and connect DB
The following log is displayed
Expected behavior
It works well, because it does not rely on extensions.
Screenshots
N/A
System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: