On 2021/03/15 12:27, Bharath Rupireddy wrote:
On Sun, Mar 7, 2021 at 2:39 PM Bharath Rupireddy
<bharath.rupireddyforpostg...@gmail.com> wrote:
Attaching v7 patch for further review.

Attaching v8 patch after rebasing on to the latest master.

Thanks for rebasing the patch!

-       WAIT_EVENT_XACT_GROUP_UPDATE
+       WAIT_EVENT_XACT_GROUP_UPDATE,
+       WAIT_EVENT_BACKEND_TERMINATION

These should be listed in alphabetical order.

In pg_wait_until_termination's do-while loop, ResetLatch() should be called. 
Otherwise, it would enter busy-loop after any signal arrives. Because the latch 
is kept set and WaitLatch() always exits immediately in that case.

+       /*
+        * Wait in steps of waittime milliseconds until this function exits or
+        * timeout.
+        */
+       int64   waittime = 10;

10 ms per cycle seems too frequent?

+                       ereport(WARNING,
+                                       (errmsg("timeout cannot be negative or zero: 
%lld",
+                                                       (long long int) 
timeout)));
+
+                       result = false;

IMO the parameter should be verified before doing the actual thing.

Why is WARNING thrown in this case? Isn't it better to throw ERROR like 
pg_promote() does?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION


Reply via email to