timoninmaxim commented on a change in pull request #8575:
URL: https://github.com/apache/ignite/pull/8575#discussion_r543254570
##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -351,3 +351,25 @@ def __dump_netfilter_settings(node):
Reads current netfilter settings on the node for debugging purposes.
"""
return str(node.account.ssh_client.exec_command("sudo iptables -L
-n")[1].read(), sys.getdefaultencoding())
+
+ def restart(self):
Review comment:
make it private
##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -351,3 +351,25 @@ def __dump_netfilter_settings(node):
Reads current netfilter settings on the node for debugging purposes.
"""
return str(node.account.ssh_client.exec_command("sudo iptables -L
-n")[1].read(), sys.getdefaultencoding())
+
+ def restart(self):
+ """
+ Restart ignite cluster without cleaning.
+ """
+ self.stop()
+ self.rotate_log()
+ self.start(clean=False)
+
+ def rotate_log(self):
+ """
+ Rotate log file.
+ """
+ new_log_file = self.STDOUT_STDERR_CAPTURE.replace('.log', '_$N.log')
+
+ for node in self.nodes:
+ node.account.ssh(f'if [ -e {self.STDOUT_STDERR_CAPTURE} ];'
+ f'then '
+ f'cd {self.LOGS_DIR};'
+ f'N=`ls | grep log | wc -l`;'
Review comment:
Use grep with full pattern patching, smth like "^console_?[0-9]*.log$".
As string "log" may match different log files.
Alternative is using service counter variable that incremented within
restart method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]