idle_in_transaction_session_timeout failure during upgrade to 13.0.x

Summary

Upgrade from CE 12.10.8 to CE 13.0.10 fails with config error idle_in_transaction_session_timeout

Steps to reproduce

Upgrade from CE 12.10.8 to CE 13.0.10 OS System is Ubuntu Xenial with Postgres 9.5

What is the current bug behavior?

Recipe: gitlab::database_migrations
  * bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
              StandardError: An error has occurred, this and all later migrations canceled:
              
              PG::UndefinedObject: ERROR:  unrecognized configuration parameter "idle_in_transaction_session_timeout"
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:148:in `execute'

What is the expected correct behavior?

The Postgres variable idle_in_transaction_session_timeout has been introduced in Postgres 9.6. Postgres version 9.5 does not have such a setting which is part of Ubuntu 16 LTS (Xenial)

Possible fixes

Open the file with_lock_retries.rb and comment the two execute statements containing the idle_in_transaction_session_timeout statements.

Edited by Thomas Perschak