1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00
Commit Graph

483 Commits

Author SHA1 Message Date
5f07828619 MCOL-5522 Properly process pm join result count.
This patch:
1. Properly processes situation when pm join result count is exceeded.
2. Adds session variable 'columnstore_max_pm_join_result_count` to control the limit.
2024-01-10 18:16:39 +04:00
f5822b5ed3 compiler warnings
like

dbcon/joblist/batchprimitiveprocessor-jl.cpp:893:54: error: pointer used after ‘void operator delete [](void*, std::size_t)’ [-Werror=use-after-free]
  893 |           joinResults.reset(new vector<uint32_t>[8192]);
      |                                                      ^
2023-06-29 18:39:35 -04:00
d70a70b772 MCOL-5512 Fix for post join filter. (#2880)
This patch fixes certain situations where post join filter is not applying.
2023-06-27 18:25:33 +03:00
9e1eac448a MCOL-5499 Enable ControlFlow for same node communication processing path to avoid DEC queue overloading (#2847) 2023-06-07 15:42:47 +03:00
f844724dd7 MCOL-5491 Enable StringStore for long strings in JSON_ARRAYAGG processing.
This patch is the JSON_ARRAYAGG clone of the changes done in MCOL-5429
where we enabled usage of StringStore for long strings in
GROUP_CONCAT() processing to reduce memory footprint of PrimProc and
thus avoiding a potential OS triggered OOM crash.
2023-05-12 20:49:54 +00:00
55d4214429 MCOL-5429 Fix high memory consumption in GROUP_CONCAT() processing. (#2823)
1. Input and output RowGroup's used in GROUP_CONCAT classes
are currently allocating a raw memory buffer of size equal
to the actual width of the string datatype. As an example,
for the following query:
  SELECT col1, GROUP_CONCAT(col2) FROM t GROUP BY col1;
If col2 is a TEXT field with default width, the input
RowGroup containing the target rows to be concatenated will
assign 64kb of memory for every input row in the RowGroup.
This is wasteful as actual field values in real workloads
would be much smaller. We fix this by enabling the
RowGroup to use the StringStore when the RowGroup contains
long strings.

2. RowAggregation::initialize() allocates a memory buffer
for a NULL row. The size of this buffer is equal to the
row size for the output RowGroup. For the above scenario,
using the default group_concat_max_len (which is a server
variable that sets the maximum length of the GROUP_CONCAT string)
value of 1mb, the buffer size would be
(1mb + 64kb + some additional metadata). If the user sets
group_concat_max_len to a higher value, say 3gb, this buffer
size would be ~3gb. Now if the runtime initiates several
instances of RowAggregation, total memory consumption by
PrimProc could exceed the hardware memory limits causing the
OS OOM to kill the process. We fix this problem by again
enabling the StringStore for the NULL row allocation.

3. In the plugin code in buildAggregateColumn(), there is
an integer overflow when the server group_concat_max_len
variable (which is an uint32_t) is set to a value > INT32_MAX
(such as 3gb) and is assigned to
CalpontSystemCatalog::ColType::colWidth (which is an int32_t).
As a short term fix, we saturate the assigned value to colWidth
to INT32_MAX. Proper fix would be to upgrade
CalpontSystemCatalog::ColType::colWidth to an uint32_t.
2023-04-22 00:43:29 +03:00
030144127e Remove boost shared array [develop 23.02] (#2812)
* remove boost/shared_array include

* replace boost::shared_array<T> to std::shared_ptr<T[]>
2023-04-17 20:56:09 +03:00
f1697c261e MCOL-5385 set data extermination [develop-23.02] (#2813)
* Delete RowGroup::setData and make Pointer ctor explicit

* some push_backs replaced with emplace_backs

* Fixes of review notes
2023-04-16 15:57:39 +03:00
2f153184c3 Fixes of bugs from ASAN warnings, part one (#2796) 2023-03-30 18:29:04 +03:00
7f3d540841 MCOL-5438 COUNT() in math causes SEGV (#2769)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2023-03-10 19:32:17 +03:00
56f2346083 Remove windows ifdefs 2023-03-02 15:59:42 +00:00
2f1f9c0ef0 MDEV-25080 Some fixes:
1. In TupleUnion::writeNull(), add the missing switch case for
   wide decimal with 16bytes column width.
2. MCOL-5432 Disable complete/partial pushdown of UNION operation
   if the query involves an ORDER BY or a LIMIT clause, until
   MCOL-5222 is fixed. Also add MTR test cases for this.
2023-02-27 06:38:31 -05:00
86dcf92d56 MCOL-5215 Fix overflow of UNION operation involving DECIMAL datatypes.
When a UNION operation involving DECIMAL datatypes with scale and digits
before the decimal exceeds the currently supported maximum precision
of 38, we throw an error to the user:
"MCS-2060: Union operation exceeds maximum DECIMAL precision of 38".

This is until MCOL-5417 is implemented where ColumnStore will have
full parity with MariaDB server in terms of maximum supported DECIMAL
precision and scale of 65 and 38 digits respectively.
2023-02-27 06:38:31 -05:00
d87206c3e4 Fix segfault in getLocalNetIfacesSins (#2713) 2023-01-26 16:21:21 +03:00
c7c182ebd2 Merge pull request #2684 from drrtuy/MCOL-5385
MCOL-5385 This patch reduces RAM consumption and adds GROUP_CONCAT RA…
2023-01-18 11:58:47 +03:00
d42485656c Fix clang 16 warnings for comfort build 2023-01-12 22:11:28 +03:00
d0eea0ffe8 MCOL-5385 This patch reduces RAM consumption and adds GROUP_CONCAT RAM accounting feature 2023-01-11 09:52:10 +00:00
15f65eff15 Merge pull request #2655 from denis0x0D/MCOL-5263_2
MCOL-5263 Add support to ROLLBACK when PP were restarted.
2022-12-13 21:24:01 +03:00
d61780cab1 MCOL-5263 Add support to ROLLBACK when PP were restarted.
DMLProc starts ROLLBACK when SELECT part of UPDATE fails b/c EM facility in PP were restarted.
Unfortunately this ROLLBACK stuck if EM/PP are not yet available.
DMLProc must have a t/o with re-try doing ROLLBACK.
2022-12-13 16:18:53 +03:00
635a9fdb56 Merge pull request #2658 from dhall-MariaDB/patch_out_of_band
patch_out_of_band
2022-12-12 17:14:41 -06:00
10e2834033 patch_out_of_band
Some changes made to 10.6-enterprise make a build using the out-of-band method of compiling columnstore not work. Out-of band means the source for the engine is not in the storage subdir of server, but rather in a stand alone directory. This is used by developers for easier develop work. In the case of out-of-band, INSTALL_LAYOUT is false in CMakeLists.txt
2022-12-12 14:17:09 -06:00
369aea884e MCOL-5311 Add timezone to jobList in subquerytransformer
TimeZone was uninitialized in this scenario and led to undefined behavior.
2022-12-07 09:52:00 -06:00
a1d89d8f31 Merge pull request #2630 from dhall-MariaDB/sergchanges
Sergchanges
2022-12-02 19:08:08 +03:00
7e3ad24437 Serge changes -- Add static joblist lib 2022-11-30 12:46:26 -06:00
bfbe5bf315 MCOL-5264 This patch replaces boost mutex locks with std analogs
boost::uniqie_lock dtor calls a fancy unlock logic that throws twice.
First if the mutex is 0 and second lock doesn't own the mutex.
The first condition failure causes unhandled exception for one of the clients
in DEC::writeToClient(). I was unable to find out why Linux can have a 0
mutex and replaced boost::mutex with std::mutex b/c stdlibc++ should
be more stable comparing with boost.
2022-11-24 17:19:24 +00:00
b936ed8b2e Fix some GCC-12 Build errors 2022-11-22 03:28:17 +03:00
84bb4e56b8 Merge pull request #2624 from mariadb-corporation/columnstore-22.08.4-1
Columnstore 22.08.4 1
2022-11-18 19:01:33 +03:00
246a4db8de fix C API includes
ColumnStore used to include server's mysql.h
but link all tools with libmariadb.so

There's no guarantee that this would work, even with workarounds
it had in dbcon/mysql/sm.cpp

Fix:
* tools (linked with libmariadb.so) *must* include libmariadb's mysql.h
* as a hack prevent service_thd_timezone.h from being loaded into tools,
  as it conflicts with libmariadb's mysql.h
* server plugin *must* include server's mysql.h
* also don't link every tool with libmariadb.so, link the helper library
  (liblibmysqlclient.so) that actually needs it, tools use this
  helper library, not libmariadb.so directly
2022-11-17 12:02:07 -06:00
21c3bbce16 do *not* link ha_columnstore.so with libmariadb.so
this means some libraries have to be compiled twice -
for tools with libmariadb.so and for plugin, without.
2022-11-17 11:53:42 -06:00
9b84bf57c9 From serg: add dependency for generated header files errorids.h messageids.h 2022-11-17 11:46:10 -06:00
4b15a7e8a9 Merge pull request #2628 from denis0x0D/MCOL-5265
[MCOL-5265] Change boost:shared_ptr to std::shared_ptr.
2022-11-15 16:45:19 +03:00
e09d24cb8d [MCOL-5265] Change boost:shared_ptr to std::shared_ptr.
This is attempt to make some part of the code more stable.
For some reason we can get a spurious nullptr for boost::shared_ptr
which cause an assert and abort.
2022-11-14 18:53:53 +03:00
61d5f80aa0 MCOL-5279 This approach executes same node DEC::writeToClient the last taking multiple ExeMgrs into account (#2623)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-11-11 13:17:45 -06:00
37fd915a08 Serg`s patch for develop-6 revised for develop https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/2614 2022-11-09 22:41:38 +00:00
f5aeb1c1a7 Merge branch 'develop' into columnstore-22.08.3-1 2022-11-04 16:12:56 -05:00
09d785fc9b MCOL-5279 This commit fixes the corner case of the issue that can rarely happen when flow control is used to backpressure PPs that overflows EM with Primitive messages. It also adds a relevant test that makes sense in a multi-node scenario only. (#2605)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-11-03 16:36:54 -05:00
e3ab19e639 Remove unreferenced variable 2022-11-03 11:29:24 -05:00
4ccab75720 Mcol 5279 2 (#2606)
* MCOL-5279 Send ByteStream with Primitive message to remote PPs first
and to the local PP last

MCOL-5166 forces EM to interact with PP over a messaging queue when they are in the same process. When ByteStream is taken from the queue it is drained so it is impossible to re-use the same ByteStream to send to the other nodes.

* MCOL-5279 Fix a corner case when sending PP messages
Multi-node can break when flow control is used to backpressure PPs that overflows EM with Primitive messages.
2022-11-03 09:42:12 -05:00
a1c8f519c1 MCOL-5279 Send ByteStream with Primitive message to remote PPs first (#2603)
and to the local PP last

MCOL-5166 forces EM to interact with PP over a messaging queue when they are in the same process. When ByteStream is taken from the queue it is drained so it is impossible to re-use the same ByteStream to send to the other nodes.
2022-11-02 16:09:45 -05:00
76a33ac246 MCOL-5279 This patch forces to send ByteStream with a Primitive message to the remote PPs first and to the local PP last
MCOL-5166 forces EM to interact with PP over a messaging queue when they are in the same process. When ByteStream is taken from the queue it is drained so it is impossible to re-use the same ByteStream to send to the other nodes.
2022-11-01 19:54:52 +00:00
b57d2c30fe Minor fixes 2022-10-31 14:56:32 +02:00
315e4be2d8 First working attempt for json_arrayagg 2022-10-31 14:56:32 +02:00
1714b75434 Non working attempt to do MCOL-5227 2022-10-31 14:56:32 +02:00
7d76dc4534 AUX column scan(MCOL-5021) effectively disables vectorized scanning on
ARM platforms. This patch resolves this issue and unifies AUX column
processing at x86 and ARM using tempate class SimdProcessor.
The patch also replaces uint16_t mask previously used in column.cpp and
SimProcessor code with a native masks that platform uses, e.g. __m128i
or __m128 on x86 and variety of masks on ARM.
To unify the processing I introduced a new filtering Compare Operator - COMPARE_NULLEQ.
with a 'c1 IS NULL semantics'.
2022-10-07 10:32:54 +00:00
7f97a66184 [MCOL-4590] UNION Performance Improvement with the focus on the normalize functions.
This patch improves the runtime performance of UNION processing in CS, as reported JIRA issue MCOL 4590. The idea of the optimization is to infer the normalize seperate functions beforehand and perform the normalization individually later, instead of a huge switch body of all normalization. This patch also cover engineering optimization, removing the hotspots in UNION processing. After application of this patch, the normalize part takes only about 25% of the whole UNION query in our experiment avg case.

Signed-off-by: Jigao Luo <luojigao@outlook.com>
2022-09-09 22:49:18 +02:00
0863ecd279 Replace getBinaryField 2022-08-25 18:21:43 +03:00
df7c967d54 when eq Filtercount <6 ,the speed of for loop is faster than hashmap
add threshold for eqFilter
2022-08-23 18:45:36 +08:00
6a6fee5969 MCOL-5021 Followup.
Allow the compiler to inline the call to nextColValue() in column.cpp.
2022-08-18 19:35:35 +00:00
0f2f0fc0ba Merge pull request #2507 from denis0x0D/MCOL-4715
MCOL-4715 Mixed inner and outer joins with "null" filter for the table which is not involved into the outer join produces wrong results.
2022-08-17 18:50:43 +03:00
59166608b1 MCOL-4715 Mixed inner and outer joins with "null" filter for the table which is not involved into the outer join produces wrong results. 2022-08-16 17:13:03 +03:00