Commit 64f58239 authored by tsmith@quadxeon.mysql.com's avatar tsmith@quadxeon.mysql.com

Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50

into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50
parents 1ac607be d5422980
...@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \ ...@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-debug \ compile-alpha-debug \
compile-amd64-debug-max \ compile-amd64-debug-max \
compile-amd64-max \ compile-amd64-max \
compile-amd64-max-sci \
compile-darwin-mwcc \ compile-darwin-mwcc \
compile-dist \ compile-dist \
compile-hpux11-parisc2-aCC \ compile-hpux11-parisc2-aCC \
...@@ -53,6 +54,7 @@ EXTRA_DIST = FINISH.sh \ ...@@ -53,6 +54,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-valgrind-max \ compile-pentium-valgrind-max \
compile-pentium64-debug \ compile-pentium64-debug \
compile-pentium64-debug-max \ compile-pentium64-debug-max \
compile-pentium64-max-sci \
compile-pentium64-valgrind-max \ compile-pentium64-valgrind-max \
compile-ppc \ compile-ppc \
compile-ppc-debug \ compile-ppc-debug \
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"
extra_configs="$amd64_configs $max_configs --with-ndb-sci=/opt/DIS"
. "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags -g"
extra_configs="$pentium_configs $max_configs --with-ndb-sci=/opt/DIS"
. "$path/FINISH.sh"
...@@ -157,6 +157,8 @@ test-bt: ...@@ -157,6 +157,8 @@ test-bt:
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=rowlock --suite=row_lock
test-bt-debug: test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
......
...@@ -22,7 +22,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ...@@ -22,7 +22,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
if test -f "$mysql_sci_dir/lib/libsisci.a" -a \ if test -f "$mysql_sci_dir/lib/libsisci.a" -a \
-f "$mysql_sci_dir/include/sisci_api.h"; then -f "$mysql_sci_dir/include/sisci_api.h"; then
NDB_SCI_INCLUDES="-I$mysql_sci_dir/include" NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
NDB_SCI_LIBS="-L$mysql_sci_dir/lib -lsisci" NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a"
AC_MSG_RESULT([-- including sci transporter]) AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1], AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter]) [Including Ndb Cluster DB sci transporter])
......
...@@ -66,8 +66,8 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -66,8 +66,8 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ #define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ #define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/ #define MY_GIVE_INFO 2 /* Give time info about process*/
......
...@@ -18,6 +18,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") ...@@ -18,6 +18,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# storage does not work properly in DLLs. # storage does not work properly in DLLs.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib
......
...@@ -81,7 +81,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \ ...@@ -81,7 +81,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/mysys/libmysys.a \ $(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \ $(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \ $(top_builddir)/dbug/libdbug.a \
$(top_builddir)/vio/libvio.a $(top_builddir)/vio/libvio.a @NDB_SCI_LIBS@
# #
......
...@@ -35,7 +35,8 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \ ...@@ -35,7 +35,8 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \ -I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes) $(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs) LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) \
@NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK) mysqltest_embedded_LINK = $(CXXLINK)
mysqltest_embedded_SOURCES = mysqltest.c mysqltest_embedded_SOURCES = mysqltest.c
......
...@@ -335,7 +335,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info) ...@@ -335,7 +335,7 @@ int chk_size(MI_CHECK *param, register MI_INFO *info)
flush_key_blocks(info->s->key_cache, flush_key_blocks(info->s->key_cache,
info->s->kfile, FLUSH_FORCE_WRITE); info->s->kfile, FLUSH_FORCE_WRITE);
size=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0)); size= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE));
if ((skr=(my_off_t) info->state->key_file_length) != size) if ((skr=(my_off_t) info->state->key_file_length) != size)
{ {
/* Don't give error if file generated by myisampack */ /* Don't give error if file generated by myisampack */
...@@ -595,7 +595,8 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ...@@ -595,7 +595,8 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{ {
/* purecov: begin tested */ /* purecov: begin tested */
/* Give it a chance to fit in the real file size. */ /* Give it a chance to fit in the real file size. */
my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(0)); my_off_t max_length= my_seek(info->s->kfile, 0L, MY_SEEK_END,
MYF(MY_THREADSAFE));
mi_check_print_error(param, "Invalid key block position: %s " mi_check_print_error(param, "Invalid key block position: %s "
"key block size: %u file_length: %s", "key block size: %u file_length: %s",
llstr(page, llbuff), keyinfo->block_length, llstr(page, llbuff), keyinfo->block_length,
...@@ -4052,10 +4053,10 @@ int test_if_almost_full(MI_INFO *info) ...@@ -4052,10 +4053,10 @@ int test_if_almost_full(MI_INFO *info)
{ {
if (info->s->options & HA_OPTION_COMPRESS_RECORD) if (info->s->options & HA_OPTION_COMPRESS_RECORD)
return 0; return 0;
return (my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0))/10*9 > return my_seek(info->s->kfile, 0L, MY_SEEK_END, MYF(MY_THREADSAFE)) / 10 * 9 >
(my_off_t) (info->s->base.max_key_file_length) || (my_off_t) info->s->base.max_key_file_length ||
my_seek(info->dfile,0L,MY_SEEK_END,MYF(0))/10*9 > my_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)) / 10 * 9 >
(my_off_t) info->s->base.max_data_file_length); (my_off_t) info->s->base.max_data_file_length;
} }
/* Recreate table with bigger more alloced record-data */ /* Recreate table with bigger more alloced record-data */
......
-- require r/have_log_bin.require
disable_query_log;
show variables like "log_bin";
enable_query_log;
...@@ -123,6 +123,10 @@ master-bin.000001 # Query 1 # use `test`; create table t3 like t1 ...@@ -123,6 +123,10 @@ master-bin.000001 # Query 1 # use `test`; create table t3 like t1
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3 master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t3
master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3 master-bin.000001 # Query 1 # use `test`; replace into t1 select * from t3
drop table t1,t2,t3; drop table t1,t2,t3;
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
INSERT DELAYED INTO t1 VALUES(1);
ERROR HY000: Table storage engine for 't1' doesn't have this option
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10; DELETE FROM t1 WHERE a=10;
ALTER TABLE t1 ADD INDEX(a); ALTER TABLE t1 ADD INDEX(a);
......
Variable_name Value
have_log_bin ON
...@@ -127,6 +127,17 @@ show binlog events; ...@@ -127,6 +127,17 @@ show binlog events;
drop table t1,t2,t3; drop table t1,t2,t3;
#
# BUG#27998 - mysqld crashed when executing INSERT DELAYED on a BLACKHOLE
# table
#
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
--error 1031
INSERT DELAYED INTO t1 VALUES(1);
DROP TABLE t1;
# End of 4.1 tests
# #
#Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX #Bug#19717: DELETE Query Error on BLACKHOLE when using WHERE on column with UNIQUE INDEX
# #
...@@ -142,4 +153,4 @@ ALTER TABLE t1 ADD PRIMARY KEY(a); ...@@ -142,4 +153,4 @@ ALTER TABLE t1 ADD PRIMARY KEY(a);
DELETE FROM t1 WHERE a=10; DELETE FROM t1 WHERE a=10;
DROP TABLE t1; DROP TABLE t1;
# End of 4.1 tests # End of 5.0 tests
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
my_off_t pos The expected position (absolute or relative) my_off_t pos The expected position (absolute or relative)
int whence A direction parameter and one of int whence A direction parameter and one of
{SEEK_SET, SEEK_CUR, SEEK_END} {SEEK_SET, SEEK_CUR, SEEK_END}
myf MyFlags Not used. myf MyFlags MY_THREADSAFE must be set in case my_seek may be mixed
with my_pread/my_pwrite calls and fd is shared among
threads.
DESCRIPTION DESCRIPTION
The my_seek function is a wrapper around the system call lseek and The my_seek function is a wrapper around the system call lseek and
...@@ -54,9 +56,16 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, ...@@ -54,9 +56,16 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
Make sure we are using a valid file descriptor! Make sure we are using a valid file descriptor!
*/ */
DBUG_ASSERT(fd != -1); DBUG_ASSERT(fd != -1);
#if defined(THREAD) && !defined(HAVE_PREAD)
if (MyFlags & MY_THREADSAFE)
{
pthread_mutex_lock(&my_file_info[fd].mutex);
newpos= lseek(fd, pos, whence);
pthread_mutex_unlock(&my_file_info[fd].mutex);
}
else
#endif
newpos= lseek(fd, pos, whence); newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1) if (newpos == (os_off_t) -1)
{ {
my_errno=errno; my_errno=errno;
......
...@@ -79,6 +79,8 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification; ...@@ -79,6 +79,8 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312 #define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313 #define NDBD_EXIT_SR_UNDOLOG 2313
#define NDBD_EXIT_SINGLE_USER_MODE 2314 #define NDBD_EXIT_SINGLE_USER_MODE 2314
#define NDBD_EXIT_NODE_DECLARED_DEAD 2315
#define NDBD_EXIT_SR_SCHEMAFILE 2316
#define NDBD_EXIT_MEMALLOC 2327 #define NDBD_EXIT_MEMALLOC 2327
#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334 #define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334
#define NDBD_EXIT_TIME_QUEUE_SHORT 2335 #define NDBD_EXIT_TIME_QUEUE_SHORT 2335
......
...@@ -20,7 +20,12 @@ ...@@ -20,7 +20,12 @@
#include <TransporterCallback.hpp> #include <TransporterCallback.hpp>
#include <RefConvert.hpp> #include <RefConvert.hpp>
#ifdef ERROR_INSERT
Uint32 MAX_RECEIVED_SIGNALS = 1024;
#else
#define MAX_RECEIVED_SIGNALS 1024 #define MAX_RECEIVED_SIGNALS 1024
#endif
Uint32 Uint32
TransporterRegistry::unpack(Uint32 * readPtr, TransporterRegistry::unpack(Uint32 * readPtr,
Uint32 sizeOfData, Uint32 sizeOfData,
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
* local segment, the SCI transporter connects to a segment created by another * local segment, the SCI transporter connects to a segment created by another
* transporter at a remote node, and the maps the remote segment into its * transporter at a remote node, and the maps the remote segment into its
* virtual address space. However, since NDB Cluster relies on redundancy * virtual address space. However, since NDB Cluster relies on redundancy
* at the network level, by using dual SCI adapters communica * at the network level, by using dual SCI adapters communication can be
* * maintained even if one of the adapter cards fails (or anything on the
* network this adapter card exists in e.g. an SCI switch failure).
* *
*/ */
/** /**
* class SCITransporter * class SCITransporter
* @brief - main class for the SCI transporter. * @brief - main class for the SCI transporter.
...@@ -84,16 +84,6 @@ public: ...@@ -84,16 +84,6 @@ public:
sci_error_t createSequence(Uint32 adapterid); sci_error_t createSequence(Uint32 adapterid);
/**
* starts a sequence for error checking.
* The actual checking that a sequence is correct is done implicitly
* in SCIMemCpy (in doSend).
* @param adapterid the adapter on which to start the sequence.
* @return SCI_ERR_OK if ok, otherwize something else.
*/
sci_error_t startSequence(Uint32 adapterid);
/** Initiate Local Segment: create a memory segment, /** Initiate Local Segment: create a memory segment,
* prepare a memory segment, map the local segment * prepare a memory segment, map the local segment
* into memory space and make segment available. * into memory space and make segment available.
...@@ -159,7 +149,6 @@ private: ...@@ -159,7 +149,6 @@ private:
bool m_mapped; bool m_mapped;
bool m_initLocal; bool m_initLocal;
bool m_sciinit; bool m_sciinit;
Uint32 m_swapCounter;
Uint32 m_failCounter; Uint32 m_failCounter;
/** /**
* For statistics on transfered packets * For statistics on transfered packets
...@@ -195,7 +184,6 @@ private: ...@@ -195,7 +184,6 @@ private:
*/ */
Uint32 m_reportFreq; Uint32 m_reportFreq;
Uint32 m_adapters; Uint32 m_adapters;
Uint32 m_numberOfRemoteNodes; Uint32 m_numberOfRemoteNodes;
......
...@@ -102,6 +102,10 @@ private: ...@@ -102,6 +102,10 @@ private:
virtual void updateReceiveDataPtr(Uint32 bytesRead); virtual void updateReceiveDataPtr(Uint32 bytesRead);
virtual Uint32 get_free_buffer() const; virtual Uint32 get_free_buffer() const;
inline bool hasReceiveData () const {
return receiveBuffer.sizeOfData > 0;
}
protected: protected:
/** /**
* Setup client/server and perform connect/accept * Setup client/server and perform connect/accept
......
...@@ -841,28 +841,13 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis) ...@@ -841,28 +841,13 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis)
Uint32 Uint32
TransporterRegistry::poll_TCP(Uint32 timeOutMillis) TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
{ {
bool hasdata = false;
if (false && nTCPTransporters == 0) if (false && nTCPTransporters == 0)
{ {
tcpReadSelectReply = 0; tcpReadSelectReply = 0;
return 0; return 0;
} }
struct timeval timeout;
#ifdef NDB_OSE
// Return directly if there are no TCP transporters configured
if(timeOutMillis <= 1){
timeout.tv_sec = 0;
timeout.tv_usec = 1025;
} else {
timeout.tv_sec = timeOutMillis / 1000;
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
}
#else
timeout.tv_sec = timeOutMillis / 1000;
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
#endif
NDB_SOCKET_TYPE maxSocketValue = -1; NDB_SOCKET_TYPE maxSocketValue = -1;
// Needed for TCP/IP connections // Needed for TCP/IP connections
...@@ -885,7 +870,26 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis) ...@@ -885,7 +870,26 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
// Put the connected transporters in the socket read-set // Put the connected transporters in the socket read-set
FD_SET(socket, &tcpReadset); FD_SET(socket, &tcpReadset);
} }
hasdata |= t->hasReceiveData();
}
timeOutMillis = hasdata ? 0 : timeOutMillis;
struct timeval timeout;
#ifdef NDB_OSE
// Return directly if there are no TCP transporters configured
if(timeOutMillis <= 1){
timeout.tv_sec = 0;
timeout.tv_usec = 1025;
} else {
timeout.tv_sec = timeOutMillis / 1000;
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
} }
#else
timeout.tv_sec = timeOutMillis / 1000;
timeout.tv_usec = (timeOutMillis % 1000) * 1000;
#endif
// The highest socket value plus one // The highest socket value plus one
maxSocketValue++; maxSocketValue++;
...@@ -901,7 +905,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis) ...@@ -901,7 +905,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
} }
#endif #endif
return tcpReadSelectReply; return tcpReadSelectReply || hasdata;
} }
#endif #endif
...@@ -937,8 +941,6 @@ TransporterRegistry::performReceive() ...@@ -937,8 +941,6 @@ TransporterRegistry::performReceive()
#endif #endif
#ifdef NDB_TCP_TRANSPORTER #ifdef NDB_TCP_TRANSPORTER
if(tcpReadSelectReply > 0)
{
for (int i=0; i<nTCPTransporters; i++) for (int i=0; i<nTCPTransporters; i++)
{ {
checkJobBuffer(); checkJobBuffer();
...@@ -946,21 +948,23 @@ TransporterRegistry::performReceive() ...@@ -946,21 +948,23 @@ TransporterRegistry::performReceive()
const NodeId nodeId = t->getRemoteNodeId(); const NodeId nodeId = t->getRemoteNodeId();
const NDB_SOCKET_TYPE socket = t->getSocket(); const NDB_SOCKET_TYPE socket = t->getSocket();
if(is_connected(nodeId)){ if(is_connected(nodeId)){
if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) if(t->isConnected())
{ {
const int receiveSize = t->doReceive(); if (FD_ISSET(socket, &tcpReadset))
if(receiveSize > 0) {
t->doReceive();
}
if (t->hasReceiveData())
{ {
Uint32 * ptr; Uint32 * ptr;
Uint32 sz = t->getReceiveData(&ptr); Uint32 sz = t->getReceiveData(&ptr);
transporter_recv_from(callbackObj, nodeId);
Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]); Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]);
t->updateReceiveDataPtr(szUsed); t->updateReceiveDataPtr(szUsed);
} }
} }
} }
} }
}
#endif #endif
#ifdef NDB_SCI_TRANSPORTER #ifdef NDB_SCI_TRANSPORTER
......
...@@ -132,6 +132,7 @@ Cmvmi::~Cmvmi() ...@@ -132,6 +132,7 @@ Cmvmi::~Cmvmi()
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
NodeBitmask c_error_9000_nodes_mask; NodeBitmask c_error_9000_nodes_mask;
extern Uint32 MAX_RECEIVED_SIGNALS;
#endif #endif
void Cmvmi::execNDB_TAMPER(Signal* signal) void Cmvmi::execNDB_TAMPER(Signal* signal)
...@@ -161,6 +162,22 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) ...@@ -161,6 +162,22 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
kill(getpid(), SIGABRT); kill(getpid(), SIGABRT);
} }
#endif #endif
#ifdef ERROR_INSERT
if (signal->theData[0] == 9003)
{
if (MAX_RECEIVED_SIGNALS < 1024)
{
MAX_RECEIVED_SIGNALS = 1024;
}
else
{
MAX_RECEIVED_SIGNALS = 1 + (rand() % 128);
}
ndbout_c("MAX_RECEIVED_SIGNALS: %d", MAX_RECEIVED_SIGNALS);
CLEAR_ERROR_INSERT_VALUE;
}
#endif
}//execNDB_TAMPER() }//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal) void Cmvmi::execSET_LOGLEVELORD(Signal* signal)
......
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
#include <NdbSleep.h> #include <NdbSleep.h>
#include <signaldata/ApiBroadcast.hpp> #include <signaldata/ApiBroadcast.hpp>
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
#define ZNOT_FOUND 626 #define ZNOT_FOUND 626
#define ZALREADYEXIST 630 #define ZALREADYEXIST 630
...@@ -1069,17 +1072,36 @@ void Dbdict::readSchemaConf(Signal* signal, ...@@ -1069,17 +1072,36 @@ void Dbdict::readSchemaConf(Signal* signal,
for (Uint32 n = 0; n < xsf->noOfPages; n++) { for (Uint32 n = 0; n < xsf->noOfPages; n++) {
SchemaFile * sf = &xsf->schemaPage[n]; SchemaFile * sf = &xsf->schemaPage[n];
bool ok = bool ok = false;
memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) == 0 && const char *reason;
sf->FileSize != 0 && if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0)
sf->FileSize % NDB_SF_PAGE_SIZE == 0 && { jam(); reason = "magic code"; }
sf->FileSize == sf0->FileSize && else if (sf->FileSize == 0)
sf->PageNumber == n && { jam(); reason = "file size == 0"; }
computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) == 0; else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0)
ndbrequire(ok || !crashInd); { jam(); reason = "invalid size multiple"; }
if (! ok) { else if (sf->FileSize != sf0->FileSize)
jam(); { jam(); reason = "invalid size"; }
ndbrequire(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1); else if (sf->PageNumber != n)
{ jam(); reason = "invalid page number"; }
else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0)
{ jam(); reason = "invalid checksum"; }
else
ok = true;
if (!ok)
{
char reason_msg[128];
snprintf(reason_msg, sizeof(reason_msg),
"schema file corrupt, page %u (%s, "
"sz=%u sz0=%u pn=%u)",
n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber);
if (crashInd)
progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg);
ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
NDBD_EXIT_SR_SCHEMAFILE);
jam();
infoEvent("primary %s, trying backup", reason_msg);
readSchemaRef(signal, fsPtr); readSchemaRef(signal, fsPtr);
return; return;
} }
......
...@@ -2816,7 +2816,7 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode, ...@@ -2816,7 +2816,7 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
if (failedNodePtr.i == getOwnNodeId()) { if (failedNodePtr.i == getOwnNodeId()) {
jam(); jam();
Uint32 code = 0; Uint32 code = NDBD_EXIT_NODE_DECLARED_DEAD;
const char * msg = 0; const char * msg = 0;
char extra[100]; char extra[100];
switch(aFailCause){ switch(aFailCause){
......
...@@ -57,12 +57,15 @@ static const ErrStruct errArray[] = ...@@ -57,12 +57,15 @@ static const ErrStruct errArray[] =
"error(s) on other node(s)"}, "error(s) on other node(s)"},
{NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE, "Partitioned cluster detected. " {NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE, "Partitioned cluster detected. "
"Please check if cluster is already running"}, "Please check if cluster is already running"},
{NDBD_EXIT_NODE_DECLARED_DEAD, XAE,
"Node declared dead. See error log for details"},
{NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"}, {NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"},
{NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system " {NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system "
"restart, please investigate error(s) on other node(s)"}, "restart, please investigate error(s) on other node(s)"},
{NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, " {NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, "
"most probably resolved by restarting node again"}, "most probably resolved by restarting node again"},
{NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"}, {NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"},
{NDBD_EXIT_SR_SCHEMAFILE, XFI, "Error while reading the schema file"},
/* Currently unused? */ /* Currently unused? */
{2311, XIE, "Conflict when selecting restart type"}, {2311, XIE, "Conflict when selecting restart type"},
{NDBD_EXIT_NO_MORE_UNDOLOG, XCR, {NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
......
...@@ -1306,6 +1306,36 @@ int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -1306,6 +1306,36 @@ int runTestExecuteAsynch(NDBT_Context* ctx, NDBT_Step* step){
template class Vector<NdbScanOperation*>; template class Vector<NdbScanOperation*>;
int
runBug28443(NDBT_Context* ctx, NDBT_Step* step)
{
int result = NDBT_OK;
int records = ctx->getNumRecords();
NdbRestarter restarter;
restarter.insertErrorInAllNodes(9003);
for (Uint32 i = 0; i<ctx->getNumLoops(); i++)
{
HugoTransactions hugoTrans(*ctx->getTab());
if (hugoTrans.loadTable(GETNDB(step), records, 2048) != 0)
{
result = NDBT_FAILED;
goto done;
}
if (runClearTable(ctx, step) != 0)
{
result = NDBT_FAILED;
goto done;
}
}
done:
restarter.insertErrorInAllNodes(9003);
return result;
}
NDBT_TESTSUITE(testNdbApi); NDBT_TESTSUITE(testNdbApi);
TESTCASE("MaxNdb", TESTCASE("MaxNdb",
...@@ -1396,6 +1426,10 @@ TESTCASE("ExecuteAsynch", ...@@ -1396,6 +1426,10 @@ TESTCASE("ExecuteAsynch",
"Check that executeAsync() works (BUG#27495)\n"){ "Check that executeAsync() works (BUG#27495)\n"){
INITIALIZER(runTestExecuteAsynch); INITIALIZER(runTestExecuteAsynch);
} }
TESTCASE("Bug28443",
""){
INITIALIZER(runBug28443);
}
NDBT_TESTSUITE_END(testNdbApi); NDBT_TESTSUITE_END(testNdbApi);
int main(int argc, const char** argv){ int main(int argc, const char** argv){
......
...@@ -629,6 +629,10 @@ max-time: 500 ...@@ -629,6 +629,10 @@ max-time: 500
cmd: testNdbApi cmd: testNdbApi
args: -n ExecuteAsynch T1 args: -n ExecuteAsynch T1
max-time: 1000
cmd: testNdbApi
args: -n BugBug28443
#max-time: 500 #max-time: 500
#cmd: testInterpreter #cmd: testInterpreter
#args: T1 #args: T1
......
...@@ -102,11 +102,41 @@ case $system in ...@@ -102,11 +102,41 @@ case $system in
;; ;;
esac esac
# This is needed to prefer GNU tar over platform tar because that can't
# always handle long filenames
PATH_DIRS=`echo $PATH | \
sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
which_1 ()
{
for cmd
do
for d in $PATH_DIRS
do
for file in $d/$cmd
do
if [ -x $file -a ! -d $file ] ; then
echo $file
exit 0
fi
done
done
done
exit 1
}
tar=`which_1 gnutar gtar`
if [ "$?" = "1" -o x"$tar" = x"" ] ; then
tar=tar
fi
mkdir $BASE $BASE/bin $BASE/docs \ mkdir $BASE $BASE/bin $BASE/docs \
$BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \
$BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \
$BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \
$BASE/mysql-test/suite
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \
...@@ -117,8 +147,8 @@ fi ...@@ -117,8 +147,8 @@ fi
# Copy files if they exists, warn for those that don't. # Copy files if they exists, warn for those that don't.
# Note that when listing files to copy, we might list the file name # Note that when listing files to copy, we might list the file name
# twice, once in the directory location where it is build, and a # twice, once in the directory location where it is built, and a
# second time in the ".libs" location. In the case the firs one # second time in the ".libs" location. In the case the first one
# is a wrapper script, the second one will overwrite it with the # is a wrapper script, the second one will overwrite it with the
# binary file. # binary file.
copyfileto() copyfileto()
...@@ -274,6 +304,13 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \ ...@@ -274,6 +304,13 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \
$CP mysql-test/r/*.result mysql-test/r/*.require \ $CP mysql-test/r/*.result mysql-test/r/*.require \
$BASE/mysql-test/r $BASE/mysql-test/r
# Copy the additional suites "as is", they are in flux
$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - )
# Clean up if we did this from a bk tree
if [ -d mysql-test/SCCS ] ; then
find $BASE/mysql-test -name SCCS -print | xargs rm -rf
fi
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
chmod a+x $BASE/bin/* chmod a+x $BASE/bin/*
copyfileto $BASE/bin scripts/* copyfileto $BASE/bin scripts/*
...@@ -374,41 +411,12 @@ if [ x$DEBUG = x1 ] ; then ...@@ -374,41 +411,12 @@ if [ x$DEBUG = x1 ] ; then
exit exit
fi fi
# This is needed to prefere gnu tar instead of tar because tar can't
# always handle long filenames
PATH_DIRS=`echo $PATH | \
sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
which_1 ()
{
for cmd
do
for d in $PATH_DIRS
do
for file in $d/$cmd
do
if [ -x $file -a ! -d $file ] ; then
echo $file
exit 0
fi
done
done
done
exit 1
}
if [ $BASE_SYSTEM != "netware" ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
# #
# Create the result tar file # Create the result tar file
# #
tar=`which_1 gnutar gtar`
if [ "$?" = "1" -o x"$tar" = x"" ] ; then
tar=tar
fi
echo "Using $tar to create archive" echo "Using $tar to create archive"
OPT=cvf OPT=cvf
......
...@@ -43,8 +43,7 @@ public: ...@@ -43,8 +43,7 @@ public:
{ {
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME);
HA_CAN_INSERT_DELAYED);
} }
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const
{ {
......
...@@ -2309,16 +2309,24 @@ int ha_ndbcluster::write_row(byte *record) ...@@ -2309,16 +2309,24 @@ int ha_ndbcluster::write_row(byte *record)
{ {
// Table has hidden primary key // Table has hidden primary key
Ndb *ndb= get_ndb(); Ndb *ndb= get_ndb();
int ret;
Uint64 auto_value; Uint64 auto_value;
uint retries= NDB_AUTO_INCREMENT_RETRIES; uint retries= NDB_AUTO_INCREMENT_RETRIES;
do { int retry_sleep= 30; /* 30 milliseconds, transaction */
ret= ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, 1); for (;;)
} while (ret == -1 && {
--retries && if (ndb->getAutoIncrementValue((const NDBTAB *) m_table,
auto_value, 1) == -1)
{
if (--retries &&
ndb->getNdbError().status == NdbError::TemporaryError); ndb->getNdbError().status == NdbError::TemporaryError);
if (ret == -1) {
my_sleep(retry_sleep);
continue;
}
ERR_RETURN(ndb->getNdbError()); ERR_RETURN(ndb->getNdbError());
}
break;
}
if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value)) if (set_hidden_key(op, table->s->fields, (const byte*)&auto_value))
ERR_RETURN(op->getNdbError()); ERR_RETURN(op->getNdbError());
} }
...@@ -4855,23 +4863,28 @@ ulonglong ha_ndbcluster::get_auto_increment() ...@@ -4855,23 +4863,28 @@ ulonglong ha_ndbcluster::get_auto_increment()
m_rows_to_insert - m_rows_inserted : m_rows_to_insert - m_rows_inserted :
((m_rows_to_insert > m_autoincrement_prefetch) ? ((m_rows_to_insert > m_autoincrement_prefetch) ?
m_rows_to_insert : m_autoincrement_prefetch)); m_rows_to_insert : m_autoincrement_prefetch));
int ret;
uint retries= NDB_AUTO_INCREMENT_RETRIES; uint retries= NDB_AUTO_INCREMENT_RETRIES;
do { int retry_sleep= 30; /* 30 milliseconds, transaction */
ret= for (;;)
m_skip_auto_increment ? {
ndb->readAutoIncrementValue((const NDBTAB *) m_table, auto_value) : if (m_skip_auto_increment &&
ndb->getAutoIncrementValue((const NDBTAB *) m_table, auto_value, cache_size); ndb->readAutoIncrementValue((const NDBTAB *) m_table, auto_value) ||
} while (ret == -1 && ndb->getAutoIncrementValue((const NDBTAB *) m_table,
--retries && auto_value, cache_size))
{
if (--retries &&
ndb->getNdbError().status == NdbError::TemporaryError); ndb->getNdbError().status == NdbError::TemporaryError);
if (ret == -1)
{ {
my_sleep(retry_sleep);
continue;
}
const NdbError err= ndb->getNdbError(); const NdbError err= ndb->getNdbError();
sql_print_error("Error %lu in ::get_auto_increment(): %s", sql_print_error("Error %lu in ::get_auto_increment(): %s",
(ulong) err.code, err.message); (ulong) err.code, err.message);
DBUG_RETURN(~(ulonglong) 0); DBUG_RETURN(~(ulonglong) 0);
} }
break;
}
DBUG_RETURN((longlong)auto_value); DBUG_RETURN((longlong)auto_value);
} }
...@@ -5011,27 +5024,36 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked) ...@@ -5011,27 +5024,36 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
set_dbname(name); set_dbname(name);
set_tabname(name); set_tabname(name);
if (check_ndb_connection()) { if ((res= check_ndb_connection()) ||
free_share(m_share); m_share= 0; (res= get_metadata(name)))
DBUG_RETURN(HA_ERR_NO_CONNECTION); {
free_share(m_share);
m_share= 0;
DBUG_RETURN(res);
} }
while (1)
res= get_metadata(name);
if (!res)
{ {
Ndb *ndb= get_ndb(); Ndb *ndb= get_ndb();
if (ndb->setDatabaseName(m_dbname)) if (ndb->setDatabaseName(m_dbname))
{ {
ERR_RETURN(ndb->getNdbError()); res= ndb_to_mysql_error(&ndb->getNdbError());
break;
} }
struct Ndb_statistics stat; struct Ndb_statistics stat;
res= ndb_get_table_statistics(NULL, false, ndb, m_tabname, &stat); res= ndb_get_table_statistics(NULL, false, ndb, m_tabname, &stat);
records= stat.row_count; records= stat.row_count;
if(!res) if(!res)
res= info(HA_STATUS_CONST); res= info(HA_STATUS_CONST);
break;
} }
if (res)
{
free_share(m_share);
m_share= 0;
release_metadata();
DBUG_RETURN(res); DBUG_RETURN(res);
}
DBUG_RETURN(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment