Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39687

12.0.x shows slower performance than 11.8.6; AHI‑related differences identified during analysis

    XMLWordPrintable

Details

    • Bug
    • Status: Needs Feedback (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 12.0.0
    • None
    • None
    • Related to performance

    Description

      Benchmarking shows that 12.0.x performs below 11.8.6 on Point Select workloads.

      Bisecting on the 11.8.x branch identifies commit 83a48d2bc84 as the change associated with a measurable TPS improvement. The logic modified by this commit is not identifiable in the 12.0.x codebase, and the underlying issue may be handled through different logic in the 12.x AHI implementation. Additional regressions may also contribute and remain under review.

      Affected Versions: 12.0.0..12.0.1

      Later 12.x and 13.x releases may also be affected; analysis ongoing.

      Benchmark Configuration (sysbench‑lua)
      Test Suite: sysbench-lua
      Test Case: Point Select
      oltp_lua_script: oltp_point_select.lua
      number_of_rows: 1000000
      number_of_tables: 8
      thread_count: 128
      run_duration_seconds: 400
      oltp_skip_trx: on
      range_size: 100
      forced_shutdown: 1
      forced_shutdown_sec: 0
      socket_count: 1

      Observed Behavior

      11.8.6 achieves higher TPS than 12.0.x under the tested Point Select workload.

      12.0.0 matches the performance level of 11.8.1.

      Expected Behavior

      12.0.x should not regress relative to 11.8.x on this workload unless architectural changes justify the difference.

      Technical Analysis

      Branching context

      12.0 was branched from 11.8.1.

      Some 11.8.x fixes were merged forward, but the AHI and buffer pool code had already diverged, preventing direct application of certain changes.

      Performance‑relevant change in 11.8.x

      Commit 83a48d2bc84 (AHI fixup) improves TPS by approximately 2.5k to 3.2k in the tested workload.

      This commit corrects a stale AHI ref_count condition that could lead to partial AHI disablement.

      Comparison with 12.0.x

      The logic modified by 83a48d2bc84 in 11.8.6 is not identifiable in the 12.0.x AHI implementation.

      The 12.x AHI code is structurally different, and the underlying issue may be handled through different logic.

      No equivalent fix or behavior adjustment is visible in the corresponding 12.0.x code sections.

      11.8.6 reference (buf0buf.cc):

      diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
      index 0df5ac48845..7aead847db8 100644
      — a/storage/innobase/buf/buf0buf.cc
      +++ b/storage/innobase/buf/buf0buf.cc
      @@ -3703,6 +3703,8 @@ ATTRIBUTE_COLD void buf_pool_t::clear_hash_index() noexcept
      # endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
      if (index->freed())
      garbage.insert(index);
      + else
      + index->search_info.ref_count = 0;
      block->index = nullptr;
      }

      12.0.1 reference (buf0buf.cc):

      # if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
      if (index->freed())
      garbage.insert(index);
      block->index = nullptr;
      }

      mysql_mutex_unlock(&mutex);

      for (dict_index_t *index : garbage)
      btr_search_lazy_free(index);
      }

      Commit‑level TPS observations

      BAD TPS- 378817.54 - d4c4eb79392
      BAD TPS- 378345.06 - 2667b544edc
      BAD TPS- 378863.31 - 643d365ced1
      BAD TPS- 378951.94 - 5a74bfa054e
      GOOD TPS- 381123.99 - 83a48d2bc84 (AHI fixup)

      Net effect

      11.8.6 > 12.0.0 > 12.0.1

      11.8.6 benefits from the AHI fix.

      12.0.0 aligns with 11.8.1 performance.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              jeb Jonathan Jeb Miller
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.