github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/optimistic/flush.test (about)

     1  drop database if exists db1;
     2  
     3  create database db1;
     4  use db1;
     5  drop table if exists t;
     6  create table t (a int);
     7  insert into t values (1), (2), (3), (4), (5);
     8  -- @separator:table
     9  select mo_ctl('dn', 'flush', 'db1.t');
    10  select * from t;
    11  delete from t where a in (1, 2, 3);
    12  begin;
    13  -- @separator:table
    14  select mo_ctl('dn', 'flush', 'db1.t');
    15  select * from t;
    16  commit;
    17  
    18  
    19  drop table if exists t;
    20  create table t (a int);
    21  insert into t values (1), (2), (3), (4), (5);
    22  delete from t where a = 2;
    23  insert into t values (6);
    24  delete from t where a = 3;
    25  begin;
    26  -- @session:id=1{
    27  insert into db1.t values (100); -- this row is invisible for begin
    28  -- @separator:table
    29  select mo_ctl('dn', 'flush', 'db1.t'); -- flush
    30  select a from db1.t where a = 1; -- pull
    31  -- @session}
    32  -- read case: appendable block + delete
    33  select * from t;
    34  commit;
    35  
    36  
    37  drop table if exists t;
    38  create table t (a int);
    39  insert into t values (1), (2), (3);
    40  
    41  begin;
    42  -- read, pull insert logtail
    43  select * from t;
    44  -- @session:id=1{
    45  -- @separator:table
    46  select mo_ctl('dn', 'flush', 'db1.t');
    47  select a from db1.t where a = 1;
    48  -- flush and pull meta logtail
    49  -- @session}
    50  -- read again
    51  select * from t;
    52  commit;
    53  
    54  drop database if exists db1;