Page MenuHomePhabricator

sre.mysql.parsercache: make it work with msX sections
Open, MediumPublic

Description

Right now parsercache and msX share the same architecture.
Ideally we should rename sre.mysql.parsercache to maybe sre.mysql.parsercache-ms (ideas welcome) and make it work with msX sections.

For some reason I was convinced this was done (maybe we discussed it but never got to actually implement it):

[06:13:46] marostegui@cumin1003:~$ sudo cookbook sre.mysql.parsercache -t T411497 -r "Schema change" ms1 depool
Failed safety check: {msg}
NoneType: None
Exception raised while parsing arguments for cookbook sre.mysql.parsercache:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/spicerack/_menu.py", line 359, in _safe_call
    ret_value = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 1874, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 1907, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2122, in _parse_known_args
    stop_index = consume_positionals(start_index)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2078, in consume_positionals
    take_action(action, args)
  File "/usr/lib/python3.11/argparse.py", line 1967, in take_action
    argument_values = self._get_values(action, argument_strings)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2501, in _get_values
    value = self._get_value(action, arg_string)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2534, in _get_value
    result = type_func(arg_string)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/srv/deployment/spicerack/cookbooks/sre/mysql/parsercache.py", line 38, in check_section
    ensure(re.fullmatch(r"pc\d+", section) is not None, "Invalid section")
  File "/srv/deployment/spicerack/cookbooks/sre/mysql/parsercache.py", line 30, in ensure
    raise AssertionError(msg)
AssertionError: Invalid section

Details

Event Timeline

Marostegui moved this task from Triage to Ready on the DBA board.

I beat my usual drum 😅 : It all should be under one "depool" cookbook.

Yeah, I think this should go under the wrapper discussed at: https://phabricator.wikimedia.org/T383674

Change #1215575 had a related patch set uploaded (by Federico Ceratto; author: Federico Ceratto):

[operations/cookbooks@master] sre.mysql.pool: [de]pool various section kinds

https://gerrit.wikimedia.org/r/1215575