Re: pg_receivexlog add synchronous mode
От | Fujii Masao |
---|---|
Тема | Re: pg_receivexlog add synchronous mode |
Дата | |
Msg-id | CAHGQGwEhSdAF2gMmTqVWnnDFRtT40eaSHvbMTcTp29VKr5ej=Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pg_receivexlog add synchronous mode (<furuyao@pm.nttdata.co.jp>) |
Ответы |
Re: pg_receivexlog add synchronous mode
|
Список | pgsql-hackers |
On Thu, Jun 26, 2014 at 7:01 PM, <furuyao@pm.nttdata.co.jp> wrote: >> The patch looks somewhat complicated and bugs can be easily introduced >> because it tries to not only add new feature but also reorganize the main >> loop in HandleCopyStream at the same time. To keep the patch simple, I'm >> thinking to firstly apply the attached patch which just refactors the >> main loop. Then we can apply the main patch, i.e., add new feature. >> Thought? > Thank you for the refactoring patch. > I did a review of the patch. > As a result, I found the calculation of sleeptime when the --status-intarvall is set to 1 was incorrect. > > --status-intarvall 1 --> sleeptime 1.9999 !? > --status-intarvall 2 --> sleeptime 1.9999 OK > --status-intarvall 3 --> sleeptime 2.9999 OK Thanks for the review! + if (secs <= 0) + secs = 1; /* Always sleep at least 1 sec */ + + sleeptime = secs * 1000 + usecs / 1000; The above is the code which caused that problem. 'usecs' should have been reset to zero when 'secs' are rounded up to 1 second. But not. Attached is the updated version of the patch. Regards, -- Fujii Masao
Вложения
В списке pgsql-hackers по дате отправления: