<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>51740</bug_id>
          
          <creation_ts>2024-10-17 15:17:13 +0300</creation_ts>
          <short_desc>psql: подключиться к серверу через сокет &quot;/tmp/.s.PGSQL.9999&quot; не удалось</short_desc>
          <delta_ts>2024-11-25 13:43:24 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>postgresql15-pgpool-II</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aleksandr Sysoev">sysoevas</reporter>
          <assigned_to name="Alexei Takaseev">taf</assigned_to>
          <cc>taf</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>253129</commentid>
    <comment_count>0</comment_count>
    <who name="Aleksandr Sysoev">sysoevas</who>
    <bug_when>2024-10-17 15:17:13 +0300</bug_when>
    <thetext>server-11.0.alpha20240611-x86-64 обновленный до Sisyphus

Версии:
postgresql15-pgpool-II-4.2.19-alt1.x86_64
postgresql15-15.8-alt3.x86_64
postgresql-common-1.0-alt9.noarch
postgresql15-server-15.8-alt3.x86_64

Шаги воспроизведения:
1. Настроить pgpool. Например, 2 ноды - primary и standy. Убедиться, что они корректно запущены и статус ОК:
# pcp_node_info -n 0 -U postgres -h localhost --verbose
Password: 
Hostname               : &lt;host0-ip&gt;
Port                   : 5432
Status                 : 2
Weight                 : 0.500000
Status Name            : up
Role                   : primary
Replication Delay      : 0
Replication State      : 
Replication Sync State : 
Last Status Change     : 2024-10-17 15:02:17

# pcp_node_info -n 1 -U postgres -h localhost --verbose
Password: 
Hostname               : &lt;host1-ip&gt;
Port                   : 5432
Status                 : 2
Weight                 : 0.500000
Status Name            : up
Role                   : standby
Replication Delay      : 27007272
Replication State      : 
Replication Sync State : 
Last Status Change     : 2024-10-17 15:02:17

2. Создать базу для репликации:
# psql -U postgres -p 9999 -c &quot;CREATE DATABASE test_db;&quot;

3. Попытаться добавить таблицу в созданную базу test_db:
# psql -U postgres -p 9999 -d test_db -c &quot;CREATE TABLE test_table (id int, name varchar);&quot;

Ожидаемый результат: таблица добавилась успешно

Реальный результат:
# psql -U postgres -p 9999 -d test_db -c &quot;CREATE TABLE test_table (id int, name varchar);&quot;
psql: ошибка: подключиться к серверу через сокет &quot;/tmp/.s.PGSQL.9999&quot; не удалось: ERROR:  unable to read message kind
ПОДРОБНОСТИ:  kind does not match between main(53) slot[1] (45)

В journalctl:
окт 17 15:13:21 server-11-0-alpha20240611-x86-64-minimal-20241017.localdomain pgpool[8245]: 2024-10-17 15:13:21: pid 8245: LOG:  pool_read_kind: error message from 1 th backend:база данных &quot;test_db&quot; не существует
окт 17 15:13:21 server-11-0-alpha20240611-x86-64-minimal-20241017.localdomain pgpool[8245]: 2024-10-17 15:13:21: pid 8245: ERROR:  unable to read message kind
окт 17 15:13:21 server-11-0-alpha20240611-x86-64-minimal-20241017.localdomain pgpool[8245]: 2024-10-17 15:13:21: pid 8245: DETAIL:  kind does not match between main(53) slot[1] (45)

При этом фактически БД существует:
# psql -p 9999 -U postgres -l | grep test_db
 test_db   | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | 

Доп: аналогичное поведение и с другими версиями postgress postgresql1*-pgpool-II</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254984</commentid>
    <comment_count>1</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2024-11-25 12:36:46 +0300</bug_when>
    <thetext>Можете привести описание процедуры развертывания pgpool по которой вы следовали?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>254993</commentid>
    <comment_count>2</comment_count>
    <who name="Alexei Takaseev">taf</who>
    <bug_when>2024-11-25 13:43:24 +0300</bug_when>
    <thetext>Проверил на конфигурации

postgresql15-15.8-alt1.x86_64
postgresql15-pgpool-II-4.5.4-alt1.x86_64
postgresql15-server-15.8-alt1.x86_64

стенд из отдельной виртуалки с pgpool и двумя нодами с postgres с репликацией между ними. После поднятия репликации и настройки pgpool такая картина.

нода с pgpool:

psql -U postgres -h localhost -p 9999 postgres
Пароль пользователя postgres: 
psql (15.8)
Введите &quot;help&quot;, чтобы получить справку.

postgres=# create database test;
CREATE DATABASE
postgres=# \c test
Вы подключены к базе данных &quot;test&quot; как пользователь &quot;postgres&quot;.
test=# create table t (f1 int);
CREATE TABLE
test=# \dt
         Список отношений
 Схема  | Имя |   Тип   | Владелец 
--------+-----+---------+----------
 public | t   | таблица | postgres
(1 строка)

test=# insert into t values (1);
INSERT 0 1
test=# insert into t values (2);
INSERT 0 1
test=# insert into t values (3);
INSERT 0 1
test=# select * from t;
 f1 
----
  1
  2
  3
(3 строки)

test=#


нода мастер pg-node1:

# psql -U postgres -l 
Пароль пользователя postgres: 
                                                  Список баз данных
    Имя    | Владелец | Кодировка | LC_COLLATE  |  LC_CTYPE   | локаль ICU | Провайдер локали |     Права дос
тупа     
-----------+----------+-----------+-------------+-------------+------------+------------------+--------------
---------
 postgres  | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | 
 template0 | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | =c/postgres  
        +
           |          |           |             |             |            |                  | postgres=CTc/
postgres
 template1 | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | =c/postgres  
        +
           |          |           |             |             |            |                  | postgres=CTc/
postgres
 test      | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | 
(4 строки)

[root@pg-node1 base]# psql -U postgres test
Пароль пользователя postgres: 
psql (15.8)
Введите &quot;help&quot;, чтобы получить справку.

test=# \dt
         Список отношений
 Схема  | Имя |   Тип   | Владелец 
--------+-----+---------+----------
 public | t   | таблица | postgres
(1 строка)

test=# select * from t;
 f1 
----
  1
  2
  3
(3 строки)

test=#


нода реплика pg-node2:

# psql -U postgres -l
Пароль пользователя postgres: 
                                                  Список баз данных
    Имя    | Владелец | Кодировка | LC_COLLATE  |  LC_CTYPE   | локаль ICU | Провайдер локали |     Права дос
тупа     
-----------+----------+-----------+-------------+-------------+------------+------------------+--------------
---------
 postgres  | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | 
 template0 | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | =c/postgres  
        +
           |          |           |             |             |            |                  | postgres=CTc/
postgres
 template1 | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | =c/postgres  
        +
           |          |           |             |             |            |                  | postgres=CTc/
postgres
 test      | postgres | UTF8      | ru_RU.UTF-8 | ru_RU.UTF-8 |            | libc             | 
(4 строки)

[root@pg-node2 base]# psql -U postgres test
Пароль пользователя postgres: 
psql (15.8)
Введите &quot;help&quot;, чтобы получить справку.

test=# \dt
         Список отношений
 Схема  | Имя |   Тип   | Владелец 
--------+-----+---------+----------
 public | t   | таблица | postgres
(1 строка)

test=# select * from t;
 f1 
----
  1
  2
  3
(3 строки)

test=#

Похоже, что по какой-то причине у вас не работает репликация между мастером и репликой, что непосредственно к pgpool отношения не имеет.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>