Skip to content

Raise max_locks_per_transaction to 256

What does this MR do and why?

Fix pipeline failures in JiHu side.

Failed pipelines:

https://jihulab.com/gitlab-cn/gitlab/-/jobs/8467037 https://jihulab.com/gitlab-cn/gitlab/-/jobs/8467047 https://jihulab.com/gitlab-cn/gitlab/-/jobs/8466961

Failure/Error: connection.public_send(...)
ActiveRecord::StatementInvalid:
  PG::OutOfMemory: ERROR:  out of shared memory
  HINT:  You might need to increase max_locks_per_transaction.
# ./lib/gitlab/database/load_balancing/connection_proxy.rb:127:in `public_send'
# ./lib/gitlab/database/load_balancing/connection_proxy.rb:127:in `block in write_using_load_balancer'
# ./lib/gitlab/database/load_balancing/load_balancer.rb:133:in `block in read_write'
# ./lib/gitlab/database/load_balancing/load_balancer.rb:204:in `retry_with_backoff'
# ./lib/gitlab/database/load_balancing/load_balancer.rb:122:in `read_write'
# ./lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `write_using_load_balancer'
# ./lib/gitlab/database/load_balancing/connection_proxy.rb:96:in `method_missing'

According to the error message, we need to increase max_locks_per_transaction.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports