@@ -659,7 +659,7 @@ def get_control_data(self):
659659
660660return out_dict
661661
662- def slow_start (self ,replica = False ,dbname = 'template1' ,username = default_username ()):
662+ def slow_start (self ,replica = False ,dbname = 'template1' ,username = default_username (), max_attempts = 0 ):
663663"""
664664 Starts the PostgreSQL instance and then polls the instance
665665 until it reaches the expected state (primary or replica). The state is checked
@@ -670,6 +670,7 @@ def slow_start(self, replica=False, dbname='template1', username=default_usernam
670670 username:
671671 replica: If True, waits for the instance to be in recovery (i.e., replica mode).
672672 If False, waits for the instance to be in primary mode. Default is False.
673+ max_attempts:
673674 """
674675self .start ()
675676
@@ -684,7 +685,8 @@ def slow_start(self, replica=False, dbname='template1', username=default_usernam
684685suppress = {InternalError ,
685686QueryException ,
686687ProgrammingError ,
687- OperationalError })
688+ OperationalError },
689+ max_attempts = max_attempts )
688690
689691def start (self ,params = [],wait = True ):
690692"""
@@ -719,7 +721,6 @@ def start(self, params=[], wait=True):
719721msg = 'Cannot start node'
720722files = self ._collect_special_files ()
721723raise_from (StartNodeException (msg ,files ),e )
722-
723724self ._maybe_start_logger ()
724725self .is_started = True
725726return self
@@ -1139,9 +1140,9 @@ def poll_query_until(self,
11391140# sanity checks
11401141assert max_attempts >= 0
11411142assert sleep_time > 0
1142-
11431143attempts = 0
11441144while max_attempts == 0 or attempts < max_attempts :
1145+ print (f"Pooling{ attempts } " )
11451146try :
11461147res = self .execute (dbname = dbname ,
11471148query = query ,