1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
Commit Graph

72 Commits

Author SHA1 Message Date
902805d5a3 GCC8.5 warning fixed 2025-07-15 23:54:46 +04:00
dd9298f988 feat(plugin): add extra logging to the plugin init 2025-06-19 19:22:01 +04:00
5cb7a4ac4c chore(compilatiaon): proper use of plugin_ref 2025-06-02 15:39:42 +04:00
bb833ac9f6 chore(build) : fix debug build with MYSQL_VERSION_ID >= 10090 2025-05-30 19:08:35 +04:00
35578f5f05 fix(): fix API return type difference b/w server versions. 2025-05-29 19:05:34 +01:00
44040b4367 feat(plugin): Replaced THDVAR with more lightweight SYSVAR 2025-05-29 19:05:34 +01:00
9038f0df09 feat(plugin): All InnoDB queries are pushed down to Columnstore if columnstore_innodb_queries_uses_mcs = ON in the configuration before server start 2025-05-29 19:05:34 +01:00
7b02299f50 feat(plugin): unconditional innodb into MCS pushdown 2025-05-29 19:05:34 +01:00
a0bee173f6 chore(build): fixes to satisfy clang19 warnings 2025-05-15 19:05:38 +04:00
6b8adb822b chore(connector): remove unused and disabled group by handler (#3481) 2025-04-04 21:27:07 +01:00
16904ab97d chore(compilation): fix to satisfy specific warning 2025-03-27 21:35:11 +04:00
87981483e2 chore(compilation): to resolve unexpected boost warnings 2025-03-27 21:35:11 +04:00
9618ff5e61 compilation fixes for MDEV-34811 handlerton (#3341)
Co-authored-by: Leonid Fedorov <79837786+mariadb-LeonidFedorov@users.noreply.github.com>
2025-01-12 16:08:34 +04:00
2acda95e0b match the rename in the handler rows_changed->rows_stats.updated 2024-05-22 22:32:51 +02:00
3ce19abdae Options to build with TSAN, UBSAN and skipping smoke (#2826) 2023-04-21 21:24:48 +03:00
2e1394149b MCOL-5464: Fixes of bugs from ASAN warnings, part one (#2792)
* Fixes of bugs from ASAN warnings, part one

* MQC as static library, with nifty counter for global map and mutex

* Switch clang to 16

* link messageqcpp to execplan
2023-04-04 02:33:23 +03:00
56f2346083 Remove windows ifdefs 2023-03-02 15:59:42 +00:00
45a779f743 MDEV-25080 Implement ColumnStore-side changes for pushdown of SELECT_LEX_UNITs. 2023-02-27 06:38:31 -05:00
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
04752ec546 clang format apply 2022-01-21 16:43:49 +00:00
d91cab2ff5 MCOL-4925 Suppress the warning message when a non-cached table is (#2164)
dropped with the insert cache enabled.
2021-12-06 11:27:37 -06:00
affb2ae770 MCOL-4769 Fix cache bugs. (#2151)
* MCOL-4769 Do not replay INSERTs and LDIs on the replica nodes when
the write cache is enabled.

* MCOL-4769 If a table is created with the write cache disabled
(i.e. when columnstore_cache_inserts=OFF), make it accessible when
the cache feature is enabled (columnstore_cache_inserts=ON).
2021-11-22 14:20:50 -06:00
c20015a7b2 MCOL-4713 Analyze table implementation. 2021-07-02 12:37:12 +03:00
abbe2ebbf6 Dynamic version numbering 2021-01-21 10:30:46 +00:00
ede047f0fa Fix warnings on CentOS7 2020-11-17 15:03:10 +03:00
83d3adf466 Fix method declarations to match the base class (-Woverloaded-virtual) 2020-11-17 15:03:10 +03:00
78b188ada3 MCOL-4329 dev change gamma to stable 2020-10-29 12:29:10 -05:00
50a4fd9f39 MCOL-4285 For Insert...Select, pass the is_cache_insert=true
flag to ha_mcs_impl_start_bulk_insert.

An earlier commit to fix LDI under replication changed the call in
ha_mcs_cache::start_bulk_insert for a non-insert command from
parent::start_bulk_insert_from_cache to parent::start_bulk_insert.
This commit reverts that change for INSERT...SELECT operation.
2020-10-15 13:30:36 -04:00
0ee64db3e5 Disable cache_handler for system catalog tables. 2020-10-01 17:00:18 -04:00
a1ea633a19 MCOL-4282 Follow up version 2.
Mutate the optimizer flags for prepared statements in:
  1. ha_mcs::open
  2. ha_mcs::discover_check_version

This is done to ensure the optimizer flags are disabled before
JOIN::prepare() is called during "PREPARE stmt FROM ...".
2020-09-25 13:49:52 -04:00
234c2eb740 MCOL-4285 In replication, perform LDI on the slave directly
into the columnstore table, and not into the cache.

LDI performed on a master, comes in as a SQLCOM_END sql_command
on the slave, when binlog_format != STATEMENT. If the cache already
had some records, we were earlier flushing the cache for the LDI
on the slave. This patch detects whether we are in the slave
thread or not, if so, then we don't do a cache flush if
sql_command = SQLCOM_END.
2020-09-16 16:34:07 -04:00
7f6ad16728 MCOL-4303 UPDATE..SET using another table is not updating
The change for MCOL-4264 erroneously added the "lock_type" member
to cal_connection_info, which is shared between multiple tables.
So some tables that were opened for write erroneously identified
themselves as read only.

Moving the member to ha_mcs instead.
2020-09-11 12:26:26 +04:00
929a15ea01 Use the HAVE_PSI_INTERFACE preprocessor guard to disable code
that does not compile if -DPLUGIN_PERFSCHEMA=NO cmake option is used.
2020-08-25 22:03:28 -04:00
b3ae9cf04e Use a session variable, columnstore_cache_flush_threshold,
to allow the user to set the threshold, instead of using a
hard coded value.
2020-08-18 18:01:40 -04:00
47f2291f9f Number of cached rows can be > CACHE_FLUSH_THRESHOLD (in case of batch inserts). 2020-08-18 18:01:40 -04:00
709290cc3d Port of commit: 1ff23d0cd70d576a0f4e512ce332cff348591d36
from server/columnstore_cache.

Commit message:

Fixed bug in free locks that caused rows in cache to not be properly flushed

Fixed by doing adding external_lock(F_UNLCK) in free_locks.
I also moved unlock of cache_handler to be after changing lock type of
cached tables to ensure that no one can use cached table while this is
happening (as cache table is locked with write lock).
I also fixed a wrong mutex order bug in ha_cache::flush_insert_cache()

Other things:
- Addded share::cached_rows to track inserted rows. This is only used
  for asserts to check the number of rows in the cache.
- Fixed wrong mysql_file_chsize() in case of repair
2020-08-18 18:01:40 -04:00
4afcba9520 Do not build the cache as a separate user-visible engine.
We are creating a new read-only system variable, columnstore_cache_inserts,
to enable/disable the cache. When this variable is set at server start up,
any table created with engine=columnstore will also create the corresponding
cache table in Aria engine for performing inserts.

It is important to note that a ColumnStore table created with this
option unset should not be queried when the server is restarted with
the option set, as this will most likely result in query failures.
2020-08-18 18:01:40 -04:00
86fb66365c 1. Set 1M as the threshold on the number of records to flush the cache.
2. Set 100k as the batch size when flushing records into ColumnStore, i.e.,
a flush of 1M records will be performed in 10 batches, each being 100k.

3. For INSERT ... SELECT on the cache, use the default insertion method of cpimport.
2020-08-18 18:01:40 -04:00
f5a8d228a0 Port of commit ba731bdc6a80e88d32e7440044b548c3e3edc591
from server/columnstore_cache

Commit message:

Fixed crashed bug on simple insert

Other things:
- Added test from columnstore team
- Fixed two reported bugs from columnstore team
- Call free_locks as part of start_trans() instead of get_status()
  to ensure that we have locks both for cached table and cache table
  before we try to free any.
- Store pointers to lock->get_status and lock->update_status for the
  cached table. Was needed by ha_tina in flush_insert_cache to make
  new insert rows visible for the SELECT that caused the flush
2020-08-18 18:01:40 -04:00
4ff4e9eb89 Re-enable the ColumnStore_Cache plugin. 2020-08-18 18:01:40 -04:00
cb2ddad308 Port of commit 0463e1f722d4d32526760c923e0092a380a9e634
from server/columnstore_cache.

Commit message:

Fixed bug in cache:

- The THR_LOCK org_lock must be stored in a shared structure so that all
  instances of a table can use it. Fixed by adding a ha_cache_share object
  that keeps track of this one.
- Fixed wrong test in get_status_and_flush_cache to detect in insert command
- Fixed in get_status_and_flush_cache that we always free the insert lock
  if we don't need it.
2020-08-18 18:01:40 -04:00
6b3c6e33c5 MCOL-4152 Reset cond_stack with ha_mcs::reset() call 2020-07-13 13:18:57 +00:00
449a1bd229 Set our maturity level to gamma. 2020-07-07 11:12:34 -04:00
87055f42f6 make columnstore to load in enterprise
.cnf file overwriting plugin-maturity must be lexicographically
after mariadb-enterprise.cnf

also set the maturity correctly without relying on supermodule doing it
2020-07-07 11:10:54 -04:00
d37f4722e1 Disable the ColumnStore cache plugin. 2020-06-16 14:42:35 -04:00
3cfbda3ad3 Disable the Columnstore_cache engine w/o reverting it. 2020-06-16 12:33:20 +00:00
1a5c6910da Make changes based on feedback to PR #1254 for the cache. 2020-06-08 14:11:30 -04:00
1216f9fc70 For INSERT ... SELECT, don't use the is_cache_insert flag
when starting bulk insert. This will invoke cpimport for
the query instead of batch inserts mode. This is intentional
as batch inserts currently have an edge case mentioned in
MCOL-4037 that needs to be fixed.
2020-06-04 12:29:37 -04:00
dd9372c4e8 Fix INSERT ... SELECT on self.
For queries of the form:
  insert into cache1 select * from cache1;
We had a crash in the second call to get_status_and_flush_cache
due to cache->table being 0. This happened because for one of the
two ha_mcs_cache instances involved in this query, the call to
ha_mcs_cache::open was not setting cache_handler->file->lock.status_param.
The assignment to status_param was earlier protected by an if condition.
Solution is to remove that if condition in ha_mcs_cache::open.
2020-06-03 15:20:03 -04:00
c30d105c30 Use batch inserts for the cache flush. 2020-06-03 15:20:03 -04:00