Bug - durability - data missing from MMDB

Developers
Nora
2013-04-24
2013-05-15
  • Nora
    Nora
    2013-04-24

    Hello,

    I am testing CSQL MMDB  (csql3.3-mmdb-linux-x86_64.tar.gz)
    on openSUSE 12.3.

    Durability is very important to me so
    I set these flags in csql.conf file:

    PAGE_SIZE= 131072

    MAX_SYS_DB_SIZE=10485760

    MAX_DB_SIZE=10737418240

    DURABILITY=true
    DURABLE_MODE=1

    MMAP=true

    1. Start csqlserver

    2. Run this code
        Class.forName("csql.jdbc.JdbcSqlDriver");

        Connection connect = DriverManager.getConnection("jdbc:csql", "root", "manager");

    //test insert – around 1.5 GB of data

              Statement stm=null;
              PreparedStatement stmt = null;
              stm=connect.createStatement();
              stm.execute("create table test(pkey int, name char(10), surname char (20), address char (30), first char(30), ddd int,   third char(30));");
            stmt = connect.prepareStatement("INSERT INTO test (pkey, name, surname, address, first, ddd, third) VALUES (?, ?, ?, ?, ?, ?, ?);");
            
              int ret =0;
              for (int i =1 ; i<10000000 ; i++) {
                 stmt.setInt(1, i);
                 stmt.setString(2, "Kate"+ String.valueOf(i));
                 stmt.setString(3, "Kateee");
                 stmt.setString(4,"xxxxxx4");
                 stmt.setString(5,"yyyyyYY");
                 stmt.setInt(6, i);
                 stmt.setString(7, "lalallala");
                 ret = stmt.executeUpdate();
                    
                if (ret != 1) break; //error
           
               }
               stmt.close();
               connect.commit();
               connect.close();

    3. Run client

    CSQL>show tables;
    =============TableNames===================
       test
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            9999999

    4. Run this code

    Class.forName("csql.jdbc.JdbcSqlDriver");

    Connection connect = DriverManager.getConnection("jdbc:csql", "root", "manager");

    //test1 insert - around 1.5 GB of data

              Statement stm=null;
              PreparedStatement stmt = null;
              stm=connect.createStatement();
              stm.execute("create table test1(pkey int, name char(10), surname char (20), address char (30), first char(30), ddd int,   third char(30));");
            stmt = connect.prepareStatement("INSERT INTO test1 (pkey, name, surname, address, first, ddd, third) VALUES (?, ?, ?, ?, ?, ?, ?);");
            
              int ret =0;
              for (int i =1 ; i<10000000 ; i++) {
                 stmt.setInt(1, i);
                 stmt.setString(2, "Kate"+ String.valueOf(i));
                 stmt.setString(3, "Kateee");
                 stmt.setString(4,"xxxxxx4");
                 stmt.setString(5,"yyyyyYY");
                 stmt.setInt(6, i);
                 stmt.setString(7, "lalallala");
                 ret = stmt.executeUpdate();
                    
                if (ret != 1) break; //error
           
               }
               stmt.close();
              connect.commit();
              connect.close();

    5. Run client

    CSQL>show tables;
    =============TableNames===================
       test
       test1
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            9999999

    CSQL>select count (*) from test1;

            COUNT(*)

            9999999

    #Now I have two tables test and test1.

    5. Stop csqlserver
    6. Start csqlserver

    7. Start client

    CSQL>show tables;
    =============TableNames===================
       test
       test1
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            9999999

    CSQL>select count (*) from test1;

            COUNT(*)

            9999999

    8. Stop csqlserver
    9. Start csqlserver

    10. Start client
    CSQL>show tables;
    =============TableNames===================
       test
       test1
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            9999999

    CSQL>select count (*) from test1;

            COUNT(*)

            9999999

    11. Stop csqlserver
    12. Start csqlserver

    13. Start client

    CSQL>show tables;
    =============TableNames===================
       test
       test1
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            0

    CSQL>select count (*) from test1;

            COUNT(*)

            9999999

    DATA FROM MY FIRST TABLE IS GONE!!!!!!!!!!!

    14. Stop csqlserver
    15. Start csqlserver

    16. Start client
    CSQL>show tables;
    =============TableNames===================
       test
       test1
    ==========================================
    CSQL>select count (*) from test;


            COUNT(*)

            0

    CSQL>select count (*) from test1;

            COUNT(*)

            9999999

    DATA FROM MY FIRST TABLE IS GONE!!!!!!!!!!!

    When size of  data is less than 2 GB everything is OK.