Skip to content

'cannot use serializable mode in a hot standby' error on PostgreSQL #13

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

Closed
edgenard opened this issue May 6, 2022 · 4 comments
Closed
Labels
bug Something isn't working PostgreSQL
Milestone

Comments

@edgenard
Copy link

edgenard commented May 6, 2022

I'm running Postgresql 13.4

I'm sorry I dont have more information but I don't understand what this error means. The full stack trace is below

org.postgresql.util.PSQLException: ERROR: cannot use serializable mode in a hot standby
  Detail: "default_transaction_isolation" is set to "serializable".
  Hint: You can use "SET default_transaction_isolation = 'repeatable read'" to change the default.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
	at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:243)
	at org.postgresql.jdbc.PgDatabaseMetaData.getSchemas(PgDatabaseMetaData.java:1453)
	at org.postgresql.jdbc.PgDatabaseMetaData.getSchemas(PgDatabaseMetaData.java:1434)
	at com.ultorg.database.SQLConnection.e(SourceFile:618)
	at com.ultorg.database.SQLConnection.getDatabasesAndTables(SourceFile:539)
	at com.ultorg.project.model.m$1.run(SourceFile:1088)
	at com.ultorg.project.e.a(SourceFile:192)
	at com.ultorg.project.e.runTask(SourceFile:134)
	at com.ultorg.project.model.m.getTableList(SourceFile:83)
Caused: com.ultorg.database.ImportException
	at com.ultorg.project.model.m.getTableList(SourceFile:92)
[catch] at com.ultorg.project.c.b(SourceFile:470)
	at com.ultorg.project.c.c(SourceFile:449)
	at com.ultorg.project.i.a(SourceFile:503)
	at com.ultorg.project.i$a.b(SourceFile:1127)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
@eirikbakke
Copy link
Contributor

Thanks for this report!

It looks like Ultorg uses a PostgreSQL feature that is not always available (in your case because your database is configured with a "Hot Standby" server, for high availability).

I think I have already fixed it... but it will take me a bit of time before I have a new Ultorg release ready with the fix included. I will post a comment here once I have a new Ultorg version available!

@eirikbakke eirikbakke changed the title Error connecting database 'cannot use serializable mode in a hot standby' error on PostgreSQL May 6, 2022
@eirikbakke eirikbakke added the bug Something isn't working label May 6, 2022
@edgenard
Copy link
Author

edgenard commented May 6, 2022

Thanks for this report!

It looks like Ultorg uses a PostgreSQL feature that is not always available (in your case because your database is configured with a "Hot Standby" server, for high availability).

I think I have already fixed it... but it will take me a bit of time before I have a new Ultorg release ready with the fix included. I will post a comment here once I have a new Ultorg version available!

Thanks!

@eirikbakke eirikbakke added this to the Ultorg 1.0.8 milestone May 11, 2022
@eirikbakke
Copy link
Contributor

Hi @edgenard. If you have a chance, could you try to run the following SQL command on the same database, and tell me whether it returns true or false?

select pg_is_in_recovery();

(I'm trying to make Ultorg detect the exact condition which led to the error you reported.)

Thank you!

@eirikbakke
Copy link
Contributor

This issue is now fixed in Ultorg 1.0.8, which was just released. Existing beta users can find the new Ultorg version at the old download link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants