# Checking port 58998
# Found port 58998
Name: primary
Data directory: /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata
Backup directory: /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/backup
Archive directory: /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/archives
Connection string: port=58998 host=/tmp/OWQrtRi1aW
Log file: /home/gregn/postgres/src/test/recovery/tmp_check/log/006_logical_decoding_primary.log
# Running: initdb -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -A trust -N
The files belonging to this database system will be owned by user "gregn".
This user must also own the server process.

The database cluster will be initialized with locales
  COLLATE:  en_US.UTF-8
  CTYPE:    en_US.UTF-8
  MESSAGES: C
  MONETARY: en_US.UTF-8
  NUMERIC:  en_US.UTF-8
  TIME:     en_US.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Australia/Sydney
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok

Sync to disk skipped.
The data directory might become corrupt if the operating system crashes.

Success. You can now start the database server using:

    pg_ctl -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -l logfile start

# Running: /home/gregn/postgres/src/test/recovery/../../../src/test/regress/pg_regress --config-auth /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata
### Starting node "primary"
# Running: pg_ctl -w -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -l /home/gregn/postgres/src/test/recovery/tmp_check/log/006_logical_decoding_primary.log -o --cluster-name=primary start
waiting for server to start.... done
server started
# Postmaster PID for node "primary" is 67636
ok 1 - Logical decoding correctly fails to start
ok 2 - Logical decoding fails on non-database connection
ok 3 - Decoding produced 12 rows inc BEGIN/COMMIT
### Restarting node "primary"
# Running: pg_ctl -w -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -l /home/gregn/postgres/src/test/recovery/tmp_check/log/006_logical_decoding_primary.log restart
waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
# Postmaster PID for node "primary" is 67657
ok 4 - Decoding after fast restart repeats no rows
ok 5 - got expected output from SQL decoding session
waiting to replay 0/1520928
DEBUG: stderr: pg_recvlogical: starting log streaming at 0/0 (slot test_slot)
pg_recvlogical: streaming initiated
pg_recvlogical: confirming write up to 0/0, flush to 0/0 (slot test_slot)
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 30
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/0
pg_recvlogical: DEBUG: WAL record walEnd = 0/0
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604024
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 85
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/1520650
pg_recvlogical: DEBUG: WAL record walEnd = 0/1520650
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604136
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 85
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/1520838
pg_recvlogical: DEBUG: WAL record walEnd = 0/1520838
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604152
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 85
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/1520878
pg_recvlogical: DEBUG: WAL record walEnd = 0/1520878
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604162
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 85
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/15208B8
pg_recvlogical: DEBUG: WAL record walEnd = 0/15208B8
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604171
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 31
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/1520928
pg_recvlogical: DEBUG: WAL record walEnd = 0/1520928
pg_recvlogical: DEBUG: WAL record sendTime = 684562298604176
pg_recvlogical: DEBUG: WAL record, walEnd >= endpos
pg_recvlogical: DEBUG: cur_record_lsn == endpos
pg_recvlogical: confirming write up to 0/1520928, flush to 0/1520928 (slot test_slot)
pg_recvlogical: end position 0/1520928 reached by WAL record at 0/1520928

ok 6 - got same expected output from pg_recvlogical decoding session
DEBUG: stderr: pg_recvlogical: starting log streaming at 0/0 (slot test_slot)
pg_recvlogical: streaming initiated
pg_recvlogical: confirming write up to 0/0, flush to 0/0 (slot test_slot)
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 30
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/0
pg_recvlogical: DEBUG: WAL record walEnd = 0/0
pg_recvlogical: DEBUG: WAL record sendTime = 684562298635429
pg_recvlogical: DEBUG: endpos = 0/1520928
pg_recvlogical: DEBUG: copy stream read size = 85
pg_recvlogical: DEBUG: WAL record cur_record_lsn = 0/1520928
pg_recvlogical: DEBUG: WAL record walEnd = 0/1520928
pg_recvlogical: DEBUG: WAL record sendTime = 684562298635567
pg_recvlogical: DEBUG: WAL record, walEnd >= endpos
pg_recvlogical: DEBUG: cur_record_lsn == endpos
pg_recvlogical: confirming write up to 0/1520928, flush to 0/1520928 (slot test_slot)
pg_recvlogical: end position 0/1520928 reached by WAL record at 0/1520928

not ok 7 - pg_recvlogical acknowledged changes

#   Failed test 'pg_recvlogical acknowledged changes'
#   at t/006_logical_decoding.pl line 117.
#          got: 'BEGIN
# table public.decoding_test: INSERT: x[integer]:5 y[text]:'5''
#     expected: ''
psql:<stdin>:1: ERROR:  replication slot "test_slot" was not created in this database
ok 8 - replaying logical slot from another database fails
pg_recvlogical: DEBUG: endpos = 0/0
pg_recvlogical: DEBUG: copy stream read size = 18
pg_recvlogical: DEBUG: keepalive walEnd = 0/15222B8
pg_recvlogical: DEBUG: keepalive sendTime = 684562298736443
psql:<stdin>:1: ERROR:  database "otherdb" is used by an active logical replication slot
DETAIL:  There is 1 active slot.
ok 9 - dropping a DB with active logical slots fails
ok 10 - logical slot still exists
ok 11 - dropping a DB with inactive logical slots succeeds
ok 12 - logical slot was actually dropped with DB
(logical_slot,0/1536D58)
ok 13 - slot advancing with logical slot
### Restarting node "primary"
# Running: pg_ctl -w -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -l /home/gregn/postgres/src/test/recovery/tmp_check/log/006_logical_decoding_primary.log restart
waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
# Postmaster PID for node "primary" is 67712
ok 14 - logical slot advance persists across restarts
### Stopping node "primary" using mode fast
# Running: pg_ctl -D /home/gregn/postgres/src/test/recovery/tmp_check/t_006_logical_decoding_primary_data/pgdata -m fast stop
waiting for server to shut down.... done
server stopped
# No postmaster PID for node "primary"
# Looks like you failed 1 test of 14.
