Как стать автором
Обновить

Всегда используйте target_session_attrs=read-write (или primary) при подключении к кластеру PostgreSQL по FQDN в YC

Уровень сложностиСредний
Время на прочтение60 мин
Количество просмотров1.6K
Всего голосов 10: ↑10 и ↓0+10
Комментарии18

Комментарии 18

target_session_attrs имеет смысл указывать, если у вас более одного хоста. В статье используется алиас, который всегда указывает на PRIMARY:

https://yandex.cloud/ru/docs/managed-postgresql/operations/connect#fqdn-master

FQDN вида c-<идентификатор_кластера>.rw.mdb.yandexcloud.net всегда указывает на текущий хост-мастер в кластере. Идентификатор кластера можно запросить со списком кластеров в каталоге.

При подключении к этому FQDN разрешено выполнять операции чтения и записи.

Примечание

Используйте подключение с помощью особого FQDN хоста-мастера только для процессов, которые допускают недоступность базы данных на запись продолжительностью до 10 минут.

Все верно. В названии статьи указано при подключению к кластеру PostgreSQL.

Используйте подключение с помощью особого FQDN хоста-мастера только для процессов, которые допускают недоступность базы данных на запись продолжительностью до 10 минут.

При использовании target_session_attrs=read-write ошибки ушли через секунд 20-30 в зависимости от количества данных в PostgreSQL.

Выглядит, как будто pg_bouncer переключится на новый мастер побыстрее.

Если бы переключится на новый мастер побыстрее, то он бы переключался побыстрее и с параметром target_session_attrs=any. Однако это не происходит. Воспроизводил несколько раз.

Нет. С target_session_attrs=any никто не мешает использовать из пула уже имеющиеся подключение по старому адресу.

Но до переключения FQDN клиент PRIMARY не увидит. При этом никто не гарантирует, что изменение DNS записи быстро доедет до приложения.

Скрытый текст
Connected!!
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Master]: rows affected: 1
2025/05/19 11:41:57 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:41:58 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:41:59 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:01 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:02 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:03 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:04 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:05 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:07 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:08 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:09 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:10 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:12 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:13 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
2025/05/19 11:42:14 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
	158.160.35.209:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.35.209:6432: connect: connection refused
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 1, acquired: 0, idle: 1 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
DB Error [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.35.209, Type: Replica] cannot execute INSERT in a read-only transaction (Code: 25006): ERROR: cannot execute INSERT in a read-only transaction (SQLSTATE 25006)
^Cmake: *** [Makefile:6: run] Прерывание

Вот логи с параметром target_session_attrs=any. Добавил эти полные логи в статью. Как видим ошибки меняются на успешные запросы, затем на ошибки, затем на успешные запросы: DB Error -> Successful -> DB Error -> Successful -> DB Error -> Successful. И так довольно долго.

Скрытый текст
Connected!!
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 158.160.185.107, Type: Master]: rows affected: 1
DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:04 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:06 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:07 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:08 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:10 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:11 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:12 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:13 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:14 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:16 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:17 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:18 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:19 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:20 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): dial error: dial tcp 158.160.185.107:6432: connect: connection refused
2025/05/19 11:48:22 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cb2611129158f: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:24 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c12600b023fd4: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:26 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c98b7d276695c: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:27 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c51f7fd47a785: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:29 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cf31377107d13: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:31 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: cb461ed639d77: SSL is required (SQLSTATE 08P01)
2025/05/19 11:48:32 DB Error [Pool total: 0, acquired: 0, idle: 0 | Failed to acquire connection]: failed to connect to `user=test database=testdb`:
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): ValidateConnect failed: read only connection
	158.160.185.107:6432 (c-c9qjkttr1shga0l8066k.rw.mdb.yandexcloud.net): server error: ERROR: odyssey: c53aa7b735f36: SSL is required (SQLSTATE 08P01)
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 1, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 1 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
Successful [Pool total: 2, acquired: 0, idle: 2 | IP: 84.201.152.251, Type: Master]: rows affected: 1
^Cmake: *** [Makefile:6: run] Прерывание

Вот логи с параметром target_session_attrs=read-write. Добавил эти полные логи в статью. Ошибок через 20-30 секунд нет

Я не утверждаю, что опция target_session_attrs=read-write не даёт никакого эффекта: эффект есть, но природа у него другая.

В данном случае у поставщика (Яндекс облака), есть три варианта подключения к PostgreSQL-кластеру:

  • указать все хосты в строке подключения и target_session_attrs - рекомендуемый способ;

  • использовать FQDN для PRIMARY - зависит от времени обновления DNS, не рекомендуется из-за отсутсвия гарантий на время из-за DNS-кэшей;

  • использовать FQDN для наименее отстаюущей реплики - так же зависит от времени обновления DNS.

