From 73f8b165459be1ef1c3c0453a17282fe03348a75 Mon Sep 17 00:00:00 2001 From: Ryan SVIHLA Date: Mon, 25 Oct 2021 09:53:32 +0200 Subject: [PATCH] missing tombstones in dse 6.0 --- CHANGELOG.txt | 4 ++++ pysper/__init__.py | 2 +- pysper/changelog.py | 4 ++++ pysper/commands/core/diag.py | 6 +++--- pysper/commands/sperf.py | 2 +- pysper/commands/sperf_default.py | 4 +++- pysper/core/diag/__init__.py | 2 +- pysper/core/diag/reporter.py | 2 +- pysper/parser/cases.py | 12 ++++++++++++ scripts/sperf | 5 +++-- setup.py | 2 +- tests/commands/test_sperf.py | 2 +- tests/core/test_statuslogger.py | 2 +- tests/test_sperf_default.py | 3 ++- tests/test_statuslogger.py | 2 +- .../nodes/10.101.33.205/logs/cassandra/system.log | 1 + 16 files changed, 40 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 919e294..f922938 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +sperf 0.6.16 +------------ +* tombstone warnings for 6.0.x are not parsed correctly + sperf 0.6.15 ------------ * added detection for indexing backoff with auto soft commit diff --git a/pysper/__init__.py b/pysper/__init__.py index 829b388..89784a6 100644 --- a/pysper/__init__.py +++ b/pysper/__init__.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. """top level module for sperf python port""" -VERSION = "0.6.15" +VERSION = "0.6.16" diff --git a/pysper/changelog.py b/pysper/changelog.py index 4aeeb7b..3d419b3 100644 --- a/pysper/changelog.py +++ b/pysper/changelog.py @@ -1,4 +1,8 @@ CHANGES = """ +sperf 0.6.16 +------------ +* tombstone warnings for 6.0.x are not parsed correctly + sperf 0.6.15 ------------ * added detection for indexing backoff with auto soft commit diff --git a/pysper/commands/core/diag.py b/pysper/commands/core/diag.py index e9c0724..c69d358 100644 --- a/pysper/commands/core/diag.py +++ b/pysper/commands/core/diag.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""cassread command wiring""" +"""sperf core diag command wiring""" from pysper.commands import flags from pysper import VERSION from pysper.core.diag import parse_diag, generate_report @@ -72,7 +72,7 @@ def add_args(diag_parser): def add_flags(subparsers, name, run_func, is_deprecated=False): - """so we can share the parser with the legacy sperf cassread command""" + """so we can share the parser with the legacy 'sperf core diag' command""" help_text = "Generates a diagtarball report. DSE 5.0-6.8" if is_deprecated: help_text = help_text + ". DEPRECATED: use 'sperf core diag' instead" @@ -84,7 +84,7 @@ def add_flags(subparsers, name, run_func, is_deprecated=False): def build(subparsers): - """builds the cassread command up, assumes argparser api""" + """builds the sperf core diag command up, assumes argparser api""" add_flags(subparsers, "diag", run) diff --git a/pysper/commands/sperf.py b/pysper/commands/sperf.py index e2e9de6..89bfcea 100644 --- a/pysper/commands/sperf.py +++ b/pysper/commands/sperf.py @@ -98,7 +98,7 @@ def run(): print(str(ex)) print("") print( - "To show strack trace use the -v flag. For example: 'sperf -v cassread'" + "To show strack trace use the -v flag. For example: 'sperf -v core statuslogger'" ) else: print("sperf version %s" % VERSION) diff --git a/pysper/commands/sperf_default.py b/pysper/commands/sperf_default.py index 3ee8dcf..43d2763 100644 --- a/pysper/commands/sperf_default.py +++ b/pysper/commands/sperf_default.py @@ -33,4 +33,6 @@ def run(args): raise ex print(str(ex)) print("") - print("To show strack trace use the -v flag. For example: 'sperf -v cassread'") + print( + "To show strack trace use the -v flag. For example: 'sperf -v core statuslogger'" + ) diff --git a/pysper/core/diag/__init__.py b/pysper/core/diag/__init__.py index 1636cd1..48644f5 100644 --- a/pysper/core/diag/__init__.py +++ b/pysper/core/diag/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""information collection and report writing for the cassread tool""" +"""information collection and report writing for the sperf core diag command""" from pysper.core.diag import reporter, node_env, table_stats, config_diff, read_ahead from pysper import diag, util diff --git a/pysper/core/diag/reporter.py b/pysper/core/diag/reporter.py index c479e8e..32b4e32 100644 --- a/pysper/core/diag/reporter.py +++ b/pysper/core/diag/reporter.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""formats the output of the cassread parsed data""" +"""formats the output of the sperf core diag parsed data""" from pysper import humanize, env # used for report formatting diff --git a/pysper/parser/cases.py b/pysper/parser/cases.py index 96e8c96..d74036f 100644 --- a/pysper/parser/cases.py +++ b/pysper/parser/cases.py @@ -699,6 +699,18 @@ def zc_rules(): def tombstone_rules(): """catch tombstone problems""" return ( + case("ReadCommand"), + rule( + capture( + r"Read (?P[0-9]*) live rows and (?P[0-9]*) tombstone cells for query (?P.*) \(see tombstone_warn_threshold\)" + ), + convert(int, "tombstones"), + update( + event_product="tombstone", + event_category="reading", + event_type="tpc_scan_warn", + ), + ), case("MessageDeliveryTask"), rule( capture( diff --git a/scripts/sperf b/scripts/sperf index c8eb833..aba9b5f 100755 --- a/scripts/sperf +++ b/scripts/sperf @@ -17,9 +17,10 @@ import sys import os import platform -if platform.python_version() < '3.7': + +if platform.python_version() < "3.7": raise Exception("sperf requires at least Python 3.7, consider a packaged release") -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) from pysper.commands import sperf if __name__ == "__main__": diff --git a/setup.py b/setup.py index d16a928..2fd48b6 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="sperf", - version="0.6.15", + version="0.6.16", description="Diagnostic utility for DSE and Cassandra", url="https://www.github.com/DataStax-Toolkit/sperf", scripts=["scripts/sperf"], diff --git a/tests/commands/test_sperf.py b/tests/commands/test_sperf.py index e7a1b8b..0d89749 100644 --- a/tests/commands/test_sperf.py +++ b/tests/commands/test_sperf.py @@ -47,7 +47,7 @@ def test_sperf_will_break_if_incorrect_comamnd_is_used(self): self.assertTrue(success) def test_core_diag_wired(self): - """verify cassread is connected""" + """verify sperf core diag is connected""" parser = sperf.build_parser() args = parser.parse_args(["core", "diag"]) self.assertTrue(hasattr(args, "func")) diff --git a/tests/core/test_statuslogger.py b/tests/core/test_statuslogger.py index 0c4d930..a6933fb 100644 --- a/tests/core/test_statuslogger.py +++ b/tests/core/test_statuslogger.py @@ -45,7 +45,7 @@ def test_skip_duplicate_events_diag(self): self.assertTrue(sl.analyzed) self.assertEqual(len(sl.nodes), 3) s = Summary(sl.nodes) - self.assertEqual(s.lines, 22054) + self.assertEqual(s.lines, 22055) self.assertEqual(s.skipped_lines, 445) self.assertEqual( s.get_busiest_stages()[0], diff --git a/tests/test_sperf_default.py b/tests/test_sperf_default.py index c314841..3c1fa14 100644 --- a/tests/test_sperf_default.py +++ b/tests/test_sperf_default.py @@ -59,7 +59,8 @@ def run(): --------------- * There were 16 incidents of GC over 500ms. Run `sperf core gc` for more analysis. * There were drops of the following request types: MUTATION for a total of 1096 drops. Run sperf core statuslogger and look for high pending stages for those messages types. -* Global local backpressure was active on the following nodes: 10.101.35.102 (1 times). GC was over target %s times however despire TPC backpressure being active it may be dangerous to raise TPC limits, run sperf core statuslogger for further analysis on the type of requests that are pending.""", +* Global local backpressure was active on the following nodes: 10.101.35.102 (1 times). GC was over target %s times however despire TPC backpressure being active it may be dangerous to raise TPC limits, run sperf core statuslogger for further analysis on the type of requests that are pending. +* Tombstone warnings found, there were 1951 total tombstones scanned. The data model has a problem.""", ) def test_sperf_68(self): diff --git a/tests/test_statuslogger.py b/tests/test_statuslogger.py index 15b1fdb..4f03a26 100644 --- a/tests/test_statuslogger.py +++ b/tests/test_statuslogger.py @@ -47,7 +47,7 @@ def run(): output, "sperf core statuslogger version: %s\n" % (VERSION) + """ -Summary (22,054 lines) +Summary (22,055 lines) Summary (445 skipped lines) dse versions: {'6.7.7'} diff --git a/tests/testdata/diag/DSE_CLUSTER/nodes/10.101.33.205/logs/cassandra/system.log b/tests/testdata/diag/DSE_CLUSTER/nodes/10.101.33.205/logs/cassandra/system.log index 217a056..c639bcd 100644 --- a/tests/testdata/diag/DSE_CLUSTER/nodes/10.101.33.205/logs/cassandra/system.log +++ b/tests/testdata/diag/DSE_CLUSTER/nodes/10.101.33.205/logs/cassandra/system.log @@ -2462,3 +2462,4 @@ INFO [GCInspector:1] 2020-01-10 17:19:08,323 GCInspector.java:313 - G1 Young G INFO [commitScheduler-6-thread-1] 2020-01-10 17:19:14,043 DocumentsWriter.java:785 - Waited 16 milliseconds for 7 flushing segments. INFO [commitScheduler-6-thread-1] 2020-01-10 17:19:24,124 DocumentsWriter.java:785 - Waited 0 milliseconds for 0 flushing segments. INFO [NodeSyncMaintenanceTasks:1] 2020-01-10 17:19:43,531 NodeSyncMaintenanceTasks.java:172 - In last 10m: validated 0B (0B/s), 0% was inconsistent. +WARN [CoreThread-3] 2020-01-10 17:19:47,591 ReadCommand.java:535 - Read 1 live rows and 1951 tombstone cells for query SELECT * FROM keyspace1.standard1 WHERE id = 894e165d-beba-433d-ab52-055c570fcb9b LIMIT 2000 (see tombstone_warn_threshold)