summaryrefslogtreecommitdiff
path: root/include/mysql/psi/mysql_socket.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.5' into 10.6Oleksandr Byelkin2022-02-031-1/+1
|\
| * Merge branch 'merge-perfschema-5.7' into 10.5Oleksandr Byelkin2022-01-281-1/+1
| |\
| | * 5.7.34Sergei Golubchik2021-05-031-1/+1
| | |
| | * 5.7.28Sergei Golubchik2019-12-111-6/+12
| | |
| | * 5.7.13Sergei Golubchik2016-07-281-11/+105
| | |
* | | MDEV-5536: add systemd socket activationDaniel Black2021-03-281-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Systemd has a socket activation feature where a mariadb.socket definition defines the sockets to listen to, and passes those file descriptors directly to mariadbd to use when a connection occurs. The new functionality is utilized when starting as follows: systemctl start mariadb.socket The mariadb.socket definition only needs to contain the network information, ListenStream= directives, the mariadb.service definition is still used for service instigation. When mariadbd is started in this way, the socket, port, bind-address backlog are all assumed to be self contained in the mariadb.socket definition and as such the mariadb settings and command line arguments of these network settings are ignored. See man systemd.socket for how to limit this to specific ports. Extra ports, those specified with extra_port in socket activation mode, are those with a FileDescriptorName=extra. These need to be in a separate service name like mariadb-extra.socket and these require a Service={mariadb.service} directive to map to the original service. Extra ports need systemd v227 or greater (not RHEL/Centos7 - v219) when FileDescriptorName= was added, otherwise the extra ports are treated like ordinary ports. The number of sockets isn't limited when using systemd socket activation (except by operating system limits on file descriptors and a minimal amount of memory used per file descriptor). The systemd sockets passed can include any ownership or permissions, including those the mariadbd process wouldn't normally have the permission to create. This implementation is compatible with mariadb.service definitions. Those services started with: systemctl start mariadb.service does actually start the mariadb.service and used all the my.cnf settings of sockets and ports like it previously did.
* | | MDEV-6536: make --bind=hostname to listen on both IPv6 and IPv4 addressesRinat Ibragimov2021-03-051-1/+10
|/ / | | | | | | | | | | | | | | | | Binding to a hostname now makes MariaDB server to listen on all addresses that hostname resolves to. Rebased to 10.6 by Daniel Black Closes: #1668
* | Merge 10.4 into 10.5Marko Mäkelä2020-07-151-8/+16
|\ \
| * \ Merge 10.2 into 10.3Marko Mäkelä2020-07-141-8/+16
| |\ \
| | * \ Merge 10.1 into 10.2Marko Mäkelä2020-07-141-8/+16
| | |\ \
| | | * | MDEV-22173: socket accept - test for failureDaniel Black2020-07-061-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accept might return an error, including SOCKET_EAGAIN/ SOCKET_EINTR. The caller, usually handle_connections_sockets can these however and invalid file descriptor isn't something to call fcntl on. Thanks to Etienne Guesnet (ATOS) for diagnosis, sample patch description and testing.
* | | | | P_S 5.7.28Sergei Golubchik2020-03-101-11/+105
| | | | |
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-01-281-6/+12
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-211-6/+12
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-201-6/+12
| | |\ \ \ | | | |/ /
| | | * | Merge branch 'merge-perfschema-5.6' into 10.1Oleksandr Byelkin2020-01-191-6/+12
| | | |\ \
| | | | * | 5.6.47Oleksandr Byelkin2020-01-191-6/+12
| | | | |/
| | | | * 5.6.31Sergei Golubchik2016-06-211-5/+5
| | | | |
| | | | * perfschema 5.6.10 initial commit.Sergei Golubchik2014-05-071-0/+1161
| | | | | | | | | | | | | | | | include/mysql/psi/*
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\ \ | | | |/
| | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | |
* | | | mysql_socket_accept() microoptimisationsSergey Vojtovich2019-05-211-9/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | No need to initialize socket_accept, it always gets assigned a value. Pass addr_len directly to accept(). Part of MDEV-19515 - Improve connect speed
* | | Merge 10.2 into 10.3Marko Mäkelä2018-10-091-2/+2
|\ \ \ | |/ /
| * | MDEV-17373 Windows: application verifier stop "Attempt to use an unknown SOCKET"Vladislav Vaintroub2018-10-051-2/+2
| | |
* | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-0/+6
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-0/+6
| |\ \ | | |/
| | * Merge branch '10.0-galera' into 10.1Vicențiu Ciorbaru2018-06-121-0/+6
| | |\
| | | * MDEV-8743: mysqld port/socket - FD_CLOEXEC if no SOCK_CLOEXECDaniel Black2018-04-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MDEV-8743, the port/socket of mysqld was changed to set FD_CLOEXEC. The existing mysql_socket_socket function already set that with SOCK_CLOEXEC when the socket was created. So here we move the fcntl functionality to the mysql_socket_socket as port/socket are the only callers. Preprocessor checks of SOCK_CLOEXEC cannot be done as its a 0 if not there and SOCK_CLOEXEC (being the value of the enum in bits/socket_type.h) Preprocesssor logic for arithmetic and non-arithmetic defines are hard/nonportable/ugly to read. As such we just check in my_global.h and define HAVE_SOCK_CLOEXEC if we have it. There was a disparity in behaviour between defined(WITH_WSREP) and not depending on the OS, so the WITH_WSREP condition was removed from setting calling fcntl. All sockets are now maked SOCK_CLOEXEC/FD_CLOEXEC. strace of mysqld with SOCK_CLOEXEC: socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 10 write(2, "180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.\n", 65180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'. ) = 65 setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(10, {sa_family=AF_INET, sin_port=htons(16020), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 listen(10, 150) = 0 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = 11 write(2, "180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'.\n", 65180419 14:52:40 [Note] Server socket created on IP: '127.0.0.1'. ) = 65 setsockopt(11, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(11, {sa_family=AF_INET, sin_port=htons(16021), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 listen(11, 150) = 0 socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 12 unlink("/home/dan/repos/build-mariadb-server-10.0/mysql-test/var/tmp/mysqld.1.sock") = -1 ENOENT (No such file or directory) setsockopt(12, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 umask(000) = 006 bind(12, {sa_family=AF_UNIX, sun_path="/home/dan/repos/build-mariadb-server-10.0/mysql-test/var/tmp/mysqld.1.sock"}, 110) = 0 umask(006) = 000 listen(12, 150) = 0
| | | * Merge tag 'mariadb-10.0.23' into 10.0-galeraNirbhay Choubey2015-12-191-2/+2
| | | |\
| | | * | Add close-on-exec flag to open(), socket(), accept() & fopen().Nirbhay Choubey2015-06-241-1/+23
| | | | |
* | | | | Optimize performance schema likely/unlikelyMichael Widenius2018-05-071-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance schema likely/unlikely assume that performance schema is enabled by default, which causes a performance degradation for default installations that doesn't have performance schema enabled. Fixed by changing the likely/unlikely in PS to assume it's not enabled. This can be changed by compiling with -DPSI_ON_BY_DEFAULT Other changes: - Added psi_likely/psi_unlikely that is depending on PSI_ON_BY_DEFAULT. psi_likely() is assumed to be true if PS is enabled. - Added likely/unlikely to some PS interface code. - Moved pfs_enabled to mysys (was initialized but not used before) - Added "if (pfs_likely(pfs_enabled))" around calls to PS to avoid an extra call if PS is not enabled. - Moved checking flag_global_instrumention before other flags to speed up the case when PS is not enabled.
* | | | | Misc. typosluz.paz2018-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | Found via `codespell -i 3 -w --skip="./debian/po" -I ../mariadb-server-word-whitelist.txt ./cmake/ ./debian/ ./Docs/ ./include/ ./man/ ./plugin/ ./strings/`
* | | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-4/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Fix many -Wconversion warnings.Marko Mäkelä2017-03-071-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define my_thread_id as an unsigned type, to avoid mismatch with ulonglong. Change some parameters to this type. Use size_t in a few more places. Declare many flag constants as unsigned to avoid sign mismatch when shifting bits or applying the unary ~ operator. When applying the unary ~ operator to enum constants, explictly cast the result to an unsigned type, because enum constants can be treated as signed. In InnoDB, change the source code line number parameters from ulint to unsigned type. Also, make some InnoDB functions return a narrower type (unsigned or uint32_t instead of ulint; bool instead of ibool).
* | | | MDEV-6150 Speed up connection speed by moving creation of THD to new threadMonty2016-02-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a CONNECT object on client connect and pass this to the working thread which creates the THD. Split LOCK_thread_count to different mutexes Added LOCK_thread_start to syncronize threads Moved most usage of LOCK_thread_count to dedicated functions Use next_thread_id() instead of thread_id++ Other things: - Thread id now starts from 1 instead of 2 - Added cast for thread_id as thread id is now of type my_thread_id - Made THD->host const (To ensure it's not changed) - Removed some DBUG_PRINT() about entering/exiting mutex as these was already logged by mutex code - Fixed that aborted_connects and connection_errors_internal are counted in all cases - Don't take locks for current_linfo when we set it (not needed as it was 0 before)
* | | | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2015-12-291-2/+4
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2015-12-211-2/+2
| |\ \ \ | | | |/ | | |/|
| | * | Correct comments before mysql_socket_{g|s}etfd to refer to the right functionDaniel Black2015-12-111-2/+2
| | |/
| * | Fix warning about unused variable if FD_CLOEXEC is not definedVladislav Vaintroub2015-11-241-0/+2
| | |
* | | cmake: remove unused checks, options, and symbolsSergei Golubchik2015-11-231-1/+1
|/ /
* | compilation failures on WindowsSergei Golubchik2015-07-231-0/+4
| |
* | Merge branch '10.0-galera' into 10.1Nirbhay Choubey2015-07-141-1/+23
|/
* Temporary commit of 10.0-mergeMichael Widenius2013-03-261-77/+101
|
* Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6Michael Widenius2012-08-011-0/+1137