[BUGS] Assertion of synchronous replication - Mailing list pgsql-bugs

From const_sunny@126.com
Subject [BUGS] Assertion of synchronous replication
Date
Msg-id 201706291230091282897@126.com
Whole thread Raw
List pgsql-bugs
Hi all!

    I have found a bug about synchronous replication.
    At first, see the stack of the core file.
    I think it is impossible when i print something about the assertion.
    So, what causes this assertion? To solve my doubts, i add some debug log. See the macro DEBUG_SUNNY as below.

    Then i made pressure test by benchmark, and got some log as below.
    You can find the "DELETE" log is later than the "IMPOSSIBLE" log. What conditions does this happen under?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    At last, i have made this bug reappear by GDB follow these steps.
1. In wal sender process, add a breakpoint at code line "SHMQueueDelete(&(thisproc->syncRepLinks)); " of "SyncRepWakeQueue".
2. In backend process, add a breakpoint at code line "if (MyProc->syncRepState == SYNC_REP_WAIT_COMPLETE)" of "SyncRepWaitForLSN".
3. Execute a SQL whatever will generate tansaction log by psql.
4. Hold the breakpoint in wal sender process and step next in backend process. Then a assertion core file will be found.

    Is this a bug? And how to slove it? Looking forward to your reply. Thanks!
    Sorry about my poor english O(∩_∩)O


                                            Const Sunny
                                            2017-6-29

const_sunny@126.com

pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [BUGS] BUG #14721: Assertion of synchronous replication
Next
From: Thomas Munro
Date:
Subject: Re: [BUGS] BUG #14721: Assertion of synchronous replication