Monday, January 6, 2020

SQL Relay 1.7.0 Release Announcement

Version 1.7.0 of SQL Relay, the powerful connection pool, load balancer, query router, and database proxy, is now available.

This release adds 2 significant features: support for the PostgreSQL client-server protocol, and a "replay" module to help automatically recover from deadlocks and lock-timeouts, but also has the usual assortment of minor bugfixes and internal changes.



PostgreSQL Client-Server Protocol

SQL Relay has supported the MySQL client-server protocol for several minor releases, enabling MySQL applications to take advantage of SQL Relay's features by aiming SQL Relay at the database(s) and aiming the application at SQL Relay. It has been a server-only solution requiring no modification of the client application or even any installation of software on the client system.

Release 1.7.0 features similar support for the PostgreSQL client-server protocol. PostgreSQL applications can now take advantage of SQL Relay's features by aiming SQL Relay at the database(s) and aiming the application at SQL Relay. It is also a server-only solution requiring no modification of the client application or even any installation of software on the client system.

See the SQL Relay Configuration Guide for configuration details.


Replay Module

"How do I handle database deadlocks!?"

The answer is usually: figure out which queries are deadlocking and rewrite them to be less likely to deadlock. When that fails, the prescribed solution is to rewrite your application to detect the deadlock and either rerun the previous query (eg. with Oracle) or rerun all queries in the current transaction (eg. with MySQL).

While rewriting queries to be less likely to deadlock might be possible in some cases, rewriting applications to record queries and be able to replay entire transactions is unrealistic. It is especially unrealistic if you consider the trouble involved with doing an insert into a table with an auto-increment column, followed by updates that use the generated id.

But, while it might be unrealistic for applications, it's not terribly unrealistic for a database proxy like SQL Relay.

This release of SQL Relay provides a "replay" module, which can be configured to record and replay either the previous query, or previous transactions-worth of queries upon detecting a deadlock, lock timeout, or other condition. It even correctly rewrites the inserts that it records to handle auto-increment columns.

See the SQL Relay Configuration Guide for configuration details.



Full ChangeLog follows:

  • added postgresql protocol module
  • updated postgresql connection module to get column info pre-execute
  • fixed postgresql connection module type oid bug
  • added tag filter/moduledata
  • added moduledata(s)::closeResultSet()/endTransaction()/endSession()
  • mysql protocol returns empty lobs correctly now (not as nulls)
  • configure replaces -lfbclient with -lgds on freebsd/firebird-2.0.3
  • fixed a bug that could cause sqlr-stop to try to kill pid 0
  • fixed unixodbc detection on solaris 11.4
  • added configure test for PQdescribePrepared
  • test improvements
  • documentation improvements
  • split sqlrelay-crash directive into its own module
  • deprecated drop-in replacement libraries in favor of protocol support
  • fixed various mysql 4.x bugs
  • sqlr-status creates statistics on heap now instead of stack, to work on platforms with a small default ulimit stack
  • mysql stored procedure test is bypassed for older mysql
  • tls test is bypassed for older openssl
  • added NULL handoff socket workaround
  • improved shutdown/crash handlers for sqlr-listener/connection
  • fixed hang when more-than-one address was specified in the instance:addresses attribute
  • *_null used instead of *_unset on PHP 7.4

Rudiments 1.2.2 Release Announcement

Version 1.2.2 of Rudiments, the C++ class library for developing systems and applications, is now available.

This is a minor bug-fix release. ChangeLog follows:

  • fixed another long-standing charstring::httpEscape bug
  • -Wno-deprecated-declarations is now included if possible
  • added configure tests for RB_HALT/AUTOBOOT (enums on solaris 11.4)
  • certificate tests use sha1 if sha256 is unavailable
  • filedescriptor::pvt->_lstnr is initialzed to NULL in clone operation now
  • listener::listen() safely handles non pollin/out events now
  • removed waitForChildren() from shutdown/crash handlers
  • sigsuspend() fails if errno!=EINTR now instead of whether it returns -1
  • filtered out -Wl,-Bsymbolic-functions -Wl,-z,relro from krb5-config