Skip to content

Commit

Permalink
STAR-247: Add allowed warning for running scrub test
Browse files Browse the repository at this point in the history
The message is expected since bloom filter is not recreated when there is no index.

(cherry picked from commit f7684e4)
(cherry picked from commit 8ebfd4e)
(cherry picked from commit 4bb4236)
  • Loading branch information
jacek-lewandowski committed Mar 9, 2022
1 parent 1369b31 commit aac2b4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
10 changes: 5 additions & 5 deletions scrub_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def launch_nodetool_cmd(self, cmd):
if not common.is_win(): # nodetool always prints out on windows
assert_length_equal(response, 0) # nodetool does not print anything unless there is an error

def launch_standalone_scrub(self, ks, cf, reinsert_overflowed_ttl=False, no_validate=False):
def launch_standalone_scrub(self, ks, cf, reinsert_overflowed_ttl=False, no_validate=False, acceptable_errors=None):
"""
Launch the standalone scrub
"""
Expand All @@ -134,7 +134,7 @@ def launch_standalone_scrub(self, ks, cf, reinsert_overflowed_ttl=False, no_vali
# if we have less than 64G free space, we get this warning - ignore it
if err and "Consider adding more capacity" not in err.decode("utf-8"):
logger.debug(err.decode("utf-8"))
assert_stderr_clean(err.decode("utf-8"))
assert_stderr_clean(err.decode("utf-8"), acceptable_errors)

def perform_node_tool_cmd(self, cmd, table, indexes):
"""
Expand All @@ -161,12 +161,12 @@ def scrub(self, table, *indexes):
time.sleep(.1)
return self.get_sstables(table, indexes)

def standalonescrub(self, table, *indexes):
def standalonescrub(self, table, *indexes, acceptable_errors=None):
"""
Launch standalone scrub on table and indexes, and then return all sstables
in a dict keyed by the table or index name.
"""
self.launch_standalone_scrub(KEYSPACE, table)
self.launch_standalone_scrub(ks=KEYSPACE, cf=table, acceptable_errors=acceptable_errors)
for index in indexes:
self.launch_standalone_scrub(KEYSPACE, '{}.{}'.format(table, index))
return self.get_sstables(table, indexes)
Expand Down Expand Up @@ -446,7 +446,7 @@ def test_standalone_scrub_essential_files_only(self):

self.delete_non_essential_sstable_files('users')

scrubbed_sstables = self.standalonescrub('users')
scrubbed_sstables = self.standalonescrub(table='users', acceptable_errors=["WARN.*Could not recreate or deserialize existing bloom filter, continuing with a pass-through bloom filter but this will significantly impact reads performance"])
self.increase_sstable_generations(initial_sstables)
assert initial_sstables == scrubbed_sstables

Expand Down
20 changes: 12 additions & 8 deletions tools/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,19 @@ def assert_stderr_clean(err, acceptable_errors=None):
@param acceptable_errors A list that if used, the user chooses what
messages are to be acceptable in stderr.
"""
default_acceptable_errors = ["WARN.*JNA link failure.*unavailable.",
"objc.*Class JavaLaunchHelper.*?Which one is undefined.",
# Stress tool JMX connection failure, see CASSANDRA-12437
"Failed to connect over JMX; not collecting these stats",
"Picked up JAVA_TOOL_OPTIONS:.*",
# Warnings for backward compatibility should be logged CASSANDRA-15234
".*parameters have been deprecated. They have new names and/or value format; "
+ "For more information, please refer to NEWS.txt*"]

if acceptable_errors is None:
acceptable_errors = ["WARN.*JNA link failure.*unavailable.",
"objc.*Class JavaLaunchHelper.*?Which one is undefined.",
# Stress tool JMX connection failure, see CASSANDRA-12437
"Failed to connect over JMX; not collecting these stats",
"Picked up JAVA_TOOL_OPTIONS:.*",
# Warnings for backward compatibility should be logged CASSANDRA-15234
".*parameters have been deprecated. They have new names and/or value format; "
+ "For more information, please refer to NEWS.txt*"]
acceptable_errors = default_acceptable_errors
else:
acceptable_errors = default_acceptable_errors + acceptable_errors

regex_str = r"^({}|\s*|\n)*$".format("|".join(acceptable_errors))
err_str = err.strip()
Expand Down

0 comments on commit aac2b4d

Please sign in to comment.