summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-07-14 16:05:29 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-07-14 16:05:29 -0400
commitdced5146bdfc46e200ba35a86c3c55fb60972e33 (patch)
tree22e3dd18f4edec2a585341fee607765f96b2744f /include
parent75931feabe99595e9659a423e299c4229d3c02ba (diff)
downloadmariadb-git-dced5146bdfc46e200ba35a86c3c55fb60972e33.tar.gz
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h6
-rw-r--r--include/mysql/psi/mysql_socket.h24
-rw-r--r--include/mysql/service_wsrep.h14
3 files changed, 42 insertions, 2 deletions
diff --git a/include/my_global.h b/include/my_global.h
index e026f8a66a9..e654d567d42 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -594,6 +594,12 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifndef O_NOFOLLOW
#define O_NOFOLLOW 0
#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+#ifndef SOCK_CLOEXEC
+#define SOCK_CLOEXEC 0
+#endif
/* additional file share flags for win32 */
#ifdef __WIN__
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index e1d56539f85..6f37e012f1f 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -553,7 +553,7 @@ inline_mysql_socket_socket
int domain, int type, int protocol)
{
MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
- mysql_socket.fd= socket(domain, type, protocol);
+ mysql_socket.fd= socket(domain, type | SOCK_CLOEXEC, protocol);
#ifdef HAVE_PSI_SOCKET_INTERFACE
if (likely(mysql_socket.fd != INVALID_SOCKET))
@@ -1013,6 +1013,8 @@ inline_mysql_socket_accept
#endif
MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
{
+ int flags;
+
MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET;
socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0;
@@ -1026,7 +1028,17 @@ inline_mysql_socket_accept
(&state, socket_listen.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);
/* Instrumented code */
+#ifdef HAVE_ACCEPT4
+ socket_accept.fd= accept4(socket_listen.fd, addr, &addr_length,
+ SOCK_CLOEXEC);
+#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
+ flags= fcntl(socket_accept.fd, F_GETFD);
+ if (flags != -1) {
+ flags |= FD_CLOEXEC;
+ fcntl(socket_accept.fd, F_SETFD, flags);
+ }
+#endif
/* Instrumentation end */
if (locker != NULL)
@@ -1036,7 +1048,17 @@ inline_mysql_socket_accept
#endif
{
/* Non instrumented code */
+#ifdef HAVE_ACCEPT4
+ socket_accept.fd= accept4(socket_listen.fd, addr, &addr_length,
+ SOCK_CLOEXEC);
+#else
socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
+ flags= fcntl(socket_accept.fd, F_GETFD);
+ if (flags != -1) {
+ flags |= FD_CLOEXEC;
+ fcntl(socket_accept.fd, F_SETFD, flags);
+ }
+#endif
}
#ifdef HAVE_PSI_SOCKET_INTERFACE
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index bc05559064a..93567c1927d 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICE_WSREP_INCLUDED
-/* Copyright (c) 2013, Monty Program Ab
+/* Copyright (c) 2015 MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,9 +38,16 @@ enum wsrep_conflict_state {
};
enum wsrep_exec_mode {
+ /* Transaction processing before replication. */
LOCAL_STATE,
+ /* Slave thread applying write sets from other nodes or replaying thread. */
REPL_RECV,
+ /* Total-order-isolation mode. */
TOTAL_ORDER,
+ /*
+ Transaction procession after it has been replicated in prepare stage and
+ has passed certification.
+ */
LOCAL_COMMIT
};
@@ -69,6 +76,7 @@ extern struct wsrep_service_st {
my_bool (*get_wsrep_certify_nonPK_func)();
my_bool (*get_wsrep_debug_func)();
my_bool (*get_wsrep_drupal_282555_workaround_func)();
+ my_bool (*get_wsrep_recovery_func)();
my_bool (*get_wsrep_load_data_splitting_func)();
my_bool (*get_wsrep_log_conflicts_func)();
long (*get_wsrep_protocol_version_func)();
@@ -108,6 +116,7 @@ extern struct wsrep_service_st {
#define get_wsrep_certify_nonPK() wsrep_service->get_wsrep_certify_nonPK_func()
#define get_wsrep_debug() wsrep_service->get_wsrep_debug_func()
#define get_wsrep_drupal_282555_workaround() wsrep_service->get_wsrep_drupal_282555_workaround_func()
+#define get_wsrep_recovery() wsrep_service->get_wsrep_recovery_func()
#define get_wsrep_load_data_splitting() wsrep_service->get_wsrep_load_data_splitting_func()
#define get_wsrep_log_conflicts() wsrep_service->get_wsrep_log_conflicts_func()
#define get_wsrep_protocol_version() wsrep_service->get_wsrep_protocol_version_func()
@@ -146,6 +155,7 @@ extern struct wsrep_service_st {
#define wsrep_certify_nonPK get_wsrep_certify_nonPK()
#define wsrep_load_data_splitting get_wsrep_load_data_splitting()
#define wsrep_drupal_282555_workaround get_wsrep_drupal_282555_workaround()
+#define wsrep_recovery get_wsrep_recovery()
#define wsrep_protocol_version get_wsrep_protocol_version()
#else
@@ -155,6 +165,7 @@ extern my_bool wsrep_log_conflicts;
extern my_bool wsrep_certify_nonPK;
extern my_bool wsrep_load_data_splitting;
extern my_bool wsrep_drupal_282555_workaround;
+extern my_bool wsrep_recovery;
extern long wsrep_protocol_version;
bool wsrep_consistency_check(THD *thd);
@@ -178,6 +189,7 @@ long long wsrep_thd_trx_seqno(THD *thd);
my_bool get_wsrep_certify_nonPK();
my_bool get_wsrep_debug();
my_bool get_wsrep_drupal_282555_workaround();
+my_bool get_wsrep_recovery();
my_bool get_wsrep_load_data_splitting();
my_bool get_wsrep_log_conflicts();
my_bool wsrep_aborting_thd_contains(THD *thd);