odyssey icon indicating copy to clipboard operation
odyssey copied to clipboard

Getting error in transaction mode while using prepared statement

Open jayant07-yb opened this issue 3 years ago • 4 comments

I am trying to test prepared statements in transaction mode

The autocommit is set false and I am getting following error, this error doesnot come in case of setAutoCommit as true.

org.postgresql.util.PSQLException: Expected command status BEGIN, got INSERT 0 1.
        at org.postgresql.core.v3.QueryExecutorImpl$1.handleCommandStatus(QueryExecutorImpl.java:620)
        at org.postgresql.core.v3.QueryExecutorImpl.interpretCommandStatus(QueryExecutorImpl.java:2720)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2313)
        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.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:167)
        at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:135)
        at com.yugabyte.WriteTest.TestExtendedQuery(PerfTest.java:387)
        at com.yugabyte.WriteTest.run(PerfTest.java:429)
        at java.base/java.lang.Thread.run(Thread.java:833)

My Odyssey config

daemonize no

unix_socket_dir "/tmp"
unix_socket_mode "0644"

log_format "%p %t %l [%i %s] (%c) %m\n"
log_to_stdout yes
log_syslog no
log_syslog_ident "odyssey"
log_syslog_facility "daemon"
log_debug no
log_config yes
log_session no
log_query no
log_stats no

stats_interval 60

workers 4

readahead 8192

cache_coroutine 0

coroutine_stack_size 8

nodelay yes

keepalive 7200


listen {
	host "*"
	port 6432
	backlog 128
}


storage "yugabyte_server" {
	type "remote"
	host "10.150.2.81,10.150.1.32,10.150.2.83"
	port 5433
}

database default {
	user default {

		authentication "none"

		storage "yugabyte_server"

		pool "transaction"
		pool_ttl 10000
		server_lifetime 10000
		pool_size 10

		log_debug yes
		pool_discard no
		pool_smart_discard yes
		pool_reserve_prepared_statement yes

		quantiles "0.99,0.95,0.5"
		client_max 1007

	}
}



storage "local" {
	type "local"
}

database "console" {
	user default {
		authentication "none"
		pool "session"
		storage "local"
	}
}

@x4m

jayant07-yb avatar Aug 23 '22 12:08 jayant07-yb

Can you please give some updates on this issue @reshke?

jayant07-yb avatar Sep 27 '22 06:09 jayant07-yb

I am also encountering this error.

I can see this issue is labelled as a bug. Any idea if we can expect the fix soon?

@jayant07-yb Have you been able to to find a workaround for this? We are also using yugabyte as the storage.

naiquevin avatar Nov 16 '22 09:11 naiquevin

Yeah, I have made a few changes that helped me fix this. The changes are mentioned in the PR: https://github.com/yandex/odyssey/pull/476

jayant07-yb avatar Nov 16 '22 11:11 jayant07-yb

Thanks @jayant07-yb !

naiquevin avatar Nov 16 '22 13:11 naiquevin