fix: increase TimescaleDB tuple decompression limit to unlimited

Fixes ERROR 53400 (configuration_limit_exceeded) during large interface
sync operations in device discovery.

The sync_interfaces operation was decompressing 146,603 tuples but the
default limit was 100,000. Setting to 0 (unlimited) removes this constraint.

Error occurred in: Towerops.Snmp.Discovery.sync_interfaces/2
This commit is contained in:
Graham McIntire 2026-03-04 17:42:41 -06:00
parent 1b11bb25fc
commit a7ab2831b3
No known key found for this signature in database

View file

@ -0,0 +1,20 @@
defmodule Towerops.Repo.Migrations.IncreaseTimescaledbDecompressionLimit do
use Ecto.Migration
def up do
# Increase TimescaleDB tuple decompression limit to unlimited (0)
# This is needed for large interface sync operations during device discovery
# that can touch 100k+ compressed tuples in a single transaction
execute "ALTER DATABASE #{db_name()} SET timescaledb.max_tuples_decompressed_per_dml_transaction = 0"
end
def down do
# Restore default limit of 100,000
execute "ALTER DATABASE #{db_name()} SET timescaledb.max_tuples_decompressed_per_dml_transaction = 100000"
end
defp db_name do
config = Application.get_env(:towerops, Towerops.Repo)
config[:database] || "towerops_dev"
end
end