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

LIMIT partition switching is not correct in parallel threads

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • 10.11
    • None
    • None

    Description

      When switching occurs in multiple threads simultaneously, several threads decide to switch to same partition breaking LIMIT value.

      Reproduce

      -- source include/have_partition.inc
       
      create or replace table t1 (x int) with system versioning
      partition by system_time limit 1 partitions 4;
      insert into t1 values (1);
       
      update t1 set x= x + 1;
      update t1 set x= x + 2;
      update t1 set x= x + 3;
       
      select partition_name, table_rows from information_schema.partitions
      where table_name = 't1';
       
      create or replace table t1 (x int) with system versioning
      partition by system_time limit 1 partitions 4;
      insert into t1 values (1);
       
      --connect con3, localhost, root
      --connect con2, localhost, root
      --connect con1, localhost, root
       
      --connection con1
      send update t1 set x= x + 10;
      --connection con2
      send update t1 set x= x + 20;
      --connection con3
      send update t1 set x= x + 30;
      --connection con1
      reap;
      --connection con2
      reap;
      --connection con3
      reap;
       
      --disconnect con1
      --disconnect con2
      --disconnect con3
       
      --connection default
      select partition_name, table_rows from information_schema.partitions
      where table_name = 't1';
       
      drop tables t1;
      

      Result

      select partition_name, table_rows from information_schema.partitions
      where table_name = 't1';
      partition_name  table_rows
      p0      1
      p1      2
      p2      0
      pn      1
      

      Expected

      select partition_name, table_rows from information_schema.partitions
      where table_name = 't1';
      partition_name  table_rows
      p0      1
      p1      1
      p2      1
      pn      1
      

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            midenok Aleksey Midenkov
            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.