Re: Stopping logical replication protocol
От | Craig Ringer |
---|---|
Тема | Re: Stopping logical replication protocol |
Дата | |
Msg-id | CAMsr+YHOS9RxObS9JNRJoPC6WFz5m1=-jLezP-6mHUbeHdFc+A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Stopping logical replication protocol (Vladimir Gordiychuk <folyga@gmail.com>) |
Ответы |
Re: Stopping logical replication protocol
|
Список | pgsql-hackers |
<p dir="ltr">On 7 September 2016 at 15:44, Vladimir Gordiychuk <<a href="mailto:folyga@gmail.com">folyga@gmail.com</a>>wrote:<p dir="ltr">> Fixed patch in attach.<p dir="ltr">It'd helpfulif you summarize the changes made when posting revisions.<p dir="ltr">>> * There are no tests. I don't see anyreally simple way to test this,<br /> >> though.<br /> ><br /> > I will be grateful if you specify the bestway how to do it. I tests this<br /> > patches by pgjdbc driver tests that also build on head of postgres. You can<br/> > check test scenario for both patches in<br /> > PRhttps://<a href="http://github.com/pgjdbc/pgjdbc/pull/550">github.com/pgjdbc/pgjdbc/pull/550</a><br/> ><br /> > org.postgresql.replication.LogicalReplicationTest#testDuringSendBigTransactionReplicationStreamCloseNotActive<br/> > org.postgresql.replication.LogicalReplicationTest#testAfterCloseReplicationStreamDBSlotStatusNotActive<pdir="ltr">Yeah, testingit isn't trivial in postgres core, since of course none of the tools know to send a client-initiated CopyDone.<p dir="ltr">Mysuggestion is to teach pg_recvlogical to send CopyDone on the first SIGINT (control-C) and wait until the serverends the data-stream and returns to command mode. A second control-C should unilaterally close the connection and itshould close after a timeout too. This will be backward compatible with 9.4/5/6 (just with a delay on exit by sigint).<pdir="ltr">Then in a TAP test in src/test/recovery set up a logical decoding session with test_decoding and pg_recvlogical.Do a test xact then sigint pg_recvlogical and verify that it exits. To make sure it exited by mutual agreementwith server, probably run pg_recvlogival at a higher debug level and text search for a message you print from pg_recvlogicalwhen it gets server CopyDone in the response to client CopyDone. I don't think a different pg_recvlogical numericexit code could be justified for this.<p dir="ltr">It sounds like more work than I think it would actually be.<p dir="ltr">--<br /> Craig Ringer <a href="http://www.2ndQuadrant.com/">http://www.2ndQuadrant.com/</a><br /> PostgreSQL Development,24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: