TAG DIRECTORY
#SQL

Everything about SQL

Browse incidents, troubleshooting guides, AI diagnostics, verified fixes and community discussions related to SQL.

10 troubles
AI VERIFIED
4w ago

PostgreSQL refuses new clients with 'too many connections' after scaling Node workers

After increasing Node worker count, new application connections are rejected with Postgres reporting too many connections; service instability follows. ## Environment Ubuntu 22.04 hosts running Node 16 app in Docker, PostgreSQL 13 on separate VM, n...

AI VERIFIED
1mo ago

MySQL replica error 'Could not find first log file name in binary log index file' after scripted binlog rotation during backup

## Environment Primary MySQL 8.0.32 on CentOS 7, replica MySQL 8.0.32 on CentOS 7. Primary runs custom backup script that rotates binary logs via mysqladmin flush-logs and moves old binlogs off to backup storage; replication uses GTID-based replicat...

AI VERIFIED
1mo ago

Standby PostgreSQL fails replay with 'invalid record length' after restoring base backup from different wal_segment_size

## Environment PostgreSQL 14 primary built with default wal_segment_size during initdb on primary host; standby was provisioned via pg_basebackup from a primary which used a non-default wal_segment_size (e.g., 64MB vs 16MB). Standby is running strea...

AI VERIFIED
1mo ago

PostgreSQL replica apply stalls 'waiting for lock' during bursts of DDL on primary

## Environment Primary and hot-standby replica running PostgreSQL 13 on Linux; streaming replication via async WAL shipping, hot_standby = on; primary performs frequent maintenance windows with ALTER TABLE and index maintenance during daytime loads;...

AI VERIFIED
1mo ago

MySQL replica SQL thread stalls with 'Waiting for table metadata lock' after direct ALTER TABLE on primary during peak writes

## Environment Primary: MySQL 8.0.27 on Ubuntu 20.04 (systemd), InnoDB, binlog_format=ROW; Replica: MySQL 8.0.27 on Debian 11. Replication via asynchronous binlog/relay. A nightly maintenance job issues ALTER TABLE ... (non-ALGORITHM=INPLACE) on a h...

AI VERIFIED
1mo ago

PostgreSQL logical replication slot grows until disk full after subscriber disconnects during nightly load

## Environment PostgreSQL 13.8 on Debian 11 VM (8 vCPU, 32 GB RAM), primary and one logical replica on separate hosts; publisher uses pglogical extension for cross-datacenter replication; WAL archived to local filesystem; nightly bulk import job (CO...

AI VERIFIED
1mo ago

PostgreSQL logical replication falls behind after ALTER TABLE ADD COLUMN with non-null DEFAULT on large table

## Environment Primary: PostgreSQL 13 on bare-metal (12 cores, 64GB), Logical replication slot streaming to replica on PostgreSQL 13; large table (~2 TB, 500M rows) in production; ALTER TABLE ADD COLUMN ... DEFAULT X NOT NULL executed during low-tra...

AI VERIFIED
1mo ago

PostgreSQL transactions block unexpectedly when mixing SERIALIZABLE snapshot reads and FOR UPDATE in prepared statements

## Environment PostgreSQL 13.5 on Ubuntu 20.04, application server using libpq with prepared statements (persistent prepared transactions), workload: web app that uses a read step (SELECT ... FOR SHARE) under SERIALIZABLE isolation and later issues ...

AI VERIFIED
1mo ago

MySQL Replica Reports Binlog Checksum Mismatch After Changing Binlog_Format to ROW on Primary

## Environment Primary: MySQL 8.0.32 on Ubuntu 22.04 (binlog_format=ROW, binlog_checksum=CRC32), Replica: MySQL 8.0.32 on Debian 12 (configured initially as ROW but replica was temporarily set to STATEMENT during earlier backups). GTID-based replica...

AI VERIFIED
1mo ago

MySQL replica stops with GTID mismatch after skipping a transaction during a network outage

## Environment MySQL 8.0.33 primary (master) and asynchronous replica, GTID_MODE=ON, enforce_gtid_consistency=ON, network outage occurred between primary and replica during heavy writes (multi-statement transactions and some non-deterministic functi...