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

The number of pagecache segments affects counting of used/unused blocks

    XMLWordPrintable

Details

    Description

      As reported in MDEV-36915, the status values Aria_pagecache_blocks_unused and Aria_pagecache_blocks_used don't seem reliable, so maybe it's just a variation of the same problem, but since they look even less reliable with the new multiple pagecache segments, I'll have it recorded separately.

      --source include/have_sequence.inc
       
      create table t1 (pk int primary key, a int, b int, key(a)) engine=Aria;
      insert into t1 select seq, seq, seq from seq_1_to_50000;
      create table t2 (pk int primary key, a int, b int, key(a)) engine=Aria;
      insert into t2 select seq, seq, seq from seq_1_to_50000;
       
      --let $segment_values=1,2,4,16
      --let $count= 4
      --let $n= 0
      while ($n < $count)
      {
          --inc $n
          --let $sgm=`select ELT($n, $segment_values)`
          --let $restart_parameters= --aria-pagecache-buffer-size=32M --aria-pagecache-segments=$sgm
          --source include/restart_mysqld.inc
          --echo #
          --echo # With $sgm segment(s):
          --echo #
          --disable_result_log
          select * from t1;
          select * from t2;
          --enable_result_log
          select variable_name, variable_value from information_schema.global_status where variable_name in ('Aria_pagecache_blocks_unused','Aria_pagecache_blocks_used');
      }
       
      drop table t1, t2;
      

      bb-MDEV-24-monty ced634e8c99aa1a77c6b7f4210013cbbcf6f14da

      #
      # With 1 segment(s):
      #
      select * from t1;
      select * from t2;
      select variable_name, variable_value from information_schema.global_status where variable_name in ('Aria_pagecache_blocks_unused','Aria_pagecache_blocks_used');
      variable_name	variable_value
      ARIA_PAGECACHE_BLOCKS_UNUSED	3353
      ARIA_PAGECACHE_BLOCKS_USED	543
      # restart: --aria-pagecache-buffer-size=32M --aria-pagecache-segments=2
      #
      # With 2 segment(s):
      #
      select * from t1;
      select * from t2;
      select variable_name, variable_value from information_schema.global_status where variable_name in ('Aria_pagecache_blocks_unused','Aria_pagecache_blocks_used');
      variable_name	variable_value
      ARIA_PAGECACHE_BLOCKS_UNUSED	3351
      ARIA_PAGECACHE_BLOCKS_USED	545
      # restart: --aria-pagecache-buffer-size=32M --aria-pagecache-segments=4
      #
      # With 4 segment(s):
      #
      select * from t1;
      select * from t2;
      select variable_name, variable_value from information_schema.global_status where variable_name in ('Aria_pagecache_blocks_unused','Aria_pagecache_blocks_used');
      variable_name	variable_value
      ARIA_PAGECACHE_BLOCKS_UNUSED	3349
      ARIA_PAGECACHE_BLOCKS_USED	545
      # restart: --aria-pagecache-buffer-size=32M --aria-pagecache-segments=16
      #
      # With 16 segment(s):
      #
      select * from t1;
      select * from t2;
      select variable_name, variable_value from information_schema.global_status where variable_name in ('Aria_pagecache_blocks_unused','Aria_pagecache_blocks_used');
      variable_name	variable_value
      ARIA_PAGECACHE_BLOCKS_UNUSED	3378
      ARIA_PAGECACHE_BLOCKS_USED	497
      

      so, the counts with 1, 2, and 4 segments differ slightly (although it's unclear why they would differ at all), but the values with 16 segments suddenly jump far away.
      The pagecache buffer size is set to 32M in the test (contrary to MTR's usual 8M), so even with 16 segments it doesn't seem to be extremely low.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.