@@ -659,7 +659,7 @@ def get_control_data(self):
659
659
660
660
return out_dict
661
661
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 ):
663
663
"""
664
664
Starts the PostgreSQL instance and then polls the instance
665
665
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
670
670
username:
671
671
replica: If True, waits for the instance to be in recovery (i.e., replica mode).
672
672
If False, waits for the instance to be in primary mode. Default is False.
673
+ max_attempts:
673
674
"""
674
675
self .start ()
675
676
@@ -684,7 +685,8 @@ def slow_start(self, replica=False, dbname='template1', username=default_usernam
684
685
suppress = {InternalError ,
685
686
QueryException ,
686
687
ProgrammingError ,
687
- OperationalError })
688
+ OperationalError },
689
+ max_attempts = max_attempts )
688
690
689
691
def start (self , params = [], wait = True ):
690
692
"""
@@ -719,7 +721,7 @@ def start(self, params=[], wait=True):
719
721
msg = 'Cannot start node'
720
722
files = self ._collect_special_files ()
721
723
raise_from (StartNodeException (msg , files ), e )
722
-
724
+ print ( "Node started" )
723
725
self ._maybe_start_logger ()
724
726
self .is_started = True
725
727
return self
@@ -1139,9 +1141,9 @@ def poll_query_until(self,
1139
1141
# sanity checks
1140
1142
assert max_attempts >= 0
1141
1143
assert sleep_time > 0
1142
-
1143
1144
attempts = 0
1144
1145
while max_attempts == 0 or attempts < max_attempts :
1146
+ print (f"Pooling { attempts } " )
1145
1147
try :
1146
1148
res = self .execute (dbname = dbname ,
1147
1149
query = query ,
0 commit comments