Javier Jaramago Fernández
1f063f704d
Fix invalid memory accesses to digests due to concurrent purge
4 years ago
René Cannaò
3b13c7c90e
Merge pull request #3976 from sysown/v2.x-3928
...
Fix isolation level in AWS Aurora
4 years ago
René Cannaò
8344be1abc
Added comment related to aurora_read_replica_read_committed
4 years ago
René Cannaò
5fb0eef19a
Fix isolation level in AWS Aurora
...
If aurora_read_replica_read_committed is set, isolation level is
internally reset so that it will be set again.
This solves the weird behavior in AWS Aurora related to isolation level
as described in
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html#AuroraMySQL.Reference.IsolationLevels
Basically, to change isolation level you must first set
aurora_read_replica_read_committed , and then isolation level
4 years ago
René Cannaò
83ffb729bb
Merge pull request #3946 from sysown/v2.x-3923
...
WIP: Fix 'mysql-auto_increment_delay_multiplex_timeout_ms' - Closes #3923
4 years ago
René Cannaò
8c48b37f2b
Merge pull request #3970 from sysown/v2.x-stmt_execute_conn_status
...
Fix several queries not disabling multiplexing for `STMT_EXECUTE`
4 years ago
René Cannaò
52842f6056
Build on MacOS
...
Removed dependency from installed curl and openssl: now it uses
statically linked ones.
Updated config.guess and config.sub for cityhash and libdaemon
MariaDB client connector uses statically linked libssl and installed
libiconv
DEBUG build uses pthread_threadid_np() instead of syscall(SYS_gettid)
Fixed some variable types.
Enabled the use of jemalloc also for MacOS
Alias mallctl() to je_mallctl()
Removed libre2.a from libproxysql.a
4 years ago
René Cannaò
22eb7d621b
Prevent a crash during shutdown if Cluster is running
...
If ProxySQL Cluster is running and the proxysql instance is shutting
down in a graceful way, Cluster was trying to access already freed
resources causing a crash.
4 years ago
Javier Jaramago Fernández
ac738c27f8
Add crash signal handler for fatal arithmetic errors 'SIGFPE'
4 years ago
Javier Jaramago Fernández
6e5678315d
Fix crashes when number of servers is more than half the value of monitor 'ping|read_only' intervals
4 years ago
Javier Jaramago Fernández
f993402c62
Fix crash when failed 'connection_reset' is tried to be logged
4 years ago
Javier Jaramago Fernández
b7ecc2d268
Fix multiplexing not being disable by cached stmt during 'STMT_EXECUTE'
...
This forces the re-evaluation of the query digest for each
'STMT_EXECUTE' for impossing the required flags over the current
backend 'MySQL_Connection'.
4 years ago
René Cannaò
7d9e2e8e7e
Merge pull request #3969 from sysown/v2.x-ff_max_conns_timeout
...
Fix timeout for `fast_forward` sessions when `max_connections` is reached
4 years ago
René Cannaò
c4dc2162d6
Merge pull request #3952 from sysown/v2.x-digest_rm_terminator
...
Remove final query delimiter ';' from query digests
4 years ago
René Cannaò
71402ef8f9
Merge pull request #3964 from Levence/v2.x
...
fix(issue): ensure that most recent replica_host is treated as master
4 years ago
Javier Jaramago Fernández
5751d71d32
Avoid issuing warning 'Closing unhealthy client connection' when a 'fast_forward' connection closes
4 years ago
Javier Jaramago Fernández
ee48d11b46
Remove comment and call with unused result to 'std::stack::top()'
4 years ago
Javier Jaramago Fernández
990edf0fb7
Fix timeout for 'fast_forward' sessions when 'max_connections' is reached
4 years ago
Javier Jaramago Fernández
4fd3023f9e
Default initialize all members of 'CurrentQuery' in 'MySQL_Session' ctor
4 years ago
Miro Stauder
81f61de6c7
make sure LDAP tables are existing and commited to disk before use
4 years ago
Javier Jaramago Fernández
96de2329d7
Fix behavior for 'ldap-max_db_connections' failing to decrease current used connections
4 years ago
Levi Quinn
0ab0757907
fix(issue): ensure that most recent replica_host is treated as master for #3962
4 years ago
Javier Jaramago Fernández
c46a152a24
Merge branch 'v2.x' of github.com:sysown/proxysql into v2.x-ldap_fixes
4 years ago
René Cannaò
3a590ba481
Increase the maximum value for monitor threads
...
Increase the maximum value for:
- mysql-monitor_threads_min from 16 to 256
- mysql-monitor_threads_max from 256 to 1024
4 years ago
Javier Jaramago Fernández
4a88876ea4
Add warning for 'auto_increment_delay_multiplex_timeout_ms' when set to a low value
4 years ago
Javier Jaramago Fernández
bcc6532d66
Modify previous impl for 'auto_increment_delay_multiplex_timeout_ms' and fix 'connection_delay_multiplex_ms'
...
This commit contains an implementation rework and a fix:
- Impl for 'auto_increment_delay_multiplex_timeout_ms' has been
reworked in favor of reusing 'wait_until' to share logic with
previous 'connection_delay_multiplex_ms' variable.
- Fix previous 'connection_delay_multiplex_ms' behavior preventing
connection retaining when traffic unrelated to target hostgroup is
being received by the session.
4 years ago
Javier Jaramago Fernández
1d1a1b3fb5
Update doc and renamed var for final characters removal in digest 'final_stage' processing
4 years ago
Javier Jaramago Fernández
1b06049c41
Remove final query delimiter ';' from query digests
...
Only the delimiter present at the end of the digest will be removed.
Delimiters found in the middle of the full digest, like in the case of
multi-statements should be preserved.
4 years ago
Javier Jaramago Fernández
dbdfec3494
Add 'ASYNC_IDLE' precondition for connections considered for expiring
...
If any scenario is found in which we may want to consider a non
'ASYNC_IDLE' connection for expiring, this precondition shall be
removed, and checks should be responsible for ensuring 'ASYNC_IDLE'
state in the connection.
4 years ago
Javier Jaramago Fernández
a67db17709
Fix current 'auto_increment_delay_multiplex_timeout_ms' behavior #3923
4 years ago
René Cannaò
cbeece8d4c
Do not generate entries for empty hostgroups in generate_proxysql_internal_session_json()
4 years ago
René Cannaò
301bb09a4d
Merge pull request #3921 from sysown/v2.x-cluster_cmp_checksums
...
WIP: Add checksum computation after fetch to multiple cluster modules
4 years ago
René Cannaò
06bfcbe3bb
Merge pull request #3944 from sysown/v2.x-digest_binary_data
...
Fix invalid invalid processing of escaped string delimiters for digests
4 years ago
René Cannaò
ab141a994a
Reducing the size of shared_st from 72 to 64 bytes
...
That should, hopefully, improve CPU cache affinity
4 years ago
Javier Jaramago Fernández
8997cecf8a
Fix digest processing of escaped string delimiters
4 years ago
René Cannaò
f960a4d9b7
Merge pull request #3903 from sysown/v2.x-tests_220619
...
V2.x tests 220619
4 years ago
René Cannaò
61c6819cca
Merge pull request #3939 from sysown/v2.x-3926
...
Wrong value of NO_BACKSLASH_ESCAPES was sent to client
4 years ago
René Cannaò
4b26dad975
Wrong value of NO_BACKSLASH_ESCAPES was sent to client
...
This is an enhancement of PR #3926 , fixing the typo and
adding the testing for it.
4 years ago
René Cannaò
18c400e90f
Merge pull request #3916 from sysown/v2.x-3749
...
Solve bug #3749 and improve testing
4 years ago
René Cannaò
622b748fdf
Switching autocommit from 0 to 1 drops SAVEPOINTs
...
Another edge case due to MySQL bug https://bugs.mysql.com/bug.php?id=107875
related to autocommit=0 and SAVEPOINT
4 years ago
René Cannaò
f7d8824379
Trying to work around MySQL bug 107875
...
Because of MySQL bug https://bugs.mysql.com/bug.php?id=107875 ,
autocommit=0 can "create a transaction" even if SERVER_STATUS_IN_TRANS
is not set. This means that a SAVEPOINT can be created in a "transaction"
created with autocommit=0 but without SERVER_STATUS_IN_TRANS .
This commit takes also care of scenarios when autocommit=0 was switched back
to autocommit=1 when a SELECT was executed while variable
mysql-enforce_autocommit_on_reads was false.
MySQL_Session::NumActiveTransactions() now accepts a flag to check
for savepoints.
4 years ago
Javier Jaramago Fernández
fbd6312239
Filter 'OFFLINE_HARD' servers for stored 'runtime_mysql_servers' resultset
4 years ago
Javier Jaramago Fernández
d8429ca71c
Replace resultset for Cluster request fetching 'runtime_mysql_servers'
...
Query 'CLUSTER_QUERY_MYSQL_SERVERS' is now responded by 'runtime_mysql_servers'
as it previously was. Documentation reasoning about the change has been added
to 'MySQL_HostGroups_Manager::runtime_mysql_servers'.
4 years ago
Javier Jaramago Fernández
7a0a83bb20
Fix compilation adding constructor for 'incoming_servers_t'
...
A constructor is required to overcome C++11 limitation of type
no longer being an aggregate due to default member initialization.
4 years ago
Javier Jaramago Fernández
b2cf36429a
Add 'computed checksum' info messages before performing pulling actions in Cluster
4 years ago
Javier Jaramago Fernández
2e594bd6b1
Replace space in ProxySQL version Enterprise identifier in favor of dash
4 years ago
Javier Jaramago Fernández
bf1d70aa28
Fix memory leaks in 'Query_Processor' for Query Rules 'attributes' and 'comment' fields
4 years ago
Javier Jaramago Fernández
b34100ceec
Fix memory leaks for 'username' and 'password' credentials in cluster 'pull' actions
4 years ago
Javier Jaramago Fernández
c46a805c70
Fix memory leak for 'Scheduler_Row::filename' field
4 years ago
Javier Jaramago Fernández
97369e59e4
Fix minor typos in metrics descriptions
4 years ago
Javier Jaramago Fernández
099c2a5f06
Cluster: Speedup of processing of MySQL Users and MySQL Servers
...
- Cluster now syncs the server tables via 'incoming_*' tables generated
during 'load_mysql_servers_to_runtime'.
- Cluster now syncs 'mysql_users' table via a resultset generated via
'__refresh_users'.
4 years ago
Javier Jaramago Fernández
3dacb77321
Perform atomic update of Cluster fetched module checksum epochs
4 years ago
René Cannaò
cf029cc63c
Merge pull request #3929 from sysown/v2.x-galera_613
...
Workaround for Galera bug 613
4 years ago
Javier Jaramago Fernández
e6083250b5
Merge branch 'v2.x' of github.com:sysown/proxysql into v2.x-cluster_cmp_checksums
4 years ago
René Cannaò
a60fc1b8b1
Merge pull request #3930 from sysown/v2.x-cluster_time_rules
...
Cluster: Speed up processing of MySQL Query Rules
4 years ago
René Cannaò
1520e727c6
Allow compiling of clickhouse with old compiler
4 years ago
René Cannaò
5e68075edf
Cluster: Speed up processing of MySQL Query Rules
...
Multiple changes:
- Query_Processor stored the resultset of query rules loaded to runtime
(previously this was only for query rules fast routing)
- Admin returns the stored resultset (query rules and fast routing)
when queries by Cluster
- In khash replaced the hashing function from the built-in
__ac_X31_hash_string to CityHash32
- When Cluster is used, it calls load_mysql_query_rules_to_runtime() passing
the resultsets retrieved by the remote peer
- Increased SQLite cache_size to ~50MB: this seems to be a very small optimization
and probably it will be reverted
- pull_mysql_query_rules_from_peer() uses transactions to write
to mysql_query_rules_fast_routing
- (important change) pull_mysql_query_rules_from_peer() verifies the checksum
of MySQL Query ules before loading them to runtime
4 years ago
Miro Stauder
5a65e7150d
fix compiler version detection for CXX17 conditionals
4 years ago
René Cannaò
4ae5a44db1
Workaround for Galera bug 613
...
if:
mysql-reset_connection_algorithm=1 and
mysql-connpoll_reset_queue_length=0
we will not return a connection with connection_quality_level == 1
because we want to run COM_CHANGE_USER
This change was introduced to work around Galera bug
https://github.com/codership/galera/issues/613
4 years ago
René Cannaò
2a5f364fd5
Merge pull request #3888 from sysown/v2.4-clickhouse
...
Upgraded clickhouse-cpp to 2.1.0
4 years ago
Javier Jaramago Fernández
78da12d289
Removed invalid load from disk of 'mysql_ldap_mapping' in 'ProxySQL_Admin::init'
4 years ago
Javier Jaramago Fernández
aca6ab6279
Fix crash during startup due to 'GloClickHouseServer' not being yet initialized
...
An invalid memory access can take place if 'GenericRefreshStatistics' is
called during startup when 'GloClickHouseServer' isn't yet initialized.
4 years ago
Javier Jaramago Fernández
a03bf7c58d
Add LDAP support for 'mysql_users' Cluster checksum computation
4 years ago
Javier Jaramago Fernández
fa887b2dc9
Prevent Cluster sync between nodes with/without 'ldap_auth' plugin loaded
4 years ago
Javier Jaramago Fernández
7286b334d1
Add utility function to convert 'MYSQL_RES' into 'SQLite3_result'
4 years ago
Javier Jaramago Fernández
63e8c57309
Fix invalid memory accesses in Aurora monitoring
...
Invalid memory accesses could take place if no servers can be pinged.
4 years ago
Javier Jaramago Fernández
4119c44160
Fix potential race conditions while generating 'gtid_executed_tables'
4 years ago
Javier Jaramago Fernández
4c4346a710
Add checksum computation after fetch to multiple cluster modules
...
The following cluster modules now compute their expected checksums after fetch:
- mysql_query_rules
- mysql_users
- mysql_servers
- mysql_global_variables
4 years ago
René Cannaò
61b32de42f
Solve bug #3749 and improve testing
...
In MySQL_Connection::IsActiveTransaction:
in the past we were incorrectly checking STATUS_MYSQL_CONNECTION_HAS_SAVEPOINT
and returning true in case there were any savepoint.
Although flag STATUS_MYSQL_CONNECTION_HAS_SAVEPOINT was not reset in
case of no transaction, thus the check was incorrect.
We can ignore STATUS_MYSQL_CONNECTION_HAS_SAVEPOINT for multiplexing
purpose in IsActiveTransaction() because it is also checked
in MultiplexDisabled()
4 years ago
Javier Jaramago Fernández
f30ce31c43
Add a couple of comments at 'ProxySQL_Admin::init'
4 years ago
Javier Jaramago Fernández
894ca75455
Fix a 'one time leak' at 'load_or_update_global_settings' during startup
4 years ago
Javier Jaramago Fernández
611792e500
Add 'deprecate_eof' support for ProxySQL ClickHouse server
4 years ago
Javier Jaramago Fernández
c859dd458c
Add proper mapping to MySQL protocol for several ClickHouse basic types
4 years ago
René Cannaò
0a49b11fef
Emulate SET autocommit in SQLite3 Server
...
SQLite3 Server now also returns the right autocommit flag
4 years ago
René Cannaò
5b43bbf860
Fixed bug in changing listener port at runtime
...
Changing listener port at runtime on more modules (for example Admin
and SQLite3 Server) could cause the incorrect close of the wrong
file descriptor
4 years ago
René Cannaò
a0f603e77b
More code coverage for Clickhouse server
...
Also it includes som minor bug fixes
4 years ago
René Cannaò
32f6ea9556
Adding new TAP test for Clickhouse
...
Also fixed a bug in Clickhouse module if backend was not present.
Changed some code in SQLite3 TAP test to be reused for Clickhouse testing.
4 years ago
René Cannaò
227e045aa4
Improved mysql-init_connect-t.cpp for PMC-10003
...
PMC-10003: Retrieved a resultset while running a simple command using async_send_simple_command() .
async_send_simple_command() is used by ProxySQL to configure the connection, thus it
shouldn't retrieve any resultset.
A common issue for triggering this error is to have configure mysql-init_connect to
run a statement that returns a resultset.
4 years ago
René Cannaò
cad2d6b113
Removing handler___status_CHANGING_USER_CLIENT___STATE_CLIENT_HANDSHAKE
...
It seems dead code.
4 years ago
René Cannaò
15e007bf30
Merge pull request #3902 from sysown/v2.x_minor_fixes_20220618
...
Minor test fixes
4 years ago
René Cannaò
aeeaaba845
Minor test fixes
...
Same fixes are in commit 1bc48ad in PR #3899
4 years ago
Javier Jaramago Fernández
8aace92b0f
Add several boundary checks preventing invalid memory accesses in 'mysql_query_digest_and_first_comment_2'
4 years ago
Javier Jaramago Fernández
ea7868d59b
Fix buffer overrun when computing 'SQLite3DB' plugin SHA1
4 years ago
Javier Jaramago Fernández
958316df31
Check that plugin module is initialized before calling 'has_variable'
4 years ago
Javier Jaramago Fernández
8affc8c17b
Fail when no 'backend_username' is found for the provided 'ldap_user'
4 years ago
Miro Stauder
e4f822300e
cleanup dead code
4 years ago
Miro Stauder
09933d96e0
unneeded include, breaks ubuntu16
4 years ago
Miro Stauder
f1ff96b346
detect CXX17 and select appropriate clickhouse version to use
4 years ago
root
33dc7daa54
Clickhouse: send NULL as NULL and not string
4 years ago
René Cannaò
630c50051e
Allow compiling without c++17
4 years ago
root
e47cb3fb8f
Upgraded clickhouse-cpp to 2.1.0
...
Clickhouse build are using C++17
4 years ago
René Cannaò
8730fcd350
Merge branch 'v2.x' into v2.x_generate_multi_rows
4 years ago
René Cannaò
542b207611
Added new function to create multirows statements for SQLite also for MySQL_Monitor and ProxySQL_Cluster
4 years ago
Javier Jaramago Fernández
e6ef1ed2a8
Fix conversion computation for 'MySQL_Threads_Handler' status variables metrics
4 years ago
René Cannaò
63da372a58
Merge pull request #3878 from sysown/v2.x-reproducibility-fixes
...
V2.x reproducibility fixes
4 years ago
René Cannaò
05a27c7b70
Merge pull request #3876 from sysown/v2.x-3873
...
Fix integer overflow and range for 'admin-stats_mysql_digest_to_disk' - Closes #3873
4 years ago
Miro Stauder
10dc0b6bff
fix cleanall and related
4 years ago
René Cannaò
c0fdf02b78
Fixed various compiler warnings
4 years ago
Javier Jaramago Fernández
f05ebe3b51
Fix range of 'admin-stats_mysql_digest_to_disk' to match doc #3873
4 years ago
Javier Jaramago Fernández
4cd0774549
Fix 'int' overflow when computing 'next_timer_mysql_query_digest_to_disk' #3873
4 years ago
Miro Stauder
28cb149887
fix version check
...
disabling verifyhost and others for version check
4 years ago
René Cannaò
37695d5c7e
Update copyright year
4 years ago
Miro Stauder
ccf6d9e93f
partialy revert PR#3843
...
reason - feature depends on CA Certificates
4 years ago
René Cannaò
7940d867da
Merge pull request #3867 from sysown/v2.x-multilag
...
Added mysql-monitor_replication_lag_group_by_host
4 years ago
René Cannaò
0a28d9a9f1
Merge pull request #3871 from sysown/v2.x-isolate_monitor_mysql_servers
...
Isolate 'mysql_servers' from 'monitor' into 'monitor_internal' db.
4 years ago
René Cannaò
7a441834dc
Merge pull request #3866 from sysown/v2.x-tokenizer_valgrind_issues
...
Fix valgrind found issues for tokenizer during testing
4 years ago
Javier Jaramago Fernández
5569528b04
Move 'mysql_servers' from 'monitor' db into 'monitor_internal' db
...
- Isolate 'mysql_servers' from 'monitor' into 'monitor_internal' db.
- Make 'monitor_internal' accessible from Admin for debug builds.
4 years ago
--global
5a83b943a3
Fix leak in handling of command 'PROXYSQL INTERNAL SESSION'
4 years ago
René Cannaò
4bfe3e5878
Added mysql-monitor_replication_lag_group_by_host
...
If variable mysql-monitor_replication_lag_group_by_host=false: (default)
Monitor will perform 1 replication lag check per server per hostgroup.
If variable mysql-monitor_replication_lag_group_by_host=true:
Monitor will perform 1 replication lag check per server.
This variable need to be set only in setups in which the same server is
configured in many hostgroups, thus reducing the number of checks
4 years ago
--global
e09f54afca
Merge branch 'v2.x-tokenizer_valgrind_issues' of github.com:sysown/proxysql into v2.x-tokenizer_valgrind_issues
4 years ago
--global
0e8830758b
Fix leak due to duplicate 'strdup' to 'default_schema' in 'dump_all_users'
4 years ago
René Cannaò
8c55b777ee
Fixed various minor bugs detected with valgrind
...
MySQL Monitor was tracking failed connections.
SQLite3 server was:
* executing functions again null string
* writing an error message using an incorrect return code
4 years ago
--global
741b6f2cf0
Fix leak during SSL handshake for SPIFFE authentication
...
Resources allocated by 'SSL_get_peer_certificate' and
'X509_get_ext_d2i' were being leaked during the SSL handshake.
4 years ago
--global
52ea5abfa9
Fix invalid 'write-after-free' reported by ASAN
4 years ago
--global
44d6e48c7b
Fix conditional jumps based on uninitialized memory at 'process_cmnt_type_1'
...
Solved previously left TODOs, removed faulty logic for whitespace
processing for comments using position 'res_cur_pos'. This position
shall not be used because points to yet uninitialized memory, last
position with copied query data should always be 'res_cur_pos-1'.
Because of it, removing the extra logic based on 'res_cur_pos' should be
harmless.
4 years ago
--global
bf14c7034d
Revert "Fix conditional jumps based on uninitialized memory at 'process_cmnt_type_1'"
...
This reverts commit 14fd17a491 .
4 years ago
René Cannaò
9abb82c2a4
Fixed various bugs detected using valgrind
...
* uninitialized variables variables.read_only in Clickhouse
* generate_proxysql_internal_session_json() may try to access variables not set
This commit also prevents watchdog to restart ProxySQL if running under valgrind.
In debug build, the spinning loops also have a minor usleep.
This to prevent valgrind to loop for long time
4 years ago
--global
0e0fc0d116
Remove aggregate init of struct for consistency
4 years ago
--global
14fd17a491
Fix conditional jumps based on uninitialized memory at 'process_cmnt_type_1'
...
Solved previously left TODOs, removing legacy code performing a filtering
and addition of whitespaces while processing comments. This filtering or
addition should be performed during 'stage_1_parsing' main processing
loop if 'query_digests_keep_comment' is 'false' and within
'process_cmnt_type_1' otherwise.
4 years ago
--global
b7a91dfe8d
Fix invalid read at end of allocated buffer for tokenized query
4 years ago
René Cannaò
33cf9855d9
Merge pull request #3815 from sysown/CodeQL
...
CodeQL detected issue fixes
4 years ago
René Cannaò
d23a531e00
Minor sanity checks
4 years ago
Miro Stauder
0c37a63906
Merge branch 'v2.x' into CodeQL
4 years ago
René Cannaò
fa110a4269
MySQL idles thread should not call update_query_processor_stats()
...
This was detected by valgrind
4 years ago
René Cannaò
f9d04422f1
Merge pull request #3855 from sysown/v2.x-3838
...
Properly handle 'EINTR' for signals for RESTAPI - Closes: 3838
4 years ago
René Cannaò
f8a0934c13
Added new function to create multirows statements for SQLite
...
This is now used in ProxySQL_Admin and MySQL_HostGroups_Manager.
It improves readibility and it makes the code less error prone.
Drawback: queries are generated at runtime.
It is possible that in future we will replace this with some strings
initialization during bootstrap.
4 years ago
René Cannaò
ea721ff31b
Merge pull request #3754 from sysown/v2.x-group_replication_consistency
...
Add support for more session variables #3731 #3761 #2702
4 years ago
René Cannaò
27b89b441b
Merge pull request #3857 from sysown/v2.x-compilation_fixes
...
Fix compilation in older GCC versions removing 'auto' usage
4 years ago
René Cannaò
8d2a88a746
Merge pull request #3856 from sysown/v2.x-rm_duplicate_mysql_err_counts
...
Fix duplicate counting of MySQL errors for client conns
4 years ago
René Cannaò
e402b65de1
Merge pull request #3848 from sysown/v2.x-3847
...
Fix deadlock caused by Cluster and Admin and 'proxysql_servers' sync #3847
4 years ago
Javier Jaramago Fernández
55fbef61fa
Fix compilation in older GCC versions removing 'auto' usage
4 years ago
Javier Jaramago Fernández
074e4c0595
Improve error report for RESTAPI scripts #3838
...
Previously any error that wasn't ETIME (timeout) was reported as
'Internal error' and 'errno' was reported. This didn't cover reporting
terminations of the child processes by signals.
4 years ago
Javier Jaramago Fernández
91f5f4392e
Properly handle 'EINTR' for signals for RESTAPI scripts #3838
4 years ago
René Cannaò
f9b6f16beb
Merge pull request #3824 from sysown/v2.x-proxy_msg_stats
...
Add stats capabilities for log messages
4 years ago
René Cannaò
a1246f3348
Merge pull request #3851 from sysown/v2.x-fix-clang-build
...
fix clang builds
4 years ago
Javier Jaramago Fernández
080a84a9c5
Dump 'proxysql_servers' after fetch from peer Cluster node #3847
4 years ago
René Cannaò
9275e2858d
Track NO_BACKSLASH_ESCAPES
...
Track NO_BACKSLASH_ESCAPES in case it is changed:
- using SET sql_mode by the client
- directly on the backend (for example default sql_mode, or an
sql_mode set from another variable)
4 years ago
René Cannaò
50f1c9f61a
Removed reference to STATUS_MYSQL_CONNECTION_NO_BACKSLASH_ESCAPES
...
STATUS_MYSQL_CONNECTION_NO_BACKSLASH_ESCAPES was an internal status in
ProxySQL , now deprecated
4 years ago
René Cannaò
99408f9ad8
Initial POC for fast_forward and SSL #1459
4 years ago
Miro Stauder
d0f51dbe15
fix void pointer arithmetic
4 years ago
Javier Jaramago Fernández
317a370f0b
Fix includes after helper functions moved to 'proxysql_utils.cpp' #3847
4 years ago
Javier Jaramago Fernández
b776304ed7
Fix invalid memory accesses by 'ProxySQL_Node_Entry::set_checksums' #3847
4 years ago
Javier Jaramago Fernández
f2590ff15c
Fix 'proxysql_servers' failing to sync due to mismatching checksums #3847
4 years ago
Javier Jaramago Fernández
c538a8e149
Make 'wexecvp' return child output in case of 'ETIME' #3847
...
Now 'wexecvp' returns child process 'stdout' and 'stderr' in case of
child process timeout.
4 years ago
Javier Jaramago Fernández
807d902d75
Move generic utility functions to 'proxysql_utils.h' #3847
...
Use 'proxysql_utils.h' as an isolated header in which place common
utility functions that can be used from ProxySQL and from outside tests.
4 years ago
Javier Jaramago Fernández
b74797f7b3
Fix deadlock caused by Cluster and Admin #3847
...
A deadlock could take place due to reverse mutex acquisition order by
'GenericRefreshStatistics' and 'load_mysql_variables_to_runtime' when
called by Cluster via 'pull_global_variables_from_peer'.
4 years ago
René Cannaò
af2660c48d
Merge pull request #3836 from sysown/v2.x-backend_conn_ping
...
Fix idle backend connections not getting properly pinged
4 years ago
Javier Jaramago Fernández
68baa871be
Fix duplicate counting of MySQL errors for client conns
4 years ago
Javier Jaramago Fernández
b5f92fd0d9
Optimize 'oldest_idle_connections' map insert/erase operations
4 years ago
René Cannaò
4e7d59bd40
Merge pull request #3843 from sysown/v2.x-harden_version_check
...
Security - harden version check
4 years ago
René Cannaò
6ea642fc55
Merge pull request #3798 from sysown/v2.x-3797
...
Closes #3797 : Monitoring not working properly for AWS aurora auto-discovered servers
4 years ago
René Cannaò
308626ff30
Merge pull request #3817 from sysown/v2.x-binlog_ci_changes
...
Add 'proxysql_mysqlbinlog' test and fixes
4 years ago
René Cannaò
cbabdf6b7b
Merge pull request #3820 from sysown/v2.x-spiffe_regex_support
...
Add regex support for 'spiffe_id' user attribute
4 years ago
René Cannaò
20446ebae7
Merge pull request #3826 from bpmdoty/v2.x
...
Don't intercept SELECT CONNECTION_ID() as COM_STMT_PREPARE
4 years ago
René Cannaò
3245cf292d
Merge pull request #3834 from saunderst/fix-ssl_p2s_capath-typo-in-refresh_variables
...
Fix ssl_p2s_capath typo in MySQL_Thread::refresh_variables()
4 years ago
René Cannaò
513ab0f9ea
Merge pull request #3839 from sysown/v2.x-delay_multiplex_timeout
...
Add new variable 'mysql-auto_increment_delay_multiplex_timeout_ms'
4 years ago
Miro Stauder
182bc6ca62
explicitly set CURLOPT_SSL_VERIFY* and CURLOPT_RANGE
4 years ago
Javier Jaramago Fernández
da5291ee5e
Add new variable 'mysql-auto_increment_delay_multiplex_timeout_ms'
4 years ago
Javier Jaramago Fernández
1bbe0698d2
Fix idle backend connection ordering and selection for keep-alive ping
4 years ago
Thomas Saunders
1e496246fc
fix ssl_p2s_capath typo in MySQL_Thread::refresh_variables
4 years ago
René Cannaò
b9c6f6e33b
Merge pull request #3790 from sysown/v2.x-prom_cluster_metrics
...
Add new metrics exporting several cluster tables
4 years ago
Mike Doty
565799b92b
Update conditional to check speifically for COM_QUERY instead of specifically ignoring COM_STMT_PREPARE. Add conditional to SELECT LAST_INSERT_ID(), SELECT LAST_INSERT_ID() LIMIT 1, SELECT @@IDENTITY, SELECT @@IDENTITY LIMIT 1 intercepts.
4 years ago
Javier Jaramago Fernández
fd968f4b02
Create new message code 'PCM-10002' for 'Unable to parse query' error
4 years ago
Javier Jaramago Fernández
ca7f5ea91f
Create new message code 'PCM-10001' for 'Unexpected packet from client' error
4 years ago
Javier Jaramago Fernández
543bb93e23
Add stats capabilities to log messages
...
- Add new version of macros proxy_error|proxy_warning|proxy_info.
- Add new tables 'stats_proxysql_message_metrics' and
'stats_proxysql_message_metrics_reset'.
- Add new prometheus metric family 'proxysql_message_count_total'.
4 years ago
Mike Doty
a5b020a5b2
Do not intercept COM_STMT_PREPARE packets for SELECT CONNECTION_ID()
...
Hopefully this fixes issue #2564 .
4 years ago
René Cannaò
06ee994ac7
Check attributes in debug_spiffe_id
4 years ago
Javier Jaramago Fernández
00aba4de7a
Add missing includes for 're2' library
4 years ago
Javier Jaramago Fernández
27f6873c7f
Add regex support for 'spiffe_id' user attribute
4 years ago
Miro Stauder
37e874daa8
revert f0272d5 - fail on empty git describe
4 years ago
Javier Jaramago Fernández
198dee43b9
Improve error message when no viable server is found due to GTID waiting
4 years ago
Javier Jaramago Fernández
199ec5bc0a
Prevent GTID connector creation for 'OFFLINE_HARD' servers
4 years ago
Javier Jaramago Fernández
b2cfb4eea9
Fix crash when 'gtid_executed' is empty
4 years ago
Miro Stauder
e84dc7ed0e
fix CodeQL alerts
4 years ago
Miro Stauder
f0272d58d4
avoid fail on empty git describe
4 years ago
Javier Jaramago Fernández
712c081640
Add extra logging when no servers are available in hostgroup
4 years ago
Javier Jaramago Fernández
c7eda1d49d
Add missing delete when updating 'mysql_servers_to_monitor' resulset #3797
4 years ago
Javier Jaramago Fernández
9e7afd4966
Access 'Monitor::mysql_servers_mutex' through 'GloMyMon' instead of 'this' #3797
4 years ago
Javier Jaramago Fernández
ba505284a6
Add missing 'Monitor::mysql_servers_mutex' initialization #3797
4 years ago
Javier Jaramago Fernández
c50a7053ad
Fix monitoring not working for AWS Aurora auto-discovered instances #3797
...
- Monitoring actions 'ping' and 'connect' now make use of a new
introduced table 'monitor.mysql_servers' instead of 'mysql_servers'
table from Admin.
- This table is kept in sync via a shared resulset in
'MySQL_HostGroups_Manager'.
4 years ago
René Cannaò
ea3a60c9ae
Merge pull request #3783 from sysown/v2.x-query_digest_preserve_comment
...
Add new variable 'mysql-query_digests_keep_comment'
4 years ago
Javier Jaramago Fernández
a10cb49cca
Remove deprecated variable 'mysql-client_multi_statements'
4 years ago
Javier Jaramago Fernández
02915a9eae
Remove deprecated variable 'mysql-client_found_rows'
4 years ago
Javier Jaramago Fernández
4452faa037
Add missing newline char at end of 'SSL is required' error message
4 years ago
Javier Jaramago Fernández
8956b672f4
Remove 'admin_mysql_ifaces' from metrics labels for 'proxysql_servers_clients_status'
4 years ago
René Cannaò
b5bdb47dae
Add support for wsrep_osu_method
4 years ago
Javier Jaramago Fernández
0e0cacddf6
Improve missings servers keys filtering for 'p_update_connection_pool'
4 years ago
Javier Jaramago Fernández
6d59956b5f
Change conn_pool metrics update functions to use 'const refs'
4 years ago
Javier Jaramago Fernández
5ed8bd5517
Add new metrics for 'proxysql_servers_checksum' and 'proxysql_servers_metrics'
4 years ago
Javier Jaramago Fernández
3e906acc04
Add new metric 'proxysql_servers_clients_status_last_seen_at'
4 years ago
Javier Jaramago Fernández
53dfb4d7e3
Fix formatting of 'query_digests_keep_comment' variable added to 'get_variables_list'
4 years ago
Javier Jaramago Fernández
3ca605055c
Zero return buffer end pos for DEBUG for 'mysql_query_digest_and_first_comment_2'
...
Helps to simplify debugging if logging is added and ASAN is enabled
4 years ago
Javier Jaramago Fernández
7d1bd5a759
Delete old comment in 'process_literal_digit'
4 years ago
Javier Jaramago Fernández
35ad2f68c2
Implement new variable 'mysql-query_digests_keep_comment'
4 years ago
René Cannaò
25fc1def8e
Fixed a buffer overflow in new variables
4 years ago
René Cannaò
7dc82cd1bb
Merge pull request #3774 from sysown/v2.x-test_unshun_failures
...
Fix test 'test_unshun_algorithm-t' and variable 'mysql-connect_retries_delay'
4 years ago
Javier Jaramago Fernández
01a6e1c9bf
Add new prometheus metric 'proxysql_version_info' #3483
4 years ago
René Cannaò
fd05b37762
Added support for more session variables:
...
- aurora_read_replica_read_committed
- group_replication_consistency
- query_cache_type
4 years ago
Javier Jaramago Fernández
3a19f717ac
Fix 'mysql-connect_retries_delay' not being honored
4 years ago
Javier Jaramago Fernández
b24459cd9a
Remove extra logging info for troubleshooting SHUNNING errors
4 years ago
Javier Jaramago Fernández
c3c1a50d91
Add extra logging info for troubleshooting SHUNNING errors
4 years ago
René Cannaò
ae80989638
Merge pull request #3305 from sysown/v2.1.2-cluster
...
Cluster improvements
4 years ago
René Cannaò
43c6acb218
Merge branch 'v2.x' into v2.1.2-cluster
4 years ago
René Cannaò
3ae299cb97
Add more verbosity for TAP test_unshun_algorithm-t
4 years ago
René Cannaò
4bfe674064
Merge branch 'v2.x' into v2.x-3504
4 years ago
René Cannaò
09a1388750
Merge pull request #3766 from sysown/v2.x-3765
...
Closes #3765 : POLLOUT incorrectly set due OpenSSL 3.0 update
4 years ago
René Cannaò
db8275a66d
Merge branch 'v2.x' into v2.x-3504
4 years ago
Javier Jaramago Fernández
b528bc9b4f
Fixed typo in 'bio_st' struct doc #3765
4 years ago
Javier Jaramago Fernández
9dad81c4b2
Update 'bio_st' OpenSSL internal struct definition to match library #3765
4 years ago
Javier Jaramago Fernández
c51d78c10b
Fix 'create_new_connection' annotation failure due to thread-local connection pool
...
A thread local connection should be retrieved only if 'fast_forward' is
disabled AND 'create_new_connection' wasn't present in the query.
4 years ago
Javier Jaramago Fernández
06c7c56f4f
Fix issues with 'fast_forward' and 'DEPRECATE_EOF'
...
'DEPRECATE_EOF' support wasn't properly tracked in
'server_capabilities'. Because this property is used for setting
'DEPRECATE_EOF' in 'client_flags' options for backend connections when
'fast_forward' is used, a mismatch between a client and a backend
connection could take place.
4 years ago
René Cannaò
d20683c589
Merge pull request #3702 from sysown/v2.x-variables
...
Improvements on how MySQL variables are processed
4 years ago
René Cannaò
ba929e2851
Improved handling of sql_big_selects variable
4 years ago
René Cannaò
8d83bd3562
Merge branch 'v2.x' into v2.1.2-cluster
4 years ago
René Cannaò
9f264fcf1d
In Cluster pull_mysql_servers_from_peer() lock mysql_servers only if mysql servers tables are going to be written.
...
Before this commit we were calling GloAdmin->mysql_servers_wrlock() at the
beginning of the synchronization.
This was not ideal as we should call GloAdmin->mysql_servers_wrlock() only
if we are really going to write the tables. In other words, only if the
resultsets are fetched from the remote peer, and if their checksums didn't
change in the meantime.
4 years ago
René Cannaò
8afbadaaef
In c_tokenizer replace initializer list with simple memset
4 years ago
René Cannaò
a7d1dc5b5c
Rename c_tokenizer.c to c_tokenizer.cpp
...
Now all code is in C++ files anf only C++ compiler will be used
4 years ago
Miro Stauder
118e58dd7e
rename variable
4 years ago
Miro Stauder
fbd3eade83
add -std=c11 flag
4 years ago
René Cannaò
d03c823805
Merge pull request #3748 from sysown/v2.x-PtrArray_refact
...
Changed variables order in PtrSizeArray/PtrArray
4 years ago
René Cannaò
66b30806a5
Removing a comment
4 years ago
René Cannaò
630124b774
Minor improvement for cache affinity
4 years ago
René Cannaò
cb34b82c3a
Merge pull request #3680 from sysown/v2.x-fixes_for_query_diggest_issues
...
Several fixes for parsing issues in `mysql_query_digest_and_first_comment`
4 years ago
Javier Jaramago Fernández
77a114ebc8
Fixed 'stats_mysql_client_host_cache/_reset' table definitions with extra spaces for formatting #3734
4 years ago
Javier Jaramago Fernández
48261edf59
Field 'last_updated' from 'stats_mysql_query_digest' is now reported in seconds #3734
4 years ago
René Cannaò
e983fc6827
Adding support for more MySQL variables
...
New variables supported:
- lc_messages
- lc_time_names
- long_query_time
- max_execution_time
- max_heap_table_size
- max_sort_length
- optimizer_prune_level
- optimizer_search_depth
- optimizer_switch
- sort_buffer_size
- sql_big_selects
- timestamp
- tmp_table_size
Note: sql_big_selects is still not fully supported when
combined with max_join_size.
In set testing TAP ,set large max_execution_time.
If max_execution_time is too small, the TAP test may fails because the
queries will timeout.
4 years ago
René Cannaò
9ee636395d
Remove poor optimization to disable wsrep_sync_wait #3723
...
Fix inappropriate optimization in detecting backend version
and handling of wsrep_sync_wait
4 years ago
René Cannaò
00916441b9
Admin support for SELECT current_user() and user()
...
Admin now replies to SELECT current_user()
and SELECT user()
see https://github.com/sysown/proxysql/issues/1105#issuecomment-990940585
4 years ago
René Cannaò
2ba9c401f1
Bug fixes in the new implementation of tracking mysql variables
...
Better parsing of SET SQL_LOG_BIN .
SQL_LOG_BIN is now managed by the same functions that handle boolean variables
instead of the now deprecated MySQL_Session::handler_WCD_SS_MCQ_qpo_Parse_SQL_LOG_BIN()
For naming convention, enum value SQL_LOG_BIN was renamed to SQL_SQL_LOG_BIN
In MySQL_Thread we also deprecated match_regexes[0] , previously
used to parse `set sql_log_bin`.
Functions Variable::fill_server_internal_session() and
Variable::fill_client_internal_session() seems to handle sql_log_bin as a
special value. This exception was removed.
Fixed a bug in MySQL_Session::generate_proxysql_internal_session_json() where
when backend variables needed to be generated, fill_client_internal_session()
was incorrectly called instead of fill_server_internal_session() , leading to
incorrect values reported by `PROXYSQL INTERNAL SESSION`
4 years ago
René Cannaò
e0e149d9b2
Merge pull request #3710 from sysown/v2.x-3690
...
Fixed invalid handling of large packets for Admin - Closes #3690
4 years ago
Javier Jaramago Fernández
da8d343051
Fixed 'user_attributes' not being preserved during 'COM_CHANGE_USER' #2021
4 years ago
Javier Jaramago Fernández
8cd505bde6
Added support for 'COM_RESET_CONNECTION' #2021
4 years ago
Javier Jaramago Fernández
bcb009fc24
Revert "Merge pull request #3645 from sysown/v2.x-2021"
...
This reverts commit 9561cb3ef2 , reversing
changes made to 7edfec6f3f .
4 years ago
Javier Jaramago Fernández
88dc295781
Fixed invalid handling of large packets in 'SQLite3_to_MySQL' function #3690
...
- Provided a new function to partially initialize 'MySQL_ResultSet'.
- Replaced 'generate_pkt_row' in favor of 'generate_pkt_row3' for
resulset writing.
4 years ago
Javier Jaramago Fernández
0c7934aab8
Replaced 'mysql_query_digest_and_first_comment' with new implementation 'mysql_query_digest_and_first_comment_2'
4 years ago
Javier Jaramago Fernández
81ebfef917
Removed unused 'cmnt_type_1_st' parameter for 'process_cmnt_type_3' and 'process_cmnt_type_2'
4 years ago
Javier Jaramago Fernández
617f916479
Several improvements for 'mysql_query_digest_and_first_comment_2' implementation
...
* Added missing documentation, including stages implementation
reasoning.
* Refactored common stages operations into isolated functions.
* Fixed issue with operator collapsing for 'stage 2'.
* Fixed compression edge cases founds with latest testing.
4 years ago
Javier Jaramago Fernández
78d4776f68
Ported NULL termination added to new implementation of 'query_digest_and_first_comment' into old one
4 years ago
Javier Jaramago Fernández
291a254056
Fixed checking for boundary checks when copying 'cmd' comments to digest result buffer
4 years ago
René Cannaò
ff05b5fd3c
MYSQL_COM_STATISTICS was displaying wrong number of slow queries
...
In MYSQL_COM_STATISTICS , the number of slow queries was incorrectly set to
the number of queries.
4 years ago
René Cannaò
497ef76478
Merge branch 'v2.x' into v2.x-variables
4 years ago
René Cannaò
d335bfb899
Improvements on how MySQL variables are processed
...
Deprecated variables:
- net_write_timeout
Renamed set_testing-t.csv to set_testing-t.csv.obsolete , and removed net_write_timeout from set_testing-t.csv
Variables added to ignore list:
- net_write_timeout
- net_buffer_length
- read_buffer_size
- read_rnd_buffer_size
Added support for quoting with backtick
Renamed `enum variable_name` into `enum mysql_variable_name` for better readibility
`enum mysql_variable_name` has variable names alphabetically ordered after SQL_NAME_LAST_LOW_WM
`mysql_tracked_variables` has variable names alphabetically ordered after SQL_NAME_LAST_LOW_WM
A lot of new variables added in `mysql_tracked_variables` , although not all tracked yet (TODO)
In `MySQL_Variables::MySQL_Variables()`:
- if `internal_variable_name` in `mysql_tracked_variables` is NULL , it will be automatically initialized
- it performs some sanity check between `enum mysql_variable_name` and `mysql_tracked_variables`
Testing:
- refactored code in set_testing-t.cpp and set_testing-multi-t.cpp
- added set_testing-240-t.cpp to test improvements in 2.4.0
- generate_set_session_csv to automatically create set_testing-240.csv used by set_testing-240-t
4 years ago
René Cannaò
6485d1549d
Merge pull request #3700 from sysown/v2.x-multiple_port_delay
...
Speed up start time with multiple listeners #3699
4 years ago
Javier Jaramago Fernández
3e34b603fc
Multiple improvements to stage parsing for new 'mysql_query_digest_and_first_comment_2'
...
+ Improved stage parsing to get the maximum compression from the maximum
digest size imposed by 'mysql_thread___query_digests_max_query_length'.
+ Homogenized staging API and improved offset computation between
stages.
+ Improved documentation (WIP).
+ Simplified literal parsing logic for some states of stage 1 parsing.
4 years ago
Jared Jetsel
111117bbc8
Merge branch 'v2.x-3674' of https://github.com/jaredev/proxysql into v2.x-3674
4 years ago
Jared Jetsel
962116f1b6
Fixed typo, memory leak, and documentation.
...
* Fixed typo for variable_id in history_mysql_status_variables table definition to be INT NOT NULL as intended.
* Added comments before debug ifdefs to explain their purpose
* Optimized get_variable_id_for_name by performing one less search by using iterator insteaed of knows_variable_name() call.
* Fixed memory leak by deleting resultset before return in lambda.
4 years ago
René Cannaò
b59467371a
Merge branch 'v2.x' into v2.x-3674
4 years ago
René Cannaò
33fba7641a
Speed up start time with multiple listeners #3699
...
When multiple listeners are configured start up time is slow.
This commit batches together the configuration of all the listeners.
4 years ago
René Cannaò
e892413d1a
Merge branch 'v2.x' into v2.x-2021
4 years ago
René Cannaò
7edfec6f3f
Merge pull request #3657 from sysown/v2.x-3655
...
Fixed crashes when `mysql-query_digests` is `false` - Closes #3655
4 years ago
René Cannaò
698031eb7a
Merge pull request #3676 from sysown/v2.x-3592
...
Added new metric 'proxysql_fds_in_use' exposing number of file descriptors in use - Closes #3592
4 years ago
René Cannaò
aed1f205d4
Merge branch 'v2.x' into v2.x-3655
4 years ago
René Cannaò
a6edd02a9b
Revert "Merge branch 'v2.x' into v2.x-2021"
...
This reverts commit 3a3931f2d4 , reversing
changes made to 4694ab775e .
4 years ago
René Cannaò
3a3931f2d4
Merge branch 'v2.x' into v2.x-2021
4 years ago
René Cannaò
22ed00e2f7
Merge pull request #3652 from sysown/v2.x-3606
...
Fixes MySQL warnings are returned as results of the next executed query - Closes #3606
4 years ago
René Cannaò
8cea730de0
Merge pull request #3661 from sysown/v2.x-3649
...
Allow to unshun a server from all hostgroups
4 years ago
Javier Jaramago Fernández
0426c49b77
Added digit replacement to second stage parsing, also added support for grouping and groups grouping
5 years ago
Javier Jaramago Fernández
82e5cb5c7c
Introduced 'NULL' replacing in the staging impl, changed variable name and some functions params order
5 years ago
Javier Jaramago Fernández
adee2655de
Improved float parsing moving parsing logic into 'is_digit_string' instead of skipping characters copy
5 years ago
René Cannaò
ab3f9bcedc
PROXYSQLTEST 51 and 52 on debug build only
5 years ago
René Cannaò
79d1d8742c
Testing unbalanced weight
5 years ago
Javier Jaramago Fernández
c26d1a5034
Added new functions 'mysql_query_digest_and_first_comment_2' and 'mysql_query_digest_and_first_comment_one_it' as part of query digests rework
5 years ago
Javier Jaramago Fernández
141086cc9c
Added missing case of space removal before literals for 'mysql_query_digest_and_first_comment'
5 years ago
Javier Jaramago Fernández
45b557ccfd
Added handy comments to original 'mysql_query_digest_and_first_comment' implementation
5 years ago
Javier Jaramago Fernández
1c1b29b1f0
Added size check and added space removal after opening parenthesis when followed by number
5 years ago
Javier Jaramago Fernández
aa09e86ca4
Store previous character as ending delimiter found for string literal
5 years ago
Javier Jaramago Fernández
20347b1e8e
Removed extra spaces before NULL values when 'query_digests_replace_null=1'
5 years ago
Javier Jaramago Fernández
c6249d4715
Added removal of extra space before closing parenthesis when previous char has been replaced
5 years ago
Javier Jaramago Fernández
7e41e793d9
Avoiding comma copy when 'groping_limit' is exceeded replaced in favor of deletion for avoiding unnecessary removals
5 years ago
Jared Jetsel
910a626652
Fixed error messages
...
Added new lines for the proxy_error() calls, and following similar convention as others, fixed a typo, and type conversion.
5 years ago
Jared Jetsel
d114dbe3a3
Const strings where appropriate and improved test for statistics
...
Changed the get_variable_id_for_name, and knows_variable_name to use const string &. Changed immutable strings to to be const as well. Added details comment to test_admin_stats-t.cpp test. In the test code, improved documentation, set a valid interval for metrics insertion, and added the commands to set the interval. Changed the sleep time to be the inteval plus a second should be long enough to let new metrics data be added. Put additional sleep before test 2. Fixed incorrect column index usage in test 4 result set. Reformulated test 5, to check the number of records inserted after new interval is correct.
5 years ago
Javier Jaramago Fernández
c91db18c05
Several fixes for parsing issues in 'mysql_query_digest_and_first_comment'
5 years ago
Jared Jetsel
0ef478e597
In debug mode, the handlers for ProxySQL_Statistics are called even if the web interface plugin is not loaded. This way the code can be tested even if the plugin is not loaded. Added new member function ProxySQL_Statistics::knows_variable_name(), which is used to check if a variable_name is in the map. This is useful to do a check before get_variable_id_for_name() in instances where it is undesirable to load or create entries in the lookup table, while keeping direct access to the map private and mutex protected. In ProxySQL_Statistics::get_variable_id_for_name, wrapped the variable_id select code in a lambda so that it could be reused instead of calling sqlite3_last_insert_rowid(), as there were some thread safety concerns which potentially could produce incorrect ids. Changed the insert to use execute() instead of execute_statement() instead, sufficient and simpler. Added error in case the function could not find, load, or generate a new id.
5 years ago
Jared Jetsel
1adaf74170
Modified ProxySQL_Statistics to have two new member functions and two new private members. These are used to map the string variable_name to an integer variable_id to improve scalability. See documentation about their usage. Updated the MySQL_Threads_Hander_sets_v2 function to load the variable_name_id_map if it is empty for initial load from the lookup table. The prepared statement binds was changed to use the int64 variable_id retreived from the map.
5 years ago
Jared Jetsel
d644f13780
Updated the SQLite history_mysql_status_variables create table statement to use variable_id instead of name for improved scalability. Added an index for the sql_status_variables table. Added lookup table create statement for history_mysql_status_variables_lookup table to refer the variable_id integer key to the variable_name string. Inserted the new table definition and execute code for the create index that were added. As the code has not yet received public release, there is no concern of keeping the previous table definition, and so the version number refers to v2.4.0.
5 years ago
René Cannaò
5efb1dd020
Merge pull request #3664 from VinaySagarGonabavi/u/gonabavi/using_transaction_isolation_should_not_disable_multiplexing
...
Add transaction_isolation to the list of hardcoded session variables that do not disable ProxySQL multiplexing Fixes sysown/proxysql#3663
5 years ago
Javier Jaramago Fernández
d0ed1895fa
Fixed typo in 'round_intv_to_time_interval' preventing parameter update
5 years ago
Javier Jaramago Fernández
545f5c5a29
Fixed typos found in 'th_metrics_map' definition
5 years ago
Javier Jaramago Fernández
71a1f64f2d
Added new metric 'proxysql_fds_in_use' reporting the current number of file descriptors in use #3592
5 years ago
René Cannaò
9293dea199
Do not shun backend for error 3118
...
Error: Access denied for user '%s'. Account is locked..
5 years ago
Javier Jaramago Fernández
6a92cc9238
Added new command 'PROXYSQL_SIMULATOR' with support for simulating connection errors #3649
5 years ago
Javier Jaramago Fernández
4838d75cd3
Added new mysql variable 'mysql-unshun_algorithm' #3649
5 years ago
Vinay Sagar Gonabavi
5bd42079f7
Add transaction_isolation to the list of hardcoded session variables that do not disable ProxySQL multiplexing
5 years ago
Javier Jaramago Fernández
dc4bf3ccce
Added 'schemaname' to userinfo for 'PROXYSQL INTERNAL SESSION' command #3655
5 years ago
René Cannaò
4b04332473
Add optional mutex in MySrvC::connect_error()
5 years ago
René Cannaò
7ef783487c
Adding skeleton for PROXYSQL_SIMULATOR
5 years ago
René Cannaò
a752292b9e
Added function unshun_server_all_hostgroups()
...
MySQL_HostGroups_Manager::unshun_server_all_hostgroups() scans all hostgroups
looking for a specific server, and if shunned it will bring it back online
5 years ago
René Cannaò
b150313ef8
Merge pull request #3658 from sysown/v2.x-asan_ci_run
...
Fixed several issues discovered while testing ASAN CI run
5 years ago
Javier Jaramago Fernández
86e5caf6ea
Fixed handling of splitted packets during 'CONNECTING_SERVER' state for 'FAST_FORWARD' mode
5 years ago
René Cannaò
d1e70578ba
Adding support links to proxysql.com
5 years ago
Javier Jaramago Fernández
062381efd4
Fixed crashes in 'MySQL_Session::get_pkts_from_client' when 'mysql-query_digests' are disabled #3655
5 years ago
Javier Jaramago Fernández
3fd1cd3f13
Replaced non-thread safe 'strtok' function in favor of 'strtok_r' for 'IsKeepMultiplexEnabledVariables'
5 years ago
Javier Jaramago Fernández
a49433cc91
Manually set 'POLLOUT' event for 'SHOW_WARNINGS' session status to ensure sending by 'MySQL_Connection' #3606
5 years ago
Javier Jaramago Fernández
4312cd9a72
Moved session cleanup after error report for 'SHOW_WARNINGS' #3606
5 years ago
Javier Jaramago Fernández
c3d0ecd84f
Improved implementation of 'mysql-log_mysql_warnings_enabled' #3606
5 years ago
Javier Jaramago Fernández
cbe926b4f7
Fix regression introduced for 'at signs' parsing for multiplexing disabling ( #3647 )
...
* Fixed regression introduced for 'at-signs' parsing and improved implementation
* Added minimal test for checking multiplexing disabling via 'mysql-keep_multiplexing_variables'
* Added missing 'plan()' to test specifying the number of test cases
5 years ago
Javier Jaramago Fernández
9829c6d37b
Fixes crashes related with 'client_error_limit' and connection timeouts ( #3646 )
...
* Added missing check to 'update_client_host_cache' in case cache elem is not found
* Added check to avoid calling 'update_client_host_cache' when 'host_cache_size' is zero
* Improved implementation and enabled 'test_client_limit_error-t' for CI
* Added extra check using 'client_host_cache_size' to prevent searchs if size is zero
* Restored currently unused testing scripts for creating/deleting network namespaces
5 years ago
Javier Jaramago Fernández
27b72884d1
Fixed 'user_attributes' not being preserved during 'COM_CHANGE_USER' #2021
5 years ago
Javier Jaramago Fernández
e76882c2f9
Added support for 'COM_RESET_CONNECTION' #2021
5 years ago
René Cannaò
fb8857f1fe
Fix a bug in get_multiple_idle_connections() #3628
...
2.3.0 introduces a bug that prevents proxysql to run ping on backend
connections to keep them alive.
5 years ago
Javier Jaramago Fernández
8e529055c3
Merge branch 'v2.x' of github.com:sysown/proxysql into v2.x-3504
5 years ago
Javier Jaramago Fernández
06c386dfd1
Merge pull request #3626 from sysown/v2.x-3625
...
Fix issues found with 'client error limit' implementation - Closes #3625
5 years ago
Javier Jaramago Fernández
0058ecb4f0
Removed 'flush_error_log' call from 'PROXYSQL FLUSH QUERY CACHE'
5 years ago
Javier Jaramago Fernández
548174d1eb
Condensed asserts for 'find_client_host_cache' and 'update_client_host_cache' into a single line #3625
5 years ago
Javier Jaramago Fernández
515167f5f9
Removed 'flush_error_log' call from 'PROXYSQL FLUSH MYSQL CLIENT HOSTS' #3625
5 years ago
Javier Jaramago Fernández
789ed52f87
Added default zero initialization for all variables from 'MySQL_Threads_Handler::variables' struct #3625
5 years ago
Javier Jaramago Fernández
be0ceed53d
Added missing client address for SQLite3 sessions and added asserts in case it's found 'NULL' in 'client_host_cache' operations #3625
5 years ago
Javier Jaramago Fernández
3a2d3f2d5e
Fixed missing default initialization of varibles 'client_host_cache_size' and 'client_host_error_counts' #3625
5 years ago
Javier Jaramago Fernández
d7bef92b57
Added missing new-line character for access denied 'proxy_error' for 'COM_CHANGE_USER' #3504
5 years ago
Javier Jaramago Fernández
53da63eb99
Improved auth performed for 'COM_CHANGE_USER' with impl from 'process_pkt_handshake_response' #3504
5 years ago
Javier Jaramago Fernández
8e97f5a19c
Merge branch 'v2.x' of github.com:sysown/proxysql into v2.x-3504
5 years ago
Javier Jaramago Fernández
b4c7b9323d
Merge pull request #3621 from sysown/v2.x-3620
...
Fixes memory leaks detected during testing - Closes #3620
5 years ago
Javier Jaramago Fernández
db9b4ad70f
Merge pull request #3617 from sysown/v2.x-client_err_limit
...
Implements feature 'Client Error Limit'
5 years ago
Javier Jaramago Fernández
4f94fd3d0f
Merge pull request #3533 from sysown/v2.x-gr_replication_lag_action
...
Changes current handling for replication lag in favor of setting lagging servers to SHUNNED state
5 years ago
Javier Jaramago Fernández
9aef676973
Added population of 'stats_mysql_client_host_cache' when 'stats_mysql_client_host_cache_reset' is queried
5 years ago
Javier Jaramago Fernández
c268259bde
Fixed memory leak of client received packet when SSL connection is initiated #3620
5 years ago
Javier Jaramago Fernández
36abd62314
Fixed memory leak for 'client_addr' in case of wrong credentials for frontend connection #3620
5 years ago
Javier Jaramago Fernández
d115e20ed4
Fixed size check for 'client_host_cache' and fixed logic preventing the cache from reducing it's size in certain conditions
5 years ago
Javier Jaramago Fernández
416a0470a5
Added tables 'stats_mysql_client_host_cache' and 'stats_mysql_client_host_cache_reset' exposing entries in 'client_host_cache'
5 years ago
Javier Jaramago Fernández
514ffe939a
Fixed double increment in 'update_client_host_cache' when oldest entry is updated
5 years ago
Javier Jaramago Fernández
2d3da0fca3
Simplified check for query 'PROXYSQL FLUSH MYSQL CLIENT HOSTS' via 'strcasecmp'
5 years ago
Javier Jaramago Fernández
e7d9a4c74d
Added extra logging when a connection is closed due to 'client_host_error_counts' being reached
5 years ago
Javier Jaramago Fernández
625daa9cd3
Fixed check for 'client_host' error count and added missing free
5 years ago
Javier Jaramago Fernández
3addb9a194
Improved implementation of helper function 'get_client_addr' using 'handler___status_NONE_or_default' as reference
5 years ago
Javier Jaramago Fernández
6e533cb5d9
Merge branch 'v2.x' of github.com:sysown/proxysql into v2.x-client_err_limit
5 years ago
René Cannaò
3a481ecb89
Removing some printf
5 years ago
René Cannaò
e751dbbf32
Merge pull request #3609 from sysown/v2.x-3591
...
Closes #3591 : RESTAPI interface is unresponsive when ProxySQL has ~1000+ sockets open
5 years ago
René Cannaò
8778df61ee
Merge pull request #3610 from sysown/2.x-3608
...
Reimplemented the handling of comments in 'USE' statements #3493
5 years ago
René Cannaò
b485623d6f
Reimplemented the handling of comments in 'USE' statements #3493
...
This commits partially revert 0dde4adb21
It also improve the TAP test reg_test_3493-USE_with_comment-t.cpp with a
variety of combinations, that helped find a bug in the tokenizer
mysql_query_digest_and_first_comment()
5 years ago
Javier Jaramago Fernández
8091b26f64
Added compilation fix enabling 'EPOLL' support in 'libhttpserver' required by RESTAPI #3591
5 years ago
Javier Jaramago Fernández
0a37981529
Added comments for the fix introduced for #3603
5 years ago
Javier Jaramago Fernández
d81af3faf5
Fixed invalid preservation of old 'NULL' values for previously executed stmt #3603
5 years ago
René Cannaò
42fad778e3
Do not copy MYSQL_TS if length is 0
...
Related to issue #3585
A prepared statement with buffer_type = MYSQL_TYPE_TIME (or similar like
MYSQL_TYPE_DATE, etc) can have length = 0 if the time is 0. In this case
no data needs to be copied from COM_STMT_EXECUTE packet
5 years ago
René Cannaò
0bef2e8149
Correctly bind parameters if new_params_bound_flag is not provided
...
See issue #3585 .
If new-params-bound-flag is not provided by the client while executing
COM_STMT_EXECUTE , proxysql was incorrectly computing the length of
parameters.
The issue was happening only if there were null parameters.
Removing comment
5 years ago
René Cannaò
f7bb4d201b
Add get_current_query_rules_fast_routing_count()
...
Query_Processor::get_current_query_rules_fast_routing_count() now allows to
quickly execute this query is ran on Admin:
SELECT COUNT(*) FROM runtime_mysql_query_rules_fast_routing
5 years ago
René Cannaò
ca10cf0631
Temporary removing all read/write timeout from Cluster
5 years ago
René Cannaò
2ae218f7ed
Cluster: sync of proxysql_servers ensures that checksum is correct
5 years ago
René Cannaò
38c5a76d0e
Use Aurora writer for reads if max_lag_ms isn't specified
...
This solves the issue described in issue #3522
It is a side effect of a mistake in commit 5336e72f1c
5 years ago
René Cannaò
cd7e740a51
Get mutex during LOAD PROXYSQL SERVERS TO RUNTIME
5 years ago
René Cannaò
0c711e1a32
Prevent a crash while syncing proxysql_servers in Cluster
5 years ago
René Cannaò
66c4c6b0a8
Adding new mutex in ProxySQL_Admin::save_proxysql_servers_runtime_to_database()
5 years ago
René Cannaò
45e55d4e90
Removing admin_mutex in ProxySQL_Admin.cpp
...
This mutex was largely deprecated by sql_query_global_mutex .
Its presence now was causing a possibl deadlock.
5 years ago
René Cannaò
e1adc955eb
Fixing some race condition in Cluster
...
Similar to commit f8ce41305d
5 years ago
René Cannaò
48562faaf1
Merge branch 'v2.x' into v2.1.2-cluster
5 years ago
René Cannaò
d0f6ba3503
Merge pull request #3582 from sysown/v2.x-cherry-pick_3305
...
Some cherry pick from PR 3305
5 years ago
René Cannaò
2a5121e52f
Merge pull request #3514 from egezonberisha/pt-heartbeat-query-delay
...
Change the pt-heartbeat query from MIN to MAX due to a possible daisy-chain replication or multi-master setup
5 years ago
René Cannaò
aceeaf79ed
Disabled prometheus metrics dump , see #3571
...
This commit also fixes some minor memory corruptions
5 years ago
René Cannaò
cf33522a25
Commenting unused code
5 years ago
René Cannaò
0da250ec8d
Merge pull request #3491 from csoulios/ldap-auth-changes
...
Clean up LDAP authenticator
5 years ago
René Cannaò
08ea308033
Merge pull request #3552 from sysown/v2.x-ssl_no-rsa
...
Allows SSL privake keys other than RSA , and implement PROXYSQL RELOAD TLS
5 years ago
René Cannaò
dd71fcd81f
Shun "soft" and "hard" in group replication lag
...
When shunning a node due to replication lag in a group replication cluster,
we first shun the node as MYSQL_SERVER_STATUS_SHUNNED , then we shun it
as MYSQL_SERVER_STATUS_SHUNNED_REPLICATION_LAG .
In this way we prevent (for a short time) to kill connections on that backend.
This backing off from that server can give the server enough time to sync up.
See discussion in comments in https://github.com/sysown/proxysql/pull/3533
5 years ago
René Cannaò
ebbd9845bd
Merge branch 'v2.x' into v2.1.2-cluster
5 years ago
René Cannaò
0937133b15
Merge pull request #3577 from hkdsun/capath-crls-v2.x
...
SSL: Add support for certificate revocation list (CRL) and multiple certificate authorities (CA)
5 years ago
René Cannaò
8126c7d037
Fix typo ssl_p2_capath instead of ssl_p2s_capath
5 years ago
René Cannaò
228c0bfd79
Merge branch 'v2.x' into v2.x-3504
5 years ago
Hormoz K
7762dea993
add crl, crlpath, and capath options
5 years ago
René Cannaò
c78539c936
Merge pull request #3576 from sysown/v2.x-connect_verbo
...
Add more verbosity when mysql_real_connect() fails
5 years ago
René Cannaò
dafda29a1a
Merge pull request #3573 from sysown/v2.x-3546
...
Closes #3546 : Frequent ProxySQL crashes since v2.1.x
5 years ago
René Cannaò
05fa6c23cf
Merge pull request #3569 from sysown/v2.x-3554
...
Closes 3554: Add support for building ProxySQL with ASAN
5 years ago
René Cannaò
57f6af7132
Add more verbosity when mysql_real_connect() fails
...
Error log will now shows also the hostgroup id of the server the
connection failed to
5 years ago
René Cannaò
46f75dae3b
Add more verbosity when starting a scheduler job
5 years ago
René Cannaò
f8ce41305d
Fixing some race condition
5 years ago
René Cannaò
5bfbca7f2d
Preserve epoch when synching with ProxySQL Cluster
...
On a large ProxySQL Cluster it was possible that an old configuration reaches
a node (nodeA) later than a new configuration is applied to another node (nodeB).
This has the side affect that nodeB will then believe that nodeA has a newer
configuration, while in reality is an old configuration applied later.
This commit preverves epoch, thus should avoid this problem
5 years ago
René Cannaò
1e9295c13d
Removing a lock introduced in 894e72041
5 years ago
René Cannaò
ea0ca76bd3
Merge branch 'v2.1.2-cluster' of https://github.com/sysown/proxysql into v2.1.2-cluster
5 years ago
René Cannaò
894e72041d
Adding a mutex when Cluster is syncing mysql query rules
5 years ago
Javier Jaramago Fernández
25df228960
Fixed double-free memory corruption due to unitialized memory in prepared statements bind buffers #3546
5 years ago
Javier Jaramago Fernández
fce6cfb8a0
Improved preservation of 'OFFLINE_SOFT' server state during 'group_replication' update actions
5 years ago
René Cannaò
148264cd8b
Disabled prometheus metrics dump , see #3571
...
This commit also fixes some minor memory corruptions
5 years ago
Javier Jaramago Fernández
9f2c8836bc
Fixed removal of servers not belonging to cluster hostgroups by 'group_replication' actions 'set_read_only/set_offline/set_writer'
5 years ago
Javier Jaramago Fernández
fd9f3f13a3
Fixed 'strcat-param-overlap' found by ASAN in 'IsKeepMultiplexEnabledVariables' #3554
5 years ago
Javier Jaramago Fernández
58460bd323
Fixed 'heap-buffer-overflow' detected by ASAN in 'generate_show_fields_from' #3554
5 years ago
Javier Jaramago Fernández
0f8aa299ac
Fixed memory corruption reported by ASAN due to unexpected packet by 'mysqlsh' #3554
5 years ago
René Cannaò
254ee51e8a
Temporary commit for debugging
5 years ago
René Cannaò
bc6d4f2aba
Improve error verbosity in ProxySQL Cluster
5 years ago
Javier Jaramago Fernández
e8cc7be8fd
Added non-blocking calls to 'SSL_shutdown' for sending final 'close_notify' required by SSL standard
5 years ago
Javier Jaramago Fernández
d5de8a52f1
Improved SAN names parsing and client certificate verification when 'SPIFFE' is used
5 years ago
René Cannaò
fcfcb3cac0
Improve error verbosity in ProxySQL Cluster
5 years ago
René Cannaò
1f81892adc
Commenting unused code
5 years ago
René Cannaò
5e422668c8
Removing mysql-threads from cluster sync
...
It also enables monitoring for cluster test
5 years ago
Javier Jaramago Fernández
9d9851d8e6
Added ASAN (AddressSanitizer) compilation support to ProxySQL #3554
5 years ago
René Cannaò
af27c0b108
Merge branch 'v2.x' into v2.1.2-cluster
5 years ago
René Cannaò
3de13665e8
Merge pull request #3557 from sysown/v2.x-ccov2
...
More code coverage
5 years ago
René Cannaò
5203c11bbd
Merge pull request #3560 from sysown/v2.x-3549_v2
...
Closes #3549 : Autocommit tracking being lost when 'locked_on_hostgroup' is set
5 years ago
René Cannaò
2145507c22
If a session is locked on hostgroup , autocommit is copied from backend connection
...
Closes #3459
5 years ago
René Cannaò
538feddc87
Code cleanup
...
Commenting out ProxySQL_Admin::__insert_or_ignore_maintable_select_disktable()
5 years ago
René Cannaò
c4fce91fc5
Change default value of mysql-session_idle_ms from 1000 to 1
...
Not only the default value is change from 1000 to 1 , but it also perform an upgrade from earlier release.
If during bootstrap a value of 1000 is found, it is automatically changed to 1 and a warning is generated.
This release also prevents the value 1000 to be a valid one during bootstrap.
This means that it is still possible to set the value to 1000 and to have a running proxysql instance with value 1000 , but during bootstrap it will be switched to 1.
If you really want to set mysql-session_idle_ms close to 1000 , it is recommended to set it to a closer value like 999 or 1001
5 years ago
René Cannaò
1d5ac70e7b
Adding test to test mysql user fast_forward
...
This commit also fix a bug:
When the session uses fast_forward, frontend and backend connections
must have the same bit for CLIENT_DEPRECATE_EOF
5 years ago
René Cannaò
78f8821215
More code coverage mostly related to Admin
5 years ago
Javier Jaramago Fernández
e2dd0a30cd
Initial implementation for 'client_error_limit'
...
Add initial support for FR limiting the number of connection errors that
can be initiated from a particular address before deniying future
connections from that address. Feature is controlled by new introduced
variables:
- mysql-client_host_error_counts
- mysql-client_host_cache_size
5 years ago
René Cannaò
3d5469fded
Adding LCOV_EXCL_START around exit(EXIT_FAILURE)
5 years ago
René Cannaò
194243503a
Adding LCOV_EXCL_START around assert(0)
...
LCOV_EXCL_START and LCOV_EXCL_STOP around assert(0) will improve code coverage
5 years ago
René Cannaò
8afeb616ed
Added test for connections timeout
...
Added test that verifies that client connections are dropped because of:
- mysql-wait_timeout
- mysql-max_transaction_time
IT also helped finding a bug in how mysql-max_transaction_time was handled
5 years ago
René Cannaò
b912d978b0
Removing or commenting legacy/unused code
5 years ago
René Cannaò
22f2204745
Removed unused code
5 years ago
René Cannaò
6314eab4e3
Merge pull request #3540 from sysown/v2.x-3539
...
Closes #3539 : Replaced manual search for 'MyHGC' in favor of optimized 'MyHGC_find'
5 years ago
René Cannaò
7f0b358ed8
Merge pull request #3544 from sysown/v2.x-3525
...
Closes #3525 : Memory leak induced by 'stmts' not being closed when failed to prepare
5 years ago
René Cannaò
8ea1f16cb7
deprecating session_vars[]
5 years ago
René Cannaò
da2bf094ee
Fixed some minor but important bugs on the new implementation on how session variables are handled
5 years ago
René Cannaò
241a5e54d7
Draft to reimplement how session variables are handled
5 years ago