pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13287: Database corruption - PANIC: could not fsync file "pg_replslot/[Slot]/state": Bad file descriptor
2+ messages / 2 participants
[nested] [flat]

* BUG #13287: Database corruption - PANIC: could not fsync file "pg_replslot/[Slot]/state": Bad file descriptor
@ 2015-05-14 10:55  Hillel.Eilat@attunity.com
  0 siblings, 1 reply; 2+ messages in thread

From: Hillel.Eilat@attunity.com @ 2015-05-14 10:55 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13287
Logged by:          Hillel Eilat
Email address:      Hillel.Eilat@attunity.com
PostgreSQL version: 9.4.1
Operating system:   Windows 7
Description:        

Hello

I am in a process of developing an REPLICATION application using PostgreSQL
9.4.1 on a "Windows 7" platform.

"Logical Decoding" feature is used for extracting database changes in
real-time.
A dedicated replication slot - say [Replication Slot Name] - is used for
controlling this flow.
Everything works fine until PostgreSQL service is stopped.
While an active replication slot exists and PostgreSQL service is neatly
stopped, further attempt to restart it is responded by:

PostgreSQL - PANIC:  could not fsync file "pg_replslot/[Replication Slot
Name]/state": Bad file descriptor

Actually - the database in question is now corrupted / not operational
anymore.
Tonight this occurred also after a spontaneous machine shutdown.

This misbehavior now occurs very systematically upon stopping PostgreSQL
service while active replication slots are defined  there.

Your help will be appreciated.

Hillel.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #13287: Database corruption - PANIC: could not fsync file "pg_replslot/[Slot]/state": Bad file descriptor
@ 2015-05-14 17:27  Andres Freund <andres@anarazel.de>
  parent: Hillel.Eilat@attunity.com
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2015-05-14 17:27 UTC (permalink / raw)
  To: Hillel.Eilat@attunity.com; +Cc: pgsql-bugs

Hi,

On 2015-05-14 10:55:14 +0000, Hillel.Eilat@attunity.com wrote:
> I am in a process of developing an REPLICATION application using PostgreSQL
> 9.4.1 on a "Windows 7" platform.
> 
> "Logical Decoding" feature is used for extracting database changes in
> real-time.
> A dedicated replication slot - say [Replication Slot Name] - is used for
> controlling this flow.
> Everything works fine until PostgreSQL service is stopped.
> While an active replication slot exists and PostgreSQL service is neatly
> stopped, further attempt to restart it is responded by:
> 
> PostgreSQL - PANIC:  could not fsync file "pg_replslot/[Replication Slot
> Name]/state": Bad file descriptor

> Actually - the database in question is now corrupted / not operational
> anymore.
> Tonight this occurred also after a spontaneous machine shutdown.
> 
> This misbehavior now occurs very systematically upon stopping PostgreSQL
> service while active replication slots are defined  there.

This is a known and fixed problem that only occurs on windows
(unfortunately it's not allowed to fsync a readonly file handle on
windows). The next 9.4 release will be made public on the 21st.

Until then there's basically three ways to circumvent the problem:
1) Start the database with fsync turned off, and immediately after start
   turn it on, and reload the config. If you're concerned about the data
   loss window that could theoretically incur you can use initdb -S.
2) Remove the slot by simply removing the directory. Obviously that's
   problematic because the slot's gone in that case.
3) Apply the fix
   (http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=dfbaed459754e71e01bb0cc90a12802bba3f97...)
   and recompile postgres. Unfortunately that's not that easy on windows.

Hope that helps?

Andres


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-05-14 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 10:55 BUG #13287: Database corruption - PANIC: could not fsync file "pg_replslot/[Slot]/state": Bad file descriptor Hillel.Eilat@attunity.com
2015-05-14 17:27 ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox