Skip to content
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

Hasura 2.42.0 regresssion connectivity to PostgreSQL read only db #10587

Open
SzymonZy opened this issue Nov 5, 2024 · 0 comments
Open

Hasura 2.42.0 regresssion connectivity to PostgreSQL read only db #10587

SzymonZy opened this issue Nov 5, 2024 · 0 comments
Labels
k/bug Something isn't working

Comments

@SzymonZy
Copy link

SzymonZy commented Nov 5, 2024

Version Information

Server Version: 2.42.0
CLI Version (for CLI related issue):

Environment

OSS

What is the current behaviour?

I'm attaching hot standby postgresdb and hasura fails with:
{"detail":{"http_info":{"content_encoding":null,"http_version":"HTTP/1.0","ip":"172.28.63.18","method":"POST","status":500,"url":"/v2/query"},"operation":{"error":{"code":"postgres-error","error":"postgres tx error","internal":{"arguments":[],"error":{"description":null,"exec_status":"FatalError","hint":null,"message":"cannot set transaction read-write mode during recovery","status_code":"0A000"},"prepared":true,"statement":"BEGIN ISOLATION LEVEL READ COMMITTED READ WRITE"},"path":"$"},"query":{"args":{"source":"Replicated","sql":"SELECT VERSION()"},"type":"run_sql"},"query_execution_time":6.270142e-3,"request_id":"6a78c842-bd77-4c22-b33a-1da06841ebcb","request_mode":"error","request_read_time":1.41e-6,"response_size":327,"uncompressed_response_size":327,"user_vars":{"x-hasura-role":"admin"}},"request_id":"6a78c842-bd77-4c22-b33a-1da06841ebcb"},"level":"error","span_id":"d87a0e9b79825cc4","timestamp":"2024-11-05T10:45:43.256+0000","trace_id":"3f335bf56449eb9f5cc0fe745c98ba19","type":"http-log"}

When switching to master node all works fully correct. If I run select version(); by hand on replicated DB using the same user as hasura does I got result. Looks like hasura is trying to do some kind of lock on the db while on readonly node it is not possible.

I'm using separate PostgreSQL DB as metadata database. So it looks like a regression.

What is the expected behaviour?

Database should be connected and all objects should be visible.

How to reproduce the issue?

  1. Build a physically replicated PostgreSQL server
  2. Enable Feature Flags:
  • New Relationship tab UI for tables/views
  • Enable new Table Tracking UI for Postgres & SQL Server
  • Data Tab Performance Mode
  1. Try to connect to replicated node

Screenshots or Screencast

image

Please provide any traces or logs that could help here.

Any possible solutions/workarounds you're aware of?

It looks like if the metadata will be build upon head node you can still query the slave node for data.

Keywords

cannot set transaction read-write mode during recovery

@SzymonZy SzymonZy added the k/bug Something isn't working label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant