Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scylla_node: no need to _wait_no_pending_flushes #500

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions ccmlib/scylla_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,25 +1299,8 @@ def _write_agent_address_yaml(self, agent_dir):
def _write_agent_log4j_properties(self, agent_dir):
raise NotImplementedError('ScyllaNode._write_agent_log4j_properties')

def _wait_no_pending_flushes(self, wait_timeout=60, verbose=True):
pending_flushes_re = re.compile(r"^\s*Pending flushes:\s*(?P<count>\d+)\s*$", flags=re.MULTILINE)

def no_pending_flushes() -> bool:
stdout = self.nodetool('cfstats', timeout=wait_timeout, verbose=verbose)[0]
pending_flushes = False
for match in pending_flushes_re.finditer(stdout):
if int(match.group("count")):
pending_flushes = True
break
return not pending_flushes

if not wait_for(no_pending_flushes, timeout=wait_timeout, step=1.0):
raise NodeError("Node %s still has pending flushes after "
"%s seconds" % (self.name, wait_timeout))

def flush(self, ks=None, table=None, **kwargs):
super(ScyllaNode, self).flush(ks, table, **kwargs)
self._wait_no_pending_flushes(verbose=kwargs.get('verbose', True))

def _run_scylla_executable_with_option(self, option, scylla_exec_path=None):
if not scylla_exec_path:
Expand Down
Loading