Комбинация FQDN для PRIMARY и target_session_attrs=read-write работать будет, но есть нюансы:

  • время переключения увеличивается за счет DNS-кэшей (они зависят от TTL DNS записи, настроек операционной системы приложения, реализации самого приложения);

  • клиент в случае failover на некоторое время вообще не видит никакого хоста кластера (адрес резолвится в мёртый хост);

  • поведение может сильно отличаться в зависимости от используемого в разработке стэка;

  • вы игнорируете явное предупреждение поставщика и делаете на свой страх и риск (используйте подключение с помощью особого FQDN хоста-мастера только для процессов, которые допускают недоступность базы данных на запись продолжительностью до 10 минут);

  • вы используете FQDN для PRIMARY не по назначению на свой страх и риск.

С моей колокольни - 20-30 секунд в данном эксперименте это довольно много (речь же идёт не про failover, а про switchover - прибить лопатой хост в облаке довольно трудно и, скорее всего, вы просто переключаете PRIMARY в кластере).

То что вы видете ожидаемый результат в рамках своего эксперимента не значит, что эксперимент проведён корректно.

В целом, практически везде, гдя я работал - недоступность базы на столь длительный период это повод рестартовать приложение. Может, там перевыборы мастера - а может, DNS-сервер с ума сошёл или ещё какая штука, которая сама не вылечится.

У вас наслаивается два эффекта:

  • необходимость создать новое подключение, так как старое не удовлетворяет запрошенному target_session_attrs=read-write;

  • изменение адреса, в который резолвится FQDN имя.

И это создаёт иллюзию, что оно работает правильно. Но время переключения сильно зависит от кэша DNS, на который в таких вещах лучше не полагаться.

По хорошему, в строке подключения вместо этого FQDN должны быть указаны адреса всех хостов PostgreSQL-кластера.

Я проверял 5-7 раз. После смены мастера (через секунд 20-30) ошибок при параметре target_session_attrs=read-write нет. Можете взять исходный код и проверить.

>По хорошему, в строке подключения вместо этого FQDN должны быть указаны адреса всех хостов PostgreSQL-кластера.

К сожалению такой вариант для YC не приемлем, тк в случае пересоздания какого-то хоста у кластера его ID (то есть адрес хоста) будет изменен, что потребует изменения настроек в строке подключения.

Конечно можно встроить в приложение обращение в API YC и на основе ID-кластера получать список всех хостов, но тут возникает очередная точка отказа - само YC API может тупить или вообще сломаться и тогда приложение просто не получит список хостов в кластере (конечно в таком варианте можно переключиться на особые FQDN). Вобщем нужно предусмотреть кучу вариантов чтобы подключиться к БД и главное все это еще нужно протестировать в условиях когда один из дата-центров YC может умереть (а мы знаем что такое случилось в конце апреля 2025).

К сожалению такой вариант для YC не приемлем, тк в случае пересоздания какого-то хоста у кластера его ID (то есть адрес хоста) будет изменен, что потребует изменения настроек в строке подключения.

Я указываю все хосты. Приходится менять строку подключения. Страдаю.

К счастью хосты сами свои имена не меняют.

>target_session_attrs имеет смысл указывать, если у вас более одного хоста. В статье используется алиас, который всегда указывает на PRIMARY:

Отчасти да, он придуман для решения HA на уровне libpq (и совместимых с ней других реализаций) когда указывается множество хостов и выбор куда подключаться идет из этого набора, но в зависимости от реализации, а в частности если говорить про pgx, то будут свои положительные плюсы и для однохостового варианта.

Для YC был бы интересен вариант использования 2-х хостов в строке соединения (c-XXXX.rw.mdb.yandexcloud.net и c-XXXX.ro.mdb.yandexcloud.net) и использования target_session_attrs=primary или target_session_attrs=prefer-standby для гарантированого попадания на праймари либо на реплики (или праймари в случае отсутствия реплики), но в статье ограничились только 1-м хостом.

А кто как решает проблему подключения к кластеру pg из Python (Django)?

Ультимативно универсальный способ - реверс прокси с хелсчеками воткнуть. Берёте haproxy, вешаете его слушать tcp сокет на лупбэке хоста, где крутится приложение. Соединения приходящие на этот сокет отправляете в backend секцию с развесистой логикой хэлсчеков на основе tcp-check send/expect и пачкой ваших инстансов pg кластера. При должной ловкости рук реально заставить haproxy отправлять коннекты только на primary инстанс; рвать соединения в пуле внутри приложения если инстанс постгреса, на который они смотрят, перестал быть primary; очень быстро детектить переезд primary инстанса; некоторое время придерживать в очереди соединения приложения если прямо сейчас нет живой primary ноды (вместо того, чтобы в приложение валили ошибки о невозможности подключиться к живому мастеру в момент переезда primary). И вообще ещё много чего странного и безумного. Но придётся разобраться в протоколе постгреса и руками hex строки собирать для tcp-check логики.

Зарегистрируйтесь на Хабре, чтобы оставить комментарий

Публикации