1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-10 01:22:48 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore
Gagan Goel 973e5024d8 MCOL-4957 Fix performance slowdown for processing TIMESTAMP columns.
Part 1:
 As part of MCOL-3776 to address synchronization issue while accessing
 the fTimeZone member of the Func class, mutex locks were added to the
 accessor and mutator methods. However, this slows down processing
 of TIMESTAMP columns in PrimProc significantly as all threads across
 all concurrently running queries would serialize on the mutex. This
 is because PrimProc only has a single global object for the functor
 class (class derived from Func in utils/funcexp/functor.h) for a given
 function name. To fix this problem:

   (1) We remove the fTimeZone as a member of the Func derived classes
   (hence removing the mutexes) and instead use the fOperationType
   member of the FunctionColumn class to propagate the timezone values
   down to the individual functor processing functions such as
   FunctionColumn::getStrVal(), FunctionColumn::getIntVal(), etc.

   (2) To achieve (1), a timezone member is added to the
   execplan::CalpontSystemCatalog::ColType class.

Part 2:
 Several functors in the Funcexp code call dataconvert::gmtSecToMySQLTime()
 and dataconvert::mySQLTimeToGmtSec() functions for conversion between seconds
 since unix epoch and broken-down representation. These functions in turn call
 the C library function localtime_r() which currently has a known bug of holding
 a global lock via a call to __tz_convert. This significantly reduces performance
 in multi-threaded applications where multiple threads concurrently call
 localtime_r(). More details on the bug:
   https://sourceware.org/bugzilla/show_bug.cgi?id=16145

 This bug in localtime_r() caused processing of the Functors in PrimProc to
 slowdown significantly since a query execution causes Functors code to be
 processed in a multi-threaded manner.

 As a fix, we remove the calls to localtime_r() from gmtSecToMySQLTime()
 and mySQLTimeToGmtSec() by performing the timezone-to-offset conversion
 (done in dataconvert::timeZoneToOffset()) during the execution plan
 creation in the plugin. Note that localtime_r() is only called when the
 time_zone system variable is set to "SYSTEM".

 This fix also required changing the timezone type from a std::string to
 a long across the system.
2022-02-14 14:12:27 -05:00
..

Objective
---------
The 'columnstore' test suite includes tests suites aimed at testing MariaDB Columnstore
Database Engine (MCS).

https://mariadb.com/kb/en/mariadb-columnstore/

Test Repo
---------
https://github.com/mariadb-corporation/columnstore-tests/tree/master/mysql-test/suite/columnstore

Test structure
--------------
The current directory structure is shown below:

columnstore/
├── basic
│   ├── r
│   └── t
├── csinternal
│   ├── autopilot
│   │   ├── r
│   │   └── t
│   ├── devregression
│   │   ├── r
│   │   └── t
│   └── include
│       ├── dbt3
│       └── ssb
├── extended
├── include
└── std_data

't' dir contains the tests.
'r' dir contains the expected result files.
'include' dir contains common libraries used by the tests.
'std_data' dir containt test data files. 

Test suites:
1. basic
Mostly sanity, high value, shorter execution time tests

2. extended
More complex and involved tests - longer execution time, variations

3. csinternal
Limited to CS internal team - Uses seeded test data. The tests in this are divided into the following two sub-suites:
   autopilot - Autopilot cases migrated to MTR
   devregression - Part of Dev test suite migrated to MTR

Prerequisites
-------------
1.
MariaDB Server and Columnstore are already installed on the test box, let's call it INSTALL_DIR. Usually it is /usr/share/mysql.
mysql-test is already installed, let's call it MYSQLTEST_DIR. Usually it is /usr/share/mysql-test.
Columnstore-tests local repository, let's call it MCSTEST_DIR. Usually it is columnstore-tests/mysql-test/suite/columnstore

cd MYSQLTEST_DIR
ln -s MCSTEST_DIR MYSQLTEST_DIR/suite/columnstore

2. Only for csinternal tests
For csinternal test run requires the test data 'dbt3' and 'ssb' stored at https://drive.google.com/drive/folders/1dAV4ltxLrvC_7TrZ4zLu42gxx17wzH15?usp=sharing to be available at the following location on the test box:

/data/qa/source/
               dbt3
               ssb

Setup test environment by running the following:
./mtr --suite=columnstore/csinternal regression_env_setup  --extern socket=/var/lib/mysql/mysql.sock

Test Run
--------
Run test suite:
mtr --force --suite=columnstore/basic --extern socket=/var/lib/mysql/mysql.sock
mtr --force --suite=columnstore/extended --extern socket=/var/lib/mysql/mysql.sock
mtr --force --suite=columnstore/csinternal --extern socket=/var/lib/mysql/mysql.sock
mtr --force --suite=columnstore/csinternal/autopilot --extern socket=/var/lib/mysql/mysql.sock
mtr --force --suite=columnstore/csinternal/devregression --extern socket=/var/lib/mysql/mysql.sock

Run individual test:
example
mtr --suite=columnstore/basic mcs12_alter_table.test --extern socket=/var/lib/mysql/mysql.sock

Run by skipping list of tests:
example
mtr --force --skip-test-list=failed.def --suite=columnstore/basic --extern socket=/var/lib/mysql/mysql.sock
failed.def file lists test names in separated lines.