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

MDEV-34986: storage/innobase/dict/dict0dict: add a RAII class to freeze a dict_sys_t #3529

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Sep 19, 2024

  1. storage/innobase/srw_lock: add macros SRW_LOCK_ARGS2, SRW_LOCK_CALL2

    These macros shall be used if there are other arguments.  Unlike the
    old variants, they start with a comma.
    MaxKellermann committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9802529 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. storage/innobase/dict/dict0dict: add a RAII class to freeze a dict_sys_t

    This replaces a lot of manual freeze() and unfreeze() call.  Doing it
    with RAII is safer and easier.
    
    I did not replace all freeze()/unfreeze() pairs because some callers
    unfreeze and re-freeze in the middle of a scope.  Sometimes, adding a
    new scope can be added just for such a RAII object.  Refactoring that
    can be done later.
    
    Notes:
    
    - Instead of using the global variable `dict_sys`, I decided to pass a
      `dict_sys_t` reference parameter, because I believe it will be
      necessary to eliminate that global variable eventually (in order to
      have a per-catalog instance).  Hard-coding this global variable here
      would generate identical (not better) machine code and would be a
      step in the wrong direction.
    
    - The new macros `SRW_LOCK_ARGS2` and `SRW_LOCK_CALL2` were necessary
      because this is the first time those debug-only parameters are
      forwarded from a function that has more parameters (i.e. the
      dict_sys_t reference).
    MaxKellermann committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    afc52cf View commit details
    Browse the repository at this point in the history