Skip to content

Commit

Permalink
merge dev to main (#311)
Browse files Browse the repository at this point in the history
* feat(shannon):selective offload, offload-model
  • Loading branch information
ShannonBase authored Jan 1, 2025
1 parent 4ae6ba3 commit dfd658d
Show file tree
Hide file tree
Showing 20 changed files with 401 additions and 40,054 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev libtirpc-dev -y
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
cd /tmp && wget https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.gz && \
tar zxvf boost_1_77_0.tar.gz && cd boost_1_77_0 && ./bootstrap.sh --prefix=/usr/local/boost && ./b2 -j$(nproc) && sudo ./b2 install && \
sudo rm /tmp/boost_1_77_0 -rf && sudo rm /tmp/boost_1_77_0.tar.gz
- name: build_shannon_and_install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev libtirpc-dev -y
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
cd /tmp && wget https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.gz && \
tar zxvf boost_1_77_0.tar.gz && cd boost_1_77_0 && ./bootstrap.sh --prefix=/usr/local/boost && ./b2 -j$(nproc) && sudo ./b2 install && \
sudo rm /tmp/boost_1_77_0 -rf && sudo rm /tmp/boost_1_77_0.tar.gz
#sed -i '61s/^/#/' cmake_install.cmake to disable can not find openssl_executeable error. removes it when it fixed.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev libtirpc-dev -y
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
cd /tmp && wget https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.gz && \
tar zxvf boost_1_77_0.tar.gz && cd boost_1_77_0 && ./bootstrap.sh --prefix=/usr/local/boost && ./b2 -j$(nproc) && sudo ./b2 install && \
sudo rm /tmp/boost_1_77_0 -rf && sudo rm /tmp/boost_1_77_0.tar.gz
#sed -i '61s/^/#/' cmake_install.cmake to disable can not find openssl_executeable error. removes it when it fixed.
Expand Down
6 changes: 5 additions & 1 deletion mysql-test/suite/secondary_engine/r/optimizer_trace.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ SELECT JSON_PRETTY(JSON_REMOVE(TRACE->'$**.secondary_engine_not_used',
'$[0].cost')) AS trace
FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
trace
NULL
[
{
"reason": "The Query_arbitrator do the prediction, goes to primary engine."
}
]
DROP TABLE t;
49 changes: 23 additions & 26 deletions mysql-test/suite/secondary_engine/r/query_preparation.result
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ x
234
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 1
Secondary_engine_execution_count 0
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE tf;
Expand Down Expand Up @@ -637,15 +637,15 @@ a
INSERT INTO t1 SELECT * FROM t2;
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
# An error shall be returned if table is not loaded.
ALTER TABLE t1 SECONDARY_UNLOAD;
SET @@use_secondary_engine = FORCED;
SELECT * FROM t1;
Got one of the listed errors
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
SET @@use_secondary_engine = ON;
SELECT * FROM t1;
a
Expand All @@ -654,7 +654,7 @@ a
1
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
DROP TABLE t1;
DROP TABLE t2;
SET @@use_secondary_engine = @my_use_secondary_engine;
Expand Down Expand Up @@ -774,27 +774,27 @@ EXECUTE ps;
a
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 1
Secondary_engine_execution_count 0
SET @@use_secondary_engine = FORCED;
EXECUTE ps;
a
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
# Unload table from secondary engine.
ALTER TABLE t1 SECONDARY_UNLOAD;
SET @@use_secondary_engine = ON;
EXECUTE ps;
a
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
SET @@use_secondary_engine = FORCED;
EXECUTE ps;
a
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
DROP PREPARE ps;
DROP TABLE t1;
SET @@use_secondary_engine = @my_use_secondary_engine;
Expand Down Expand Up @@ -830,13 +830,13 @@ a
SET @@use_secondary_engine = @my_use_secondary_engine;
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
SELECT /*+ SET_VAR(use_secondary_engine = OFF) */ * FROM t1;
a
1
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 1
DROP TABLE t1;
SET @@use_secondary_engine = @my_use_secondary_engine;
#
Expand All @@ -848,9 +848,9 @@ ALTER TABLE t SECONDARY_LOAD;
SELECT * FROM t;
x
FLUSH STATUS;
SELECT 1;
1
1
SELECT 0;
0
0
DROP TABLE t;
#
# Load only a subset of columns into secondary engine.
Expand Down Expand Up @@ -1046,7 +1046,7 @@ a b
1 1
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 2
Secondary_engine_execution_count 0
DROP TABLE t1;
#
# Use NOT SECONDARY with other constraint on column.
Expand All @@ -1064,7 +1064,7 @@ SELECT /*+ SET_VAR(use_secondary_engine = FORCED) */ b FROM t1;
ERROR HY000: Secondary engine operation failed. One or more read columns are marked as NOT SECONDARY.
SHOW SESSION STATUS LIKE 'Secondary_engine_execution_count';
Variable_name Value
Secondary_engine_execution_count 1
Secondary_engine_execution_count 0
DROP TABLE t1;
# Add NON SECONDARY and do not use SECONDARY_ENGINE AT CREATE
CREATE TABLE t1 (a INT NOT SECONDARY, b INT);
Expand Down Expand Up @@ -1092,11 +1092,8 @@ Table Op Msg_type Msg_text
test.t analyze status OK
EXPLAIN FORMAT=TREE SELECT * FROM t WHERE a IS NULL;
EXPLAIN
-> Filter: (t.a = <cache>(last_insert_id())) (rows=1)
-> Table scan on t in secondary engine Rapid (rows=1)
-> Rows fetched before execution (rows=1)

Warnings:
Note 1003 Query is executed in secondary engine; the actual query plan may diverge from the printed one
DROP TABLE t;
SET @@sql_auto_is_null = @saved_sql_auto_is_null;
# Bug#29288023: Join condition is substituted with REF access
Expand Down Expand Up @@ -1295,7 +1292,7 @@ SELECT count_star, count_secondary, sum_select_scan
FROM performance_schema.events_statements_summary_by_digest
WHERE digest_text LIKE 'SELECT %';
count_star count_secondary sum_select_scan
2 1 2
3 1 2
EXECUTE ps;
x
1
Expand All @@ -1314,7 +1311,7 @@ SELECT execution_engine, count_execute, count_secondary
FROM performance_schema.prepared_statements_instances
WHERE statement_name = 'ps';
execution_engine count_execute count_secondary
SECONDARY 3 1
PRIMARY 3 0
SET @saved_use_secondary_engine = @@use_secondary_engine;
SET use_secondary_engine = OFF;
EXECUTE ps;
Expand All @@ -1336,7 +1333,7 @@ SELECT execution_engine, count_execute, count_secondary
FROM performance_schema.prepared_statements_instances
WHERE statement_name = 'ps';
execution_engine count_execute count_secondary
SECONDARY 4 2
PRIMARY 4 0
SET @saved_use_secondary_engine = @@use_secondary_engine;
SET use_secondary_engine = FORCED;
EXECUTE ps;
Expand All @@ -1358,7 +1355,7 @@ SELECT execution_engine, count_execute, count_secondary
FROM performance_schema.prepared_statements_instances
WHERE statement_name = 'ps';
execution_engine count_execute count_secondary
SECONDARY 5 3
PRIMARY 5 0
CREATE PROCEDURE p() EXECUTE ps;
CALL p();
x
Expand All @@ -1374,12 +1371,12 @@ SELECT execution_engine, count_execute, count_secondary
FROM performance_schema.prepared_statements_instances
WHERE statement_name = 'ps';
execution_engine count_execute count_secondary
SECONDARY 6 4
PRIMARY 6 0
DROP PREPARE ps;
FLUSH STATUS;
CREATE TABLE tt AS SELECT * FROM t;
SHOW STATUS LIKE 'Select_scan';
Variable_name Value
Select_scan 2
DROP TABLE tt;
DROP TABLE t;
DROP TABLE IF EXISTS tt;
DROP TABLE IF EXISTS t;
Loading

0 comments on commit dfd658d

Please sign in to comment.