Hello
max_wal_size is not the upper limit for pg_wal. Postgresql does not have upper limit for pg_wal at all. This is
documented:
https://www.postgresql.org/docs/10/runtime-config-wal.html
> Maximum size to let the WAL grow to between automatic WAL checkpoints. This is a soft limit; WAL size can exceed
max_wal_sizeunder special circumstances, like under heavy load, a failing archive_command, or a high wal_keep_segments
setting.
so check yours replication slots, archive_command (if archive_mode is enabled), wal_keep_segments
regards, Sergei