Too many files in pg_replslot folder - Mailing list pgsql-bugs

From Dmitriy Sarafannikov
Subject Too many files in pg_replslot folder
Date
Msg-id 1457621358.355011041@f382.i.mail.ru
Whole thread Raw
Responses Re: Too many files in pg_replslot folder
List pgsql-bugs
Hi, all.

I tried to test logical replication with 'test_decoding' plugin.
I created logical slot and launched pg_recvlogical utility on ~8 hours.
When i tried to drop replication slot via pg_drop_replication_slot, backend ate my disk on 100% and didn't want to release him.
I saw via strace, that he deletes files:


lstat("pg_replslot/test_slot.tmp/xid-2917185562-lsn-4981-AE000000.snap", {st_mode=S_IFREG|0600, st_size=169, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2917185562-lsn-4981-AE000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2915407454-lsn-497F-14000000.snap", {st_mode=S_IFREG|0600, st_size=161, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2915407454-lsn-497F-14000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2915727847-lsn-497F-8C000000.snap", {st_mode=S_IFREG|0600, st_size=169, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2915727847-lsn-497F-8C000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2919565207-lsn-4984-94000000.snap", {st_mode=S_IFREG|0600, st_size=177, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2919565207-lsn-4984-94000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2915738746-lsn-497F-8D000000.snap", {st_mode=S_IFREG|0600, st_size=177, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2915738746-lsn-497F-8D000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2917437588-lsn-4981-F2000000.snap", {st_mode=S_IFREG|0600, st_size=161, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2917437588-lsn-4981-F2000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2917359031-lsn-4981-E5000000.snap", {st_mode=S_IFREG|0600, st_size=161, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2917359031-lsn-4981-E5000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2917766393-lsn-4982-84000000.snap", {st_mode=S_IFREG|0600, st_size=177, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2917766393-lsn-4982-84000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2915337440-lsn-497F-8000000.snap", {st_mode=S_IFREG|0600, st_size=169, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2915337440-lsn-497F-8000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2916494069-lsn-4980-C3000000.snap", {st_mode=S_IFREG|0600, st_size=177, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2916494069-lsn-4980-C3000000.snap") = 0
lstat("pg_replslot/test_slot.tmp/xid-2916877166-lsn-4981-4F000000.snap", {st_mode=S_IFREG|0600, st_size=169, ...}) = 0
unlink("pg_replslot/test_slot.tmp/xid-2916877166-lsn-4981-4F000000.snap") = 0
He seemed to be in infinite loop. 1109428 files were in the slot folder.
It looks like abnormal behavior. Why are so many files?
Maybe i'm doing something wrong? Or maybe it is bug?
How i can avoid this?

And wal sender ate ~800 mb of memory during this test. Is it leakage?


version
-----------------------------------------------------------------------------------------------
PostgreSQL 9.4.6 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit

Thanks for advance and sorry for my English.

Regards,
Dmitriy Sarafannikov

pgsql-bugs by date:

Previous
From: Lucas Souza Cruz
Date:
Subject: Performance Improvement in SQL
Next
From: Alvaro Herrera
Date:
Subject: Re: Too many files in pg_replslot folder