BUILD/SETUP.sh:
  Auto merged
configure.in:
  Auto merged
BitKeeper/deleted/.del-ErrorMessages.hpp~9ab815d55a13433a:
  Auto merged
ndb/include/mgmapi/ndbd_exit_codes.h:
  Auto merged
ndb/src/kernel/error/ndbd_exit_codes.c:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/log.cc:
  Auto merged
storage/innobase/os/os0sync.c:
  Auto merged
storage/ndb/include/Makefile.am:
  Auto merged
storage/ndb/include/kernel/signaldata/EventReport.hpp:
  Auto merged
storage/ndb/include/kernel/signaldata/FsRef.hpp:
  Auto merged
storage/ndb/include/kernel/signaldata/SystemError.hpp:
  Auto merged
storage/ndb/include/mgmapi/mgmapi.h:
  Auto merged
storage/ndb/src/common/debugger/EventLogger.cpp:
  Auto merged
storage/ndb/src/common/debugger/signaldata/FsRef.cpp:
  Auto merged
storage/ndb/src/kernel/main.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/backup/BackupInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/suma/Suma.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/suma/Suma.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/trix/Trix.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/trix/Trix.hpp:
  Auto merged
storage/ndb/src/kernel/error/ErrorHandlingMacros.hpp:
  Auto merged
storage/ndb/src/kernel/error/ErrorReporter.cpp:
  Auto merged
storage/ndb/src/kernel/error/ErrorReporter.hpp:
  Auto merged
storage/ndb/src/kernel/error/Makefile.am:
  Auto merged
storage/ndb/src/kernel/vm/ArrayPool.hpp:
  Auto merged
storage/ndb/src/kernel/vm/CArray.hpp:
  Auto merged
storage/ndb/src/kernel/vm/ClusterConfiguration.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.hpp:
  Auto merged
storage/ndb/src/kernel/vm/Emulator.cpp:
  Auto merged
storage/ndb/src/kernel/vm/FastScheduler.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Makefile.am:
  Auto merged
storage/ndb/src/kernel/vm/SafeCounter.cpp:
  Auto merged
storage/ndb/src/kernel/vm/SafeCounter.hpp:
  Auto merged
storage/ndb/src/kernel/vm/SimulatedBlock.cpp:
  Auto merged
storage/ndb/src/kernel/vm/SimulatedBlock.hpp:
  Auto merged
storage/ndb/src/kernel/vm/TimeQueue.cpp:
  Auto merged
storage/ndb/src/kernel/vm/TransporterCallback.cpp:
  Auto merged
storage/ndb/src/kernel/vm/WatchDog.cpp:
  Auto merged
storage/ndb/src/kernel/vm/WatchDog.hpp:
  Auto merged
storage/ndb/src/kernel/vm/pc.hpp:
  Auto merged
storage/ndb/src/mgmapi/Makefile.am:
  Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
storage/ndb/src/mgmapi/ndb_logevent.cpp:
  Auto merged
storage/ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
  Auto merged
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndberror.c:
  Auto merged
strings/ctype-big5.c:
  Auto merged
strings/ctype-ucs2.c:
  Auto merged
config/ac-macros/ha_ndbcluster.m4:
  merge
extra/perror.c:
  merge
storage/ndb/include/mgmapi/ndb_logevent.h:
  merge
storage/ndb/src/kernel/blocks/suma/SumaInit.cpp:
  merge
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  merge
storage/ndb/src/mgmsrv/Services.hpp:
  SCCS merged
This commit is contained in:
unknown 2005-10-07 01:12:46 +02:00
commit 1dc04d119f
117 changed files with 2423 additions and 1103 deletions

View file

@ -141,7 +141,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB]) AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB])
AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB]) AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
have_ndbcluster="yes" have_ndbcluster="yes"
ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_builddir)/storage/ndb/include/ndbapi" ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_builddir)/storage/ndb/include/ndbapi -I\$(top_builddir)/storage/ndb/include/mgmapi"
ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a" ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
ndbcluster_system_libs="" ndbcluster_system_libs=""
ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la" ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"

View file

@ -1873,7 +1873,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
realpath rename rint rwlock_init setupterm \ realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
sighold sigset sigthreadmask \ sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
# #

View file

@ -25,6 +25,7 @@
#include <my_getopt.h> #include <my_getopt.h>
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
#include "../storage/ndb/src/ndbapi/ndberror.c" #include "../storage/ndb/src/ndbapi/ndberror.c"
#include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"
#endif #endif
static my_bool verbose, print_all_codes; static my_bool verbose, print_all_codes;
@ -235,8 +236,11 @@ int main(int argc,char *argv[])
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
if (ndb_code) if (ndb_code)
{ {
if (ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
msg= 0; (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
{
msg= 0;
}
else else
msg= ndb_string; msg= ndb_string;
} }

View file

@ -0,0 +1,18 @@
#
# Bugs: #13046:
# LIKE pattern matching using prefix index doesn't return correct result
#
select @@collation_connection;
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
-- should return ab_def
select c1 as c1u from t1 where c1 like 'ab\_def';
-- should return ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
drop table t1;

View file

@ -89,6 +89,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
big5_chinese_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='big5_bin'; SET collation_connection='big5_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -121,6 +139,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
big5_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET NAMES big5; SET NAMES big5;
CREATE TABLE t1 (a text) character set big5; CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('ùØ'); INSERT INTO t1 VALUES ('ùØ');

View file

@ -89,6 +89,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
gbk_chinese_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='gbk_bin'; SET collation_connection='gbk_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -121,6 +139,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
gbk_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET NAMES gbk; SET NAMES gbk;
CREATE TABLE t1 (a text) character set gbk; CREATE TABLE t1 (a text) character set gbk;
INSERT INTO t1 VALUES (0xA3A0),(0xA1A1); INSERT INTO t1 VALUES (0xA3A0),(0xA1A1);

View file

@ -315,6 +315,24 @@ latin1_swedish_ci 6109
latin1_swedish_ci 61 latin1_swedish_ci 61
latin1_swedish_ci 6120 latin1_swedish_ci 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
latin1_swedish_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='latin1_bin'; SET collation_connection='latin1_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -325,6 +343,24 @@ latin1_bin 6109
latin1_bin 61 latin1_bin 61
latin1_bin 6120 latin1_bin 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
latin1_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
CREATE TABLE „a (a int); CREATE TABLE „a (a int);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '„a (a int)' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '„a (a int)' at line 1
SELECT '„a' as str; SELECT '„a' as str;

View file

@ -103,6 +103,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
sjis_japanese_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='sjis_bin'; SET collation_connection='sjis_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -135,6 +153,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
sjis_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET NAMES sjis; SET NAMES sjis;
SELECT HEX('佐淘 \圭') FROM DUAL; SELECT HEX('佐淘 \圭') FROM DUAL;
HEX('佐淘 \圭') HEX('佐淘 \圭')

View file

@ -2947,6 +2947,24 @@ tis620_thai_ci 6109
tis620_thai_ci 61 tis620_thai_ci 61
tis620_thai_ci 6120 tis620_thai_ci 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
tis620_thai_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='tis620_bin'; SET collation_connection='tis620_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -2957,3 +2975,21 @@ tis620_bin 6109
tis620_bin 61 tis620_bin 61
tis620_bin 6120 tis620_bin 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
tis620_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;

View file

@ -2506,6 +2506,24 @@ utf8_unicode_ci 6109
utf8_unicode_ci 61 utf8_unicode_ci 61
utf8_unicode_ci 6120 utf8_unicode_ci 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
utf8_unicode_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
CREATE TABLE t1 (id int, a varchar(30) character set utf8); CREATE TABLE t1 (id int, a varchar(30) character set utf8);
INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131); INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131);
INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049); INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049);

View file

@ -595,6 +595,24 @@ ucs2_general_ci 00610009
ucs2_general_ci 0061 ucs2_general_ci 0061
ucs2_general_ci 00610020 ucs2_general_ci 00610020
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
ucs2_general_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET NAMES latin1; SET NAMES latin1;
SET collation_connection='ucs2_bin'; SET collation_connection='ucs2_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
@ -606,6 +624,24 @@ ucs2_bin 00610009
ucs2_bin 0061 ucs2_bin 0061
ucs2_bin 00610020 ucs2_bin 00610020
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
ucs2_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
select hex(substr(_ucs2 0x00e400e50068,1)); select hex(substr(_ucs2 0x00e400e50068,1));
hex(substr(_ucs2 0x00e400e50068,1)) hex(substr(_ucs2 0x00e400e50068,1))
00E400E50068 00E400E50068

View file

@ -2239,6 +2239,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
ujis_japanese_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='ujis_bin'; SET collation_connection='ujis_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -2271,6 +2289,24 @@ select c1 from t1 where c1 like 'abcde111%' order by c1;
c1 c1
abcde111 abcde111
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
ujis_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
DROP PROCEDURE IF EXISTS sp1; DROP PROCEDURE IF EXISTS sp1;
set names ujis; set names ujis;

View file

@ -842,6 +842,24 @@ utf8_general_ci 6109
utf8_general_ci 61 utf8_general_ci 61
utf8_general_ci 6120 utf8_general_ci 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
utf8_general_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
SET collation_connection='utf8_bin'; SET collation_connection='utf8_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -852,6 +870,24 @@ utf8_bin 6109
utf8_bin 61 utf8_bin 61
utf8_bin 6120 utf8_bin 6120
drop table t1; drop table t1;
select @@collation_connection;
@@collation_connection
utf8_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
user varchar(255) NOT NULL default '' user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

View file

@ -15,9 +15,11 @@ SET NAMES big5;
SET collation_connection='big5_chinese_ci'; SET collation_connection='big5_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
SET collation_connection='big5_bin'; SET collation_connection='big5_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
# #
# Bugs#9357: TEXT columns break string with special word in BIG5 charset. # Bugs#9357: TEXT columns break string with special word in BIG5 charset.

View file

@ -15,9 +15,11 @@ SET NAMES gbk;
SET collation_connection='gbk_chinese_ci'; SET collation_connection='gbk_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
SET collation_connection='gbk_bin'; SET collation_connection='gbk_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
# #
# Bug#11987 mysql will truncate the text when # Bug#11987 mysql will truncate the text when

View file

@ -64,8 +64,10 @@ select 'a' regexp 'A' collate latin1_bin;
SET collation_connection='latin1_swedish_ci'; SET collation_connection='latin1_swedish_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
SET collation_connection='latin1_bin'; SET collation_connection='latin1_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
# #
# Bug#8041 # Bug#8041

View file

@ -67,9 +67,11 @@ drop table t1;
SET collation_connection='sjis_japanese_ci'; SET collation_connection='sjis_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
SET collation_connection='sjis_bin'; SET collation_connection='sjis_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
# Check parsing of string literals in SJIS with multibyte characters that # Check parsing of string literals in SJIS with multibyte characters that
# have an embedded \ in them. (Bug #8303) # have an embedded \ in them. (Bug #8303)

View file

@ -155,7 +155,9 @@ DROP TABLE t1;
SET collation_connection='tis620_thai_ci'; SET collation_connection='tis620_thai_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
SET collation_connection='tis620_bin'; SET collation_connection='tis620_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
# End of 4.1 tests # End of 4.1 tests

View file

@ -456,6 +456,7 @@ drop table t1;
SET collation_connection='utf8_unicode_ci'; SET collation_connection='utf8_unicode_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
# End of 4.1 tests # End of 4.1 tests

View file

@ -372,9 +372,11 @@ drop table t1;
SET collation_connection='ucs2_general_ci'; SET collation_connection='ucs2_general_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
SET NAMES latin1; SET NAMES latin1;
SET collation_connection='ucs2_bin'; SET collation_connection='ucs2_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
# #
# Bug#10344 Some string functions fail for UCS2 # Bug#10344 Some string functions fail for UCS2

View file

@ -1146,9 +1146,11 @@ DROP TABLE t1;
SET collation_connection='ujis_japanese_ci'; SET collation_connection='ujis_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
SET collation_connection='ujis_bin'; SET collation_connection='ujis_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
# End of 4.1 tests # End of 4.1 tests
--disable_warnings --disable_warnings

View file

@ -685,8 +685,10 @@ drop table t1;
SET collation_connection='utf8_general_ci'; SET collation_connection='utf8_general_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
SET collation_connection='utf8_bin'; SET collation_connection='utf8_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc
# #
# Bug #7874 CONCAT() gives wrong results mixing # Bug #7874 CONCAT() gives wrong results mixing

View file

@ -0,0 +1,156 @@
/* Copyright (C) 2003 MySQL 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDBD_EXIT_CODES_H
#define NDBD_EXIT_CODES_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
* Exit error codes for NDBD
*
* These errorcodes should be used whenever a condition
* is detected where it's necesssary to shutdown NDB.
*
* Example: When another node fails while a NDB node are performing
* a system restart the node should be shutdown. This
* is kind of an error but the cause of the error is known
* and a proper errormessage describing the problem should
* be printed in error.log. It's therefore important to use
* the proper errorcode.
*
*/
typedef enum
{
ndbd_exit_st_success = 0,
ndbd_exit_st_unknown = 1,
ndbd_exit_st_permanent = 2,
ndbd_exit_st_temporary = 3,
ndbd_exit_st_filesystem_error = 4
} ndbd_exit_status_enum;
typedef enum
{
ndbd_exit_cl_none = 0,
ndbd_exit_cl_unknown = 1,
ndbd_exit_cl_internal_error = 2,
ndbd_exit_cl_configuration_error = 3,
ndbd_exit_cl_arbitration_error = 4,
ndbd_exit_cl_restart_error = 5,
ndbd_exit_cl_resource_configuration_error = 6,
ndbd_exit_cl_filesystem_full_error = 7,
ndbd_exit_cl_filesystem_inconsistency_error = 8,
ndbd_exit_cl_filesystem_limit = 9
} ndbd_exit_classification_enum;
typedef ndbd_exit_status_enum ndbd_exit_status;
typedef ndbd_exit_classification_enum ndbd_exit_classification;
/* Errorcodes before block division was used */
#define NDBD_EXIT_PRGERR 2301
#define NDBD_EXIT_NODE_NOT_IN_CONFIG 2302
#define NDBD_EXIT_SYSTEM_ERROR 2303
#define NDBD_EXIT_INDEX_NOTINRANGE 2304
#define NDBD_EXIT_ARBIT_SHUTDOWN 2305
#define NDBD_EXIT_POINTER_NOTINRANGE 2306
#define NDBD_EXIT_SR_OTHERNODEFAILED 2308
#define NDBD_EXIT_NODE_NOT_DEAD 2309
#define NDBD_EXIT_SR_REDOLOG 2310
/*
#define NDBD_EXIT_SR_RESTARTCONFLICT 2311
*/
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313
#define NDBD_EXIT_MEMALLOC 2327
#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334
#define NDBD_EXIT_TIME_QUEUE_SHORT 2335
#define NDBD_EXIT_TIME_QUEUE_LONG 2336
#define NDBD_EXIT_TIME_QUEUE_DELAY 2337
#define NDBD_EXIT_TIME_QUEUE_INDEX 2338
#define NDBD_EXIT_BLOCK_BNR_ZERO 2339
#define NDBD_EXIT_WRONG_PRIO_LEVEL 2340
#define NDBD_EXIT_NDBREQUIRE 2341
#define NDBD_EXIT_ERROR_INSERT 2342
#define NDBD_EXIT_NDBASSERT 2343
#define NDBD_EXIT_INVALID_CONFIG 2350
#define NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY 2351
#define NDBD_EXIT_OS_SIGNAL_RECEIVED 6000
/* VM 6050-> */
#define NDBD_EXIT_WATCHDOG_TERMINATE 6050
#define NDBD_EXIT_SIGNAL_LOST 6051
#define NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL 6052
#define NDBD_EXIT_ILLEGAL_SIGNAL 6053
/* NDBCNTR 6100-> */
#define NDBD_EXIT_RESTART_TIMEOUT 6100
/* TC 6200-> */
/* DIH 6300-> */
#define NDBD_EXIT_MAX_CRASHED_REPLICAS 6300
#define NDBD_EXIT_MASTER_FAILURE_DURING_NR 6301
#define NDBD_EXIT_LOST_NODE_GROUP 6302
#define NDBD_EXIT_NO_RESTORABLE_REPLICA 6303
/* ACC 6600-> */
#define NDBD_EXIT_SR_OUT_OF_INDEXMEMORY 6600
/* TUP 6800-> */
#define NDBD_EXIT_SR_OUT_OF_DATAMEMORY 6800
/* LQH 7200-> */
/* Errorcodes for NDB filesystem */
#define NDBD_EXIT_AFS_NOPATH 2801
/*
#define NDBD_EXIT_AFS_CHANNALFULL 2802
#define NDBD_EXIT_AFS_NOMORETHREADS 2803
*/
#define NDBD_EXIT_AFS_PARAMETER 2804
#define NDBD_EXIT_AFS_INVALIDPATH 2805
#define NDBD_EXIT_AFS_MAXOPEN 2806
#define NDBD_EXIT_AFS_ALREADY_OPEN 2807
#define NDBD_EXIT_AFS_ENVIRONMENT 2808
#define NDBD_EXIT_AFS_TEMP_NO_ACCESS 2809
#define NDBD_EXIT_AFS_DISK_FULL 2810
#define NDBD_EXIT_AFS_PERMISSION_DENIED 2811
#define NDBD_EXIT_AFS_INVALID_PARAM 2812
#define NDBD_EXIT_AFS_UNKNOWN 2813
#define NDBD_EXIT_AFS_NO_MORE_RESOURCES 2814
#define NDBD_EXIT_AFS_NO_SUCH_FILE 2815
#define NDBD_EXIT_AFS_READ_UNDERFLOW 2816
const char *
ndbd_exit_message(int faultId, ndbd_exit_classification *cl);
const char *
ndbd_exit_classification_message(ndbd_exit_classification classification,
ndbd_exit_status *status);
const char *
ndbd_exit_status_message(ndbd_exit_status status);
#endif
#ifdef __cplusplus
}
#endif
#endif /* NDBD_EXIT_CODES_H */

View file

@ -0,0 +1,251 @@
/* Copyright (C) 2003 MySQL 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndbd_exit_codes.h>
typedef struct ErrStruct {
int faultId;
ndbd_exit_classification classification;
const char* text;
} ErrStruct;
/**
* Shorter names in table below
*/
#define XST_S ndbd_exit_st_success
#define XST_U ndbd_exit_st_unknown
#define XST_P ndbd_exit_st_permanent
#define XST_R ndbd_exit_st_temporary
#define XST_I ndbd_exit_st_filesystem_error
#define XNE ndbd_exit_cl_none
#define XUE ndbd_exit_cl_unknown
#define XIE ndbd_exit_cl_internal_error
#define XCE ndbd_exit_cl_configuration_error
#define XAE ndbd_exit_cl_arbitration_error
#define XRE ndbd_exit_cl_restart_error
#define XCR ndbd_exit_cl_resource_configuration_error
#define XFF ndbd_exit_cl_filesystem_full_error
#define XFI ndbd_exit_cl_filesystem_inconsistency_error
#define XFL ndbd_exit_cl_filesystem_limit
static const ErrStruct errArray[] =
{
{NDBD_EXIT_PRGERR, XIE, "Assertion"},
{NDBD_EXIT_NODE_NOT_IN_CONFIG, XCE,
"node id in the configuration has the wrong type, (i.e. not an NDB node)"},
{NDBD_EXIT_SYSTEM_ERROR, XIE,
"System error, node killed during node restart by other node"},
{NDBD_EXIT_INDEX_NOTINRANGE, XIE, "Array index out of range"},
{NDBD_EXIT_ARBIT_SHUTDOWN, XAE, "Arbitrator shutdown, "
"please investigate error(s) on other node(s)"},
{NDBD_EXIT_POINTER_NOTINRANGE, XIE, "Pointer too large"},
{NDBD_EXIT_SR_OTHERNODEFAILED, XRE, "Another node failed during system "
"restart, please investigate error(s) on other node(s)"},
{NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, "
"most probably resolved by restarting node again"},
{NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"},
/* Currently unused? */
{2311, XIE, "Conflict when selecting restart type"},
{NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
"No more free UNDO log, increase UndoIndexBuffer"},
{NDBD_EXIT_SR_UNDOLOG, XFI,
"Error while reading the datapages and UNDO log"},
{NDBD_EXIT_MEMALLOC, XCE, "Memory allocation failure, "
"please decrease some configuration parameters"},
{NDBD_EXIT_BLOCK_JBUFCONGESTION, XIE, "Job buffer congestion"},
{NDBD_EXIT_TIME_QUEUE_SHORT, XIE, "Error in short time queue"},
{NDBD_EXIT_TIME_QUEUE_LONG, XIE, "Error in long time queue"},
{NDBD_EXIT_TIME_QUEUE_DELAY, XIE, "Error in time queue, too long delay"},
{NDBD_EXIT_TIME_QUEUE_INDEX, XIE, "Time queue index out of range"},
{NDBD_EXIT_BLOCK_BNR_ZERO, XIE, "Send signal error"},
{NDBD_EXIT_WRONG_PRIO_LEVEL, XIE, "Wrong priority level when sending signal"},
{NDBD_EXIT_NDBREQUIRE, XIE, "Internal program error (failed ndbrequire)"},
{NDBD_EXIT_NDBASSERT, XIE, "Internal program error (failed ndbassert)"},
{NDBD_EXIT_ERROR_INSERT, XNE, "Error insert executed" },
/* this error message is complemented by additional info when generated */
{NDBD_EXIT_INVALID_CONFIG, XCE,
"Invalid configuration received from Management Server"},
/* this error message is complemented by additional info when
generated, such as signal, and text
*/
{NDBD_EXIT_OS_SIGNAL_RECEIVED, XIE, "Error OS signal received"},
/* VM */
{NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY, XCR,
"Signal lost, out of long signal memory, please increase LongMessageBuffer"},
{NDBD_EXIT_WATCHDOG_TERMINATE, XIE, "WatchDog terminate, internal error "
"or massive overload on the machine running this node"},
{NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, XCR,
"Signal lost, out of send buffer memory, please increase SendBufferMemory"},
{NDBD_EXIT_SIGNAL_LOST, XIE, "Signal lost (unknown reason)"},
{NDBD_EXIT_ILLEGAL_SIGNAL, XIE,
"Illegal signal (version mismatch a possibility)"},
/* Ndbcntr */
{NDBD_EXIT_RESTART_TIMEOUT, XCE,
"Total restart time too long, consider increasing StartFailureTimeout "
"or investigate error(s) on other node(s)"},
/* DIH */
{NDBD_EXIT_MAX_CRASHED_REPLICAS, XFL,
"Too many crashed replicas (8 consecutive node restart failures)"},
{NDBD_EXIT_MASTER_FAILURE_DURING_NR, XRE,
"Unhandled master failure during node restart"},
{NDBD_EXIT_LOST_NODE_GROUP, XAE,
"All nodes in a node group are unavailable"},
{NDBD_EXIT_NO_RESTORABLE_REPLICA, XFI,
"Unable to find a restorable replica"},
/* ACC */
{NDBD_EXIT_SR_OUT_OF_INDEXMEMORY, XCR,
"Out of index memory during system restart, please increase IndexMemory"},
/* TUP */
{NDBD_EXIT_SR_OUT_OF_DATAMEMORY, XCR,
"Out of data memory during system restart, please increase DataMemory"},
/* Ndbfs error messages */
/* Most codes will have additional info, such as OS error code */
{NDBD_EXIT_AFS_NOPATH, XIE, "No file system path"},
{2802, XIE, "Channel is full"},
{2803, XIE, "No more threads"},
{NDBD_EXIT_AFS_PARAMETER, XIE, "Bad parameter"},
{NDBD_EXIT_AFS_INVALIDPATH, XCE, "Illegal file system path"},
{NDBD_EXIT_AFS_MAXOPEN, XCR,
"Max number of open files exceeded, please increase MaxNoOfOpenFiles"},
{NDBD_EXIT_AFS_ALREADY_OPEN, XIE, "File has already been opened"},
{NDBD_EXIT_AFS_ENVIRONMENT , XIE, "Environment error using file"},
{NDBD_EXIT_AFS_TEMP_NO_ACCESS , XIE, "Temporary on access to file"},
{NDBD_EXIT_AFS_DISK_FULL , XFF, "The file system is full"},
{NDBD_EXIT_AFS_PERMISSION_DENIED , XCE, "Received permission denied for file"},
{NDBD_EXIT_AFS_INVALID_PARAM , XCE, "Invalid parameter for file"},
{NDBD_EXIT_AFS_UNKNOWN , XIE, "Unknown file system error"},
{NDBD_EXIT_AFS_NO_MORE_RESOURCES , XIE,
"System reports no more file system resources"},
{NDBD_EXIT_AFS_NO_SUCH_FILE , XFI, "File not found"},
{NDBD_EXIT_AFS_READ_UNDERFLOW , XFI, "Read underflow"},
/* Sentinel */
{0, XUE,
"No message slogan found (please report a bug if you get this error code)"}
};
typedef struct StatusExitMessage {
ndbd_exit_status status;
const char * message;
} StatusExitMessage;
typedef struct StatusExitClassification {
ndbd_exit_status status;
ndbd_exit_classification classification;
const char * message;
} StatusExitClassification;
/**
* Mapping between classification and status
*/
static
const
StatusExitMessage StatusExitMessageMapping[] = {
{ XST_S, "Success"},
{ XST_U ,"Unknown"},
{ XST_P, "Permanent error, external action needed"},
{ XST_R, "Temporary error, restart node"},
{ XST_I, "Ndbd file system error, restart node initial"}
};
static
const
int NbExitStatus = sizeof(StatusExitMessageMapping)/sizeof(StatusExitMessage);
static
const
StatusExitClassification StatusExitClassificationMapping[] = {
{ XST_S, XNE, "No error"},
{ XST_U, XUE, "Unknown"},
{ XST_R, XIE, "Internal error, programming error or missing error message, "
"please report a bug"},
{ XST_P, XCE, "Configuration error"},
{ XST_R, XAE, "Arbitration error"},
{ XST_R, XRE, "Restart error"},
{ XST_P, XCR, "Resource configuration error"},
{ XST_P, XFF, "File system full"},
{ XST_I, XFI, "Ndbd file system inconsistency error, please report a bug"},
{ XST_I, XFL, "Ndbd file system limit exceeded"}
};
static const int NbExitClassification =
sizeof(StatusExitClassificationMapping)/sizeof(StatusExitClassification);
const char *ndbd_exit_message(int faultId, ndbd_exit_classification *cl)
{
int i = 0;
while (errArray[i].faultId != faultId && errArray[i].faultId != 0)
i++;
*cl = errArray[i].classification;
return errArray[i].text;
}
static const char* empty_xstring = "";
const
char *ndbd_exit_classification_message(ndbd_exit_classification classification,
ndbd_exit_status *status)
{
int i;
for (i= 0; i < NbExitClassification; i++)
{
if (StatusExitClassificationMapping[i].classification == classification)
{
*status = StatusExitClassificationMapping[i].status;
return StatusExitClassificationMapping[i].message;
}
}
*status = XST_U;
return empty_xstring;
}
const char *ndbd_exit_status_message(ndbd_exit_status status)
{
int i;
for (i= 0; i < NbExitStatus; i++)
if (StatusExitMessageMapping[i].status == status)
return StatusExitMessageMapping[i].message;
return empty_xstring;
}
int ndbd_exit_string(int err_no, char *str, unsigned int size)
{
unsigned int len;
ndbd_exit_classification cl;
ndbd_exit_status st;
const char *msg = ndbd_exit_message(err_no, &cl);
if (msg[0] != '\0')
{
const char *cl_msg = ndbd_exit_classification_message(cl, &st);
const char *st_msg = ndbd_exit_status_message(st);
len = my_snprintf(str, size-1, "%s: %s: %s", msg, st_msg, cl_msg);
str[size-1]= '\0';
return len;
}
return -1;
}

View file

@ -0,0 +1,63 @@
/* Copyright (C) 2003 MySQL 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include "ndbd_malloc.hpp"
#include <NdbMem.h>
//#define TRACE_MALLOC
#ifdef TRACE_MALLOC
#include <stdio.h>
#endif
static void xxx(size_t size, size_t *s_m, size_t *s_k, size_t *s_b)
{
*s_m = size/1024/1024;
*s_k = (size - *s_m*1024*1024)/1024;
*s_b = size - *s_m*1024*1024-*s_k*1024;
}
static Uint64 g_allocated_memory;
void *ndbd_malloc(size_t size)
{
void *p = NdbMem_Allocate(size);
if (p)
{
g_allocated_memory += size;
#ifdef TRACE_MALLOC
{
size_t s_m, s_k, s_b;
xxx(size, &s_m, &s_k, &s_b);
fprintf(stderr, "%p malloc(%um %uk %ub)", p, s_m, s_k, s_b);
xxx(g_allocated_memory, &s_m, &s_k, &s_b);
fprintf(stderr, "\t\ttotal(%um %uk %ub)\n", s_m, s_k, s_b);
}
#endif
}
return p;
}
void ndbd_free(void *p, size_t size)
{
NdbMem_Free(p);
if (p)
{
g_allocated_memory -= size;
#ifdef TRACE_MALLOC
fprintf(stderr, "%p free(%d)\n", p, size);
#endif
}
}

View file

@ -14,9 +14,13 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef ERROR_MESSAGES_H #ifndef NDBD_MALLOC_H
#define ERROR_MESSAGES_H #define NDBD_MALLOC_H
const char* lookupErrorMessage(int faultId); /**
* common memory allocation function for ndbd kernel
*/
void *ndbd_malloc(size_t size);
void ndbd_free(void *p, size_t size);
#endif #endif

View file

@ -0,0 +1,179 @@
use strict;
use IO::Socket;
use DBI;
# mgm info
my $mgmhost = "localhost";
my $mgmport = 38101;
# location of ndb_x_fs
my $datadir = "c2";
my @schemafiles = <$datadir/ndb_*_fs/D[12]/DBDICT/P0.SchemaLog>;
@schemafiles or die "no schemafiles in $datadir";
my $dsn;
$dsn = "dbi:mysql:test:localhost;port=38100";
# this works better for me
my $cnf = $ENV{MYSQL_HOME} . "/var/my.cnf";
$dsn = "dbi:mysql:database=test;host=localhost;mysql_read_default_file=$cnf";
my $dbh;
$dbh = DBI->connect($dsn, 'root', undef, { RaiseError => 0, PrintError => 0 });
$dbh or die $DBI::errstr;
# mgm commands
my $mgm = undef;
sub mgmconnect {
$mgm = IO::Socket::INET->new(
Proto => "tcp",
PeerHost => $mgmhost,
PeerPort => $mgmport);
$mgm or die "connect to mgm failed: $!";
$mgm->autoflush(1);
};
mgmconnect();
warn "connected to mgm $mgmhost $mgmport\n";
my $nodeinfo = {};
sub getnodeinfo {
$nodeinfo = {};
$mgm->print("get status\n");
$mgm->print("\n");
while (defined($_ = $mgm->getline)) {
/^node\s+status/ && last;
}
while (defined($_ = $mgm->getline)) {
/^\s*$/ && last;
/^node\.(\d+)\.(\w+):\s*(\S+)/ && ($nodeinfo->{$1}{$2} = $3);
}
}
getnodeinfo();
my @dbnode = ();
for my $n (keys %$nodeinfo) {
my $p = $nodeinfo->{$n};
($p->{type} eq 'NDB') && push(@dbnode, $n);
}
@dbnode = sort { $a <=> $b } @dbnode;
@dbnode or die "mgm error, found no db nodes";
warn "db nodes: @dbnode\n";
sub restartnode {
my($n, $initialstart) = @_;
warn "restart node $n initialstart=$initialstart\n";
$mgm->print("restart node\n");
$mgm->print("node: $n\n");
$mgm->print("initialstart: $initialstart\n");
$mgm->print("\n");
while (1) {
sleep 5;
getnodeinfo();
my $status = $nodeinfo->{$n}{status};
my $sp = $nodeinfo->{$n}{startphase};
warn "node $n status: $status sp: $sp\n";
last if $status eq 'STARTED';
}
}
sub restartall {
warn "restart all\n";
$mgm->print("restart all\n");
$mgm->print("\n");
while (1) {
sleep 5;
getnodeinfo();
my $ok = 1;
for my $n (@dbnode) {
my $status = $nodeinfo->{$n}{status};
my $sp = $nodeinfo->{$n}{startphase};
warn "node $n status: $status sp: $sp\n";
$ok = 0 if $status ne 'STARTED';
}
last if $ok;
}
}
# the sql stuff
my $maxtab = 300;
my @tab = ();
sub create {
my($n) = @_;
my $sql = "create table t$n (a int primary key, b varchar(20), key (b)) engine=ndb";
warn "create t$n\n";
$dbh->do($sql) or die "$sql\n$DBI::errstr";
}
sub drop {
my($n) = @_;
my $sql = "drop table t$n";
warn "drop t$n\n";
$dbh->do($sql) or die "$sql\n$DBI::errstr";
}
sub dropall {
for my $n (0..($maxtab-1)) {
my $sql = "drop table if exists t$n";
$dbh->do($sql) or die "$sql\n$DBI::errstr";
}
}
sub createdrop {
my $n = int(rand($maxtab));
if (! $tab[$n]) {
create($n);
$tab[$n] = 1;
} else {
drop($n);
$tab[$n] = 0;
}
}
sub checkschemafiles {
system("printSchemaFile -ce @schemafiles");
$? == 0 or die "schemafiles check failed";
}
sub randomrestart {
my($k) = @_;
my $s = int(rand(500));
if ($s < 2) {
my $i = $k % scalar(@dbnode);
my $n = $dbnode[$i];
my $initialstart = ($s < 1 ? 0 : 1);
restartnode($n, $initialstart);
return 1;
}
if ($s < 3) {
restartall();
return 1;
}
return 0;
}
# deterministic
srand(1);
warn "drop any old tables\n";
dropall();
my $loop = 1000000;
for my $k (0..($loop-1)) {
warn "$k\n";
createdrop();
checkschemafiles();
if (randomrestart($k)) {
checkschemafiles();
}
}
$dbh->disconnect or die $DBI::errstr;
# vim: set sw=2:

View file

@ -5772,7 +5772,8 @@ ha_innobase::get_foreign_key_create_info(void)
fclose(file); fclose(file);
} else { } else {
/* unable to create temporary file */ /* unable to create temporary file */
str = my_malloc(1, MYF(MY_ZEROFILL)); str = my_strdup(
"/* Error: cannot display foreign key constraints */", MYF(0));
} }
return(str); return(str);

View file

@ -2958,9 +2958,9 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
String *escape_str= escape_item->val_str(&tmp_value1); String *escape_str= escape_item->val_str(&tmp_value1);
if (escape_str) if (escape_str)
{ {
CHARSET_INFO *cs= cmp.cmp_collation.collation; if (use_mb(cmp.cmp_collation.collation))
if (use_mb(cs))
{ {
CHARSET_INFO *cs= escape_str->charset();
my_wc_t wc; my_wc_t wc;
int rc= cs->cset->mb_wc(cs, &wc, int rc= cs->cset->mb_wc(cs, &wc,
(const uchar*) escape_str->ptr(), (const uchar*) escape_str->ptr(),
@ -2975,6 +2975,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
code instead of Unicode code as "escape" argument. code instead of Unicode code as "escape" argument.
Convert to "cs" if charset of escape differs. Convert to "cs" if charset of escape differs.
*/ */
CHARSET_INFO *cs= cmp.cmp_collation.collation;
uint32 unused; uint32 unused;
if (escape_str->needs_conversion(escape_str->length(), if (escape_str->needs_conversion(escape_str->length(),
escape_str->charset(), cs, &unused)) escape_str->charset(), cs, &unused))

View file

@ -67,7 +67,7 @@ handlerton binlog_hton = {
NULL, /* rollback_by_xid */ NULL, /* rollback_by_xid */
NULL, /* create_cursor_read_view */ NULL, /* create_cursor_read_view */
NULL, /* set_cursor_read_view */ NULL, /* set_cursor_read_view */
NULL, /* close_cursor_read_view */ NULL, /* close_cursor_read_view */
HTON_NO_FLAGS HTON_NO_FLAGS
}; };
@ -79,7 +79,7 @@ handlerton binlog_hton = {
bool binlog_init() bool binlog_init()
{ {
return false; return !opt_bin_log;
} }
static int binlog_close_connection(THD *thd) static int binlog_close_connection(THD *thd)

View file

@ -631,7 +631,21 @@ os_fast_mutex_free(
DeleteCriticalSection((LPCRITICAL_SECTION) fast_mutex); DeleteCriticalSection((LPCRITICAL_SECTION) fast_mutex);
#else #else
ut_a(0 == pthread_mutex_destroy(fast_mutex)); int ret;
ret = pthread_mutex_destroy(fast_mutex);
if (ret != 0) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: error: return value %lu when calling\n"
"InnoDB: pthread_mutex_destroy().\n", (ulint)ret);
fprintf(stderr,
"InnoDB: Byte contents of the pthread mutex at %p:\n", fast_mutex);
ut_print_buf(stderr, (const byte*)fast_mutex,
sizeof(os_fast_mutex_t));
fprintf(stderr, "\n");
}
#endif #endif
if (os_sync_mutex_inited) { if (os_sync_mutex_inited) {
/* When freeing the last mutexes, we have /* When freeing the last mutexes, we have

View file

@ -34,7 +34,8 @@ mgmapi/mgmapi.h \
mgmapi/mgmapi_debug.h \ mgmapi/mgmapi_debug.h \
mgmapi/mgmapi_config_parameters.h \ mgmapi/mgmapi_config_parameters.h \
mgmapi/mgmapi_config_parameters_debug.h \ mgmapi/mgmapi_config_parameters_debug.h \
mgmapi/ndb_logevent.h mgmapi/ndb_logevent.h \
mgmapi/ndbd_exit_codes.h
noinst_HEADERS = \ noinst_HEADERS = \
ndb_global.h \ ndb_global.h \

View file

@ -17,6 +17,7 @@
#ifndef FS_REF_H #ifndef FS_REF_H
#define FS_REF_H #define FS_REF_H
#include <ndbd_exit_codes.h>
#include "SignalData.hpp" #include "SignalData.hpp"
/** /**
@ -37,17 +38,15 @@ struct FsRef {
*/ */
enum NdbfsErrorCodeType { enum NdbfsErrorCodeType {
fsErrNone=0, fsErrNone=0,
fsErrHardwareFailed=1, fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT,
fsErrUserError=2, fsErrTemporaryNotAccessible=NDBD_EXIT_AFS_TEMP_NO_ACCESS,
fsErrEnvironmentError=3, fsErrNoSpaceLeftOnDevice=NDBD_EXIT_AFS_DISK_FULL,
fsErrTemporaryNotAccessible=4, fsErrPermissionDenied=NDBD_EXIT_AFS_PERMISSION_DENIED,
fsErrNoSpaceLeftOnDevice=5, fsErrInvalidParameters=NDBD_EXIT_AFS_INVALID_PARAM,
fsErrPermissionDenied=6, fsErrUnknown=NDBD_EXIT_AFS_UNKNOWN,
fsErrInvalidParameters=7, fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES,
fsErrUnknown=8, fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE,
fsErrNoMoreResources=9, fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW,
fsErrFileDoesNotExist=10,
fsErrReadUnderflow = 11,
fsErrMax fsErrMax
}; };
/** /**

View file

@ -41,10 +41,7 @@ public:
STATIC_CONST( SignalLength = 4 ); STATIC_CONST( SignalLength = 4 );
enum ErrorCode { enum ErrorCode {
ScanfragStateError = 1,
ScanfragTimeout = 2,
GCPStopDetected = 3, GCPStopDetected = 3,
StartInProgressError = 4,
CopyFragRefError = 5, CopyFragRefError = 5,
TestStopOnError = 6 TestStopOnError = 6
}; };

View file

@ -1021,6 +1021,8 @@ extern "C" {
int param, const char ** value); int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
int ndb_mgm_check_connection(NdbMgmHandle handle); int ndb_mgm_check_connection(NdbMgmHandle handle);
int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length);
#endif #endif
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED

View file

@ -76,6 +76,10 @@ extern "C" {
/** NDB_MGM_EVENT_CATEGORY_STARTUP */ /** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_NDBStopStarted = 17, NDB_LE_NDBStopStarted = 17,
/** NDB_MGM_EVENT_CATEGORY_STARTUP */ /** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_NDBStopCompleted = 53,
/** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_NDBStopForced = 59,
/** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_NDBStopAborted = 18, NDB_LE_NDBStopAborted = 18,
/** NDB_MGM_EVENT_CATEGORY_STARTUP */ /** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_StartREDOLog = 19, NDB_LE_StartREDOLog = 19,
@ -148,9 +152,12 @@ extern "C" {
/** NDB_MGM_EVENT_CATEGORY_INFO */ /** NDB_MGM_EVENT_CATEGORY_INFO */
NDB_LE_InfoEvent = 49, NDB_LE_InfoEvent = 49,
/* 50 used */
/* 51 used */
/* SINGLE USER */ /* SINGLE USER */
NDB_LE_SingleUser = 52, NDB_LE_SingleUser = 52,
/* NDB_LE_ UNUSED = 53, */ /* 53 used */
/** NDB_MGM_EVENT_CATEGORY_BACKUP */ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_BackupStarted = 54, NDB_LE_BackupStarted = 54,
@ -164,6 +171,11 @@ extern "C" {
/** NDB_MGM_EVENT_CATEGORY_INFO */ /** NDB_MGM_EVENT_CATEGORY_INFO */
NDB_LE_EventBufferStatus = 58 NDB_LE_EventBufferStatus = 58
/* 59 used */
/* 60 unused */
/* 61 unused */
/* 62 unused */
}; };
/** /**
@ -392,6 +404,19 @@ extern "C" {
unsigned stoptype; unsigned stoptype;
} NDBStopStarted; } NDBStopStarted;
/** Log event specific data for for corresponding NDB_LE_ log event */ /** Log event specific data for for corresponding NDB_LE_ log event */
struct {
unsigned action;
unsigned signum;
} NDBStopCompleted;
/** Log event specific data for for corresponding NDB_LE_ log event */
struct {
unsigned action;
unsigned signum;
unsigned error;
unsigned sphase;
unsigned extra;
} NDBStopForced;
/** Log event specific data for for corresponding NDB_LE_ log event */
struct { struct {
} NDBStopAborted; } NDBStopAborted;
/** Log event specific data for for corresponding NDB_LE_ log event */ /** Log event specific data for for corresponding NDB_LE_ log event */

View file

@ -24,6 +24,8 @@
#include <NodeState.hpp> #include <NodeState.hpp>
#include <version.h> #include <version.h>
#include <ndbd_exit_codes.h>
// //
// PUBLIC // PUBLIC
// //
@ -83,6 +85,57 @@ void getTextNDBStopStarted(QQQQ) {
"%s shutdown initiated", "%s shutdown initiated",
(theData[1] == 1 ? "Cluster" : "Node")); (theData[1] == 1 ? "Cluster" : "Node"));
} }
void getRestartAction(Uint32 action, BaseString &str)
{
if (action == 0)
return;
str.appfmt(", restarting");
if (action & 2)
str.appfmt(", no start");
if (action & 4)
str.appfmt(", initial");
}
void getTextNDBStopCompleted(QQQQ) {
BaseString action_str("");
BaseString signum_str("");
getRestartAction(theData[1], action_str);
if (theData[2])
signum_str.appfmt(" Initiated by signal %d.", theData[2]);
BaseString::snprintf(m_text, m_text_len,
"Node shutdown completed%s.%s",
action_str.c_str(),
signum_str.c_str());
}
void getTextNDBStopForced(QQQQ) {
BaseString action_str("");
BaseString reason_str("");
BaseString sphase_str("");
int signum = theData[2];
int error = theData[3];
int sphase = theData[4];
int extra = theData[5];
getRestartAction(theData[1],action_str);
if (signal)
reason_str.appfmt(" Initiated by signal %d.", signum);
if (error)
{
ndbd_exit_classification cl;
ndbd_exit_status st;
const char *msg = ndbd_exit_message(error, &cl);
const char *cl_msg = ndbd_exit_classification_message(cl, &st);
const char *st_msg = ndbd_exit_status_message(st);
reason_str.appfmt(" Caused by error %d: \'%s(%s). %s\'.",
error, msg, cl_msg, st_msg);
if (extra != 0)
reason_str.appfmt(" (extra info %d)", extra);
}
if (sphase < 255)
sphase_str.appfmt(" Occured during startphase %u.", sphase);
BaseString::snprintf(m_text, m_text_len,
"Forced node shutdown completed%s.%s%s",
action_str.c_str(), sphase_str.c_str(),
reason_str.c_str());
}
void getTextNDBStopAborted(QQQQ) { void getTextNDBStopAborted(QQQQ) {
BaseString::snprintf(m_text, m_text_len, BaseString::snprintf(m_text, m_text_len,
"Node shutdown aborted"); "Node shutdown aborted");
@ -732,6 +785,8 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(CM_REGREF, LogLevel::llStartUp, 8, Logger::LL_INFO ), ROW(CM_REGREF, LogLevel::llStartUp, 8, Logger::LL_INFO ),
ROW(FIND_NEIGHBOURS, LogLevel::llStartUp, 8, Logger::LL_INFO ), ROW(FIND_NEIGHBOURS, LogLevel::llStartUp, 8, Logger::LL_INFO ),
ROW(NDBStopStarted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopStarted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ),
ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(StartREDOLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartREDOLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),

View file

@ -30,42 +30,13 @@ printFSREF(FILE * output, const Uint32 * theData,
sig->userPointer); sig->userPointer);
fprintf(output, " ErrorCode: %d, ", sig->errorCode); fprintf(output, " ErrorCode: %d, ", sig->errorCode);
ndbd_exit_classification cl;
switch (sig->getErrorCode(sig->errorCode)){ switch (sig->getErrorCode(sig->errorCode)){
case FsRef::fsErrNone: case FsRef::fsErrNone:
fprintf(output, "No error"); fprintf(output, "No error");
break; break;
case FsRef::fsErrHardwareFailed:
fprintf(output, "Hardware failure!");
break;
case FsRef::fsErrUserError:
fprintf(output, "User error!");
break;
case FsRef::fsErrEnvironmentError:
fprintf(output, "Environment error!");
break;
case FsRef::fsErrTemporaryNotAccessible:
fprintf(output, "Temporary not accesible!");
break;
case FsRef::fsErrNoSpaceLeftOnDevice:
fprintf(output, "No space left on device!");
break;
case FsRef::fsErrPermissionDenied:
fprintf(output, "Permission denied!");
break;
case FsRef::fsErrInvalidParameters:
fprintf(output, "Invalid parameters!");
break;
case FsRef::fsErrNoMoreResources:
fprintf(output, "No more resources!");
break;
case FsRef::fsErrFileDoesNotExist:
fprintf(output, "File does not exist!");
break;
case FsRef::fsErrUnknown:
default: default:
fprintf(output, "Unknown!"); fprintf(output, ndbd_exit_message(sig->getErrorCode(sig->errorCode), &cl));
ret = false;
break; break;
} }
fprintf(output, "\n"); fprintf(output, "\n");

View file

@ -72,6 +72,106 @@ static Uint32 g_TypeOfStart = NodeState::ST_ILLEGAL_TYPE;
#define SEND_BACKUP_STARTED_FLAG(A) (((A) & 0x3) > 0) #define SEND_BACKUP_STARTED_FLAG(A) (((A) & 0x3) > 0)
#define SEND_BACKUP_COMPLETED_FLAG(A) (((A) & 0x3) > 1) #define SEND_BACKUP_COMPLETED_FLAG(A) (((A) & 0x3) > 1)
void
Backup::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
c_nodePool.setSize(MAX_NDB_NODES);
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless));
ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
// ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
noAttribs++; //RT 527 bug fix
c_backupPool.setSize(noBackups);
c_backupFilePool.setSize(3 * noBackups);
c_tablePool.setSize(noBackups * noTables);
c_attributePool.setSize(noBackups * noAttribs);
c_triggerPool.setSize(noBackups * 3 * noTables);
// 2 = no of replicas
c_fragmentPool.setSize(noBackups * 2 * NO_OF_FRAG_PER_NODE * noTables);
Uint32 szMem = 0;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
Uint32 noPages = (szMem + sizeof(Page32) - 1) / sizeof(Page32);
// We need to allocate an additional of 2 pages. 1 page because of a bug in
// ArrayPool and another one for DICTTAINFO.
c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2);
Uint32 szDataBuf = (2 * 1024 * 1024);
Uint32 szLogBuf = (2 * 1024 * 1024);
Uint32 szWrite = 32768;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite);
c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf;
c_defaults.m_minWriteSize = szWrite;
c_defaults.m_maxWriteSize = szWrite;
{ // Init all tables
ArrayList<Table> tables(c_tablePool);
TablePtr ptr;
while(tables.seize(ptr)){
new (ptr.p) Table(c_attributePool, c_fragmentPool);
}
tables.release();
}
{
ArrayList<BackupFile> ops(c_backupFilePool);
BackupFilePtr ptr;
while(ops.seize(ptr)){
new (ptr.p) BackupFile(* this, c_pagePool);
}
ops.release();
}
{
ArrayList<BackupRecord> recs(c_backupPool);
BackupRecordPtr ptr;
while(recs.seize(ptr)){
new (ptr.p) BackupRecord(* this, c_pagePool, c_tablePool,
c_backupFilePool, c_triggerPool);
}
recs.release();
}
// Initialize BAT for interface to file system
{
Page32Ptr p;
ndbrequire(c_pagePool.seizeId(p, 0));
c_startOfPages = (Uint32 *)p.p;
c_pagePool.release(p);
NewVARIABLE* bat = allocateBat(1);
bat[0].WA = c_startOfPages;
bat[0].nrr = c_pagePool.getSize()*sizeof(Page32)/sizeof(Uint32);
}
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void void
Backup::execSTTOR(Signal* signal) Backup::execSTTOR(Signal* signal)
{ {

View file

@ -46,6 +46,7 @@ public:
protected: protected:
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);
void execREAD_NODESCONF(Signal* signal); void execREAD_NODESCONF(Signal* signal);
void execNODE_FAILREP(Signal* signal); void execNODE_FAILREP(Signal* signal);

View file

@ -34,90 +34,10 @@ Backup::Backup(const Configuration & conf) :
{ {
BLOCK_CONSTRUCTOR(Backup); BLOCK_CONSTRUCTOR(Backup);
c_nodePool.setSize(MAX_NDB_NODES);
c_masterNodeId = getOwnNodeId(); c_masterNodeId = getOwnNodeId();
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless));
ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
// ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
noAttribs++; //RT 527 bug fix
c_backupPool.setSize(noBackups);
c_backupFilePool.setSize(3 * noBackups);
c_tablePool.setSize(noBackups * noTables);
c_attributePool.setSize(noBackups * noAttribs);
c_triggerPool.setSize(noBackups * 3 * noTables);
// 2 = no of replicas
c_fragmentPool.setSize(noBackups * 2 * NO_OF_FRAG_PER_NODE * noTables);
Uint32 szMem = 0;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
Uint32 noPages = (szMem + sizeof(Page32) - 1) / sizeof(Page32);
// We need to allocate an additional of 2 pages. 1 page because of a bug in
// ArrayPool and another one for DICTTAINFO.
c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2);
Uint32 szDataBuf = (2 * 1024 * 1024);
Uint32 szLogBuf = (2 * 1024 * 1024);
Uint32 szWrite = 32768;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite);
c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf;
c_defaults.m_minWriteSize = szWrite;
c_defaults.m_maxWriteSize = szWrite;
{ // Init all tables
ArrayList<Table> tables(c_tablePool);
TablePtr ptr;
while(tables.seize(ptr)){
new (ptr.p) Table(c_attributePool, c_fragmentPool);
}
tables.release();
}
{
ArrayList<BackupFile> ops(c_backupFilePool);
BackupFilePtr ptr;
while(ops.seize(ptr)){
new (ptr.p) BackupFile(* this, c_pagePool);
}
ops.release();
}
{
ArrayList<BackupRecord> recs(c_backupPool);
BackupRecordPtr ptr;
while(recs.seize(ptr)){
new (ptr.p) BackupRecord(* this, c_pagePool, c_tablePool,
c_backupFilePool, c_triggerPool);
}
recs.release();
}
// Initialize BAT for interface to file system
{
Page32Ptr p;
ndbrequire(c_pagePool.seizeId(p, 0));
c_startOfPages = (Uint32 *)p.p;
c_pagePool.release(p);
NewVARIABLE* bat = allocateBat(1);
bat[0].WA = c_startOfPages;
bat[0].nrr = c_pagePool.getSize()*sizeof(Page32)/sizeof(Uint32);
}
// Add received signals // Add received signals
addRecSignal(GSN_READ_CONFIG_REQ, &Backup::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &Backup::execSTTOR); addRecSignal(GSN_STTOR, &Backup::execSTTOR);
addRecSignal(GSN_DUMP_STATE_ORD, &Backup::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &Backup::execDUMP_STATE_ORD);
addRecSignal(GSN_READ_NODESCONF, &Backup::execREAD_NODESCONF); addRecSignal(GSN_READ_NODESCONF, &Backup::execREAD_NODESCONF);

View file

@ -72,6 +72,7 @@ Cmvmi::Cmvmi(const Configuration & conf) :
addRecSignal(GSN_SET_LOGLEVELORD, &Cmvmi::execSET_LOGLEVELORD); addRecSignal(GSN_SET_LOGLEVELORD, &Cmvmi::execSET_LOGLEVELORD);
addRecSignal(GSN_EVENT_REP, &Cmvmi::execEVENT_REP); addRecSignal(GSN_EVENT_REP, &Cmvmi::execEVENT_REP);
addRecSignal(GSN_STTOR, &Cmvmi::execSTTOR); addRecSignal(GSN_STTOR, &Cmvmi::execSTTOR);
addRecSignal(GSN_READ_CONFIG_REQ, &Cmvmi::execREAD_CONFIG_REQ);
addRecSignal(GSN_CLOSE_COMREQ, &Cmvmi::execCLOSE_COMREQ); addRecSignal(GSN_CLOSE_COMREQ, &Cmvmi::execCLOSE_COMREQ);
addRecSignal(GSN_ENABLE_COMORD, &Cmvmi::execENABLE_COMORD); addRecSignal(GSN_ENABLE_COMORD, &Cmvmi::execENABLE_COMORD);
addRecSignal(GSN_OPEN_COMREQ, &Cmvmi::execOPEN_COMREQ); addRecSignal(GSN_OPEN_COMREQ, &Cmvmi::execOPEN_COMREQ);
@ -306,6 +307,27 @@ void Cmvmi::sendSTTORRY(Signal* signal)
}//Cmvmi::sendSTTORRY }//Cmvmi::sendSTTORRY
void
Cmvmi::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void Cmvmi::execSTTOR(Signal* signal) void Cmvmi::execSTTOR(Signal* signal)
{ {
Uint32 theStartPhase = signal->theData[1]; Uint32 theStartPhase = signal->theData[1];

View file

@ -48,6 +48,7 @@ private:
void execNDB_TAMPER(Signal* signal); void execNDB_TAMPER(Signal* signal);
void execSET_LOGLEVELORD(Signal* signal); void execSET_LOGLEVELORD(Signal* signal);
void execEVENT_REP(Signal* signal); void execEVENT_REP(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execCLOSE_COMREQ(Signal* signal); void execCLOSE_COMREQ(Signal* signal);
void execENABLE_COMORD(Signal* signal); void execENABLE_COMORD(Signal* signal);

View file

@ -1071,7 +1071,7 @@ private:
void seizeRootfragrec(Signal* signal); void seizeRootfragrec(Signal* signal);
void seizeScanRec(Signal* signal); void seizeScanRec(Signal* signal);
void seizeSrVerRec(Signal* signal); void seizeSrVerRec(Signal* signal);
void sendSystemerror(Signal* signal); void sendSystemerror(Signal* signal, int line);
void takeRecOutOfFreeOverdir(Signal* signal); void takeRecOutOfFreeOverdir(Signal* signal);
void takeRecOutOfFreeOverpage(Signal* signal); void takeRecOutOfFreeOverpage(Signal* signal);
void sendScanHbRep(Signal* signal, Uint32); void sendScanHbRep(Signal* signal, Uint32);

View file

@ -59,10 +59,24 @@ void Dbacc::initData()
void Dbacc::initRecords() void Dbacc::initRecords()
{ {
// Records with dynamic sizes // Records with dynamic sizes
page8 = (Page8*)allocRecord("Page8",
sizeof(Page8),
cpagesize,
false);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
coprecsize);
dirRange = (DirRange*)allocRecord("DirRange", dirRange = (DirRange*)allocRecord("DirRange",
sizeof(DirRange), sizeof(DirRange),
cdirrangesize); cdirrangesize);
undopage = (Undopage*)allocRecord("Undopage",
sizeof(Undopage),
cundopagesize,
false);
directoryarray = (Directoryarray*)allocRecord("Directoryarray", directoryarray = (Directoryarray*)allocRecord("Directoryarray",
sizeof(Directoryarray), sizeof(Directoryarray),
cdirarraysize); cdirarraysize);
@ -83,19 +97,10 @@ void Dbacc::initRecords()
sizeof(LcpConnectrec), sizeof(LcpConnectrec),
clcpConnectsize); clcpConnectsize);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
coprecsize);
overflowRecord = (OverflowRecord*)allocRecord("OverflowRecord", overflowRecord = (OverflowRecord*)allocRecord("OverflowRecord",
sizeof(OverflowRecord), sizeof(OverflowRecord),
coverflowrecsize); coverflowrecsize);
page8 = (Page8*)allocRecord("Page8",
sizeof(Page8),
cpagesize,
false);
rootfragmentrec = (Rootfragmentrec*)allocRecord("Rootfragmentrec", rootfragmentrec = (Rootfragmentrec*)allocRecord("Rootfragmentrec",
sizeof(Rootfragmentrec), sizeof(Rootfragmentrec),
crootfragmentsize); crootfragmentsize);
@ -112,11 +117,6 @@ void Dbacc::initRecords()
sizeof(Tabrec), sizeof(Tabrec),
ctablesize); ctablesize);
undopage = (Undopage*)allocRecord("Undopage",
sizeof(Undopage),
cundopagesize,
false);
// Initialize BAT for interface to file system // Initialize BAT for interface to file system
NewVARIABLE* bat = allocateBat(3); NewVARIABLE* bat = allocateBat(3);
@ -136,25 +136,8 @@ Dbacc::Dbacc(const class Configuration & conf):
SimulatedBlock(DBACC, conf), SimulatedBlock(DBACC, conf),
c_tup(0) c_tup(0)
{ {
Uint32 log_page_size= 0;
BLOCK_CONSTRUCTOR(Dbacc); BLOCK_CONSTRUCTOR(Dbacc);
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
ndb_mgm_get_int_parameter(p, CFG_DB_UNDO_INDEX_BUFFER,
&log_page_size);
/**
* Always set page size in half MBytes
*/
cundopagesize= (log_page_size / sizeof(Undopage));
Uint32 mega_byte_part= cundopagesize & 15;
if (mega_byte_part != 0) {
jam();
cundopagesize+= (16 - mega_byte_part);
}
// Transit signals // Transit signals
addRecSignal(GSN_DUMP_STATE_ORD, &Dbacc::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &Dbacc::execDUMP_STATE_ORD);
addRecSignal(GSN_DEBUG_SIG, &Dbacc::execDEBUG_SIG); addRecSignal(GSN_DEBUG_SIG, &Dbacc::execDEBUG_SIG);

View file

@ -55,8 +55,7 @@ Dbacc::remainingUndoPages(){
// There can not be more than cundopagesize remaining // There can not be more than cundopagesize remaining
if (Remaining <= 0){ if (Remaining <= 0){
// No more undolog, crash node // No more undolog, crash node
progError(__LINE__, progError(__LINE__, NDBD_EXIT_NO_MORE_UNDOLOG,
ERR_NO_MORE_UNDOLOG,
"There are more than 1Mbyte undolog writes outstanding"); "There are more than 1Mbyte undolog writes outstanding");
} }
return Remaining; return Remaining;
@ -679,6 +678,20 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* signal)
theConfiguration.getOwnConfigIterator(); theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0); ndbrequire(p != 0);
Uint32 log_page_size= 0;
ndb_mgm_get_int_parameter(p, CFG_DB_UNDO_INDEX_BUFFER,
&log_page_size);
/**
* Always set page size in half MBytes
*/
cundopagesize= (log_page_size / sizeof(Undopage));
Uint32 mega_byte_part= cundopagesize & 15;
if (mega_byte_part != 0) {
jam();
cundopagesize+= (16 - mega_byte_part);
}
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_RANGE, &cdirrangesize)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_RANGE, &cdirrangesize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_ARRAY, &cdirarraysize)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_DIR_ARRAY, &cdirarraysize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_FRAGMENT, &cfragmentsize)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_ACC_FRAGMENT, &cfragmentsize));
@ -5303,8 +5316,7 @@ void Dbacc::execDEBUG_SIG(Signal* signal)
jamEntry(); jamEntry();
expPageptr.i = signal->theData[0]; expPageptr.i = signal->theData[0];
progError(__LINE__, progError(__LINE__, NDBD_EXIT_SR_UNDOLOG);
ERR_SR_UNDOLOG);
return; return;
}//Dbacc::execDEBUG_SIG() }//Dbacc::execDEBUG_SIG()
@ -5617,7 +5629,7 @@ Uint32 Dbacc::checkScanShrink(Signal* signal)
//------------------------------------------------------------- //-------------------------------------------------------------
} else { } else {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return TreturnCode; return TreturnCode;
}//if }//if
}//if }//if
@ -6045,7 +6057,7 @@ void Dbacc::shrinkcontainer(Signal* signal)
fragrecptr.p->expReceiveForward = tidrForward; fragrecptr.p->expReceiveForward = tidrForward;
if (tshrRemLen < tshrInc) { if (tshrRemLen < tshrInc) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
tshrRemLen = tshrRemLen - tshrInc; tshrRemLen = tshrRemLen - tshrInc;
if (tshrRemLen != 0) { if (tshrRemLen != 0) {
@ -6080,7 +6092,7 @@ void Dbacc::nextcontainerinfoExp(Signal* signal)
cexcForward = cminusOne; cexcForward = cminusOne;
} else { } else {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
cexcForward = 0; /* DUMMY FOR COMPILER */ cexcForward = 0; /* DUMMY FOR COMPILER */
}//if }//if
if (tnciNextSamePage == ZFALSE) { if (tnciNextSamePage == ZFALSE) {
@ -6579,7 +6591,7 @@ void Dbacc::execACC_SAVE_PAGES(Signal* signal)
ptrCheckGuard(lcpConnectptr, clcpConnectsize, lcpConnectrec); ptrCheckGuard(lcpConnectptr, clcpConnectsize, lcpConnectrec);
if (lcpConnectptr.p->lcpstate != LCP_ACTIVE) { if (lcpConnectptr.p->lcpstate != LCP_ACTIVE) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return; return;
}//if }//if
if (ERROR_INSERTED(3000)) { if (ERROR_INSERTED(3000)) {
@ -6765,7 +6777,7 @@ void Dbacc::saveOverPagesLab(Signal* signal)
releaseOverpage(signal); releaseOverpage(signal);
} else { } else {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
} }
}//if }//if
} }
@ -6905,7 +6917,7 @@ void Dbacc::checkSyncUndoPagesLab(Signal* signal)
break; break;
default: default:
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -7188,7 +7200,7 @@ void Dbacc::lcpCopyPage(Signal* signal)
/*empty*/; /*empty*/;
} else { } else {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return; return;
}//if }//if
/*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/
@ -7209,7 +7221,7 @@ void Dbacc::lcpCopyPage(Signal* signal)
/*empty*/; /*empty*/;
} else { } else {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return; return;
}//if }//if
lcnCopyPageptr.p->word32[ZPOS_CHECKSUM] = tlcnChecksum; lcnCopyPageptr.p->word32[ZPOS_CHECKSUM] = tlcnChecksum;
@ -7256,7 +7268,7 @@ void Dbacc::lcpUpdatePage(Signal* signal)
}//while }//while
if (tlupConLen < ZCON_HEAD_SIZE) { if (tlupConLen < ZCON_HEAD_SIZE) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
}//Dbacc::lcpUpdatePage() }//Dbacc::lcpUpdatePage()
@ -7529,7 +7541,7 @@ void Dbacc::undoWritingProcess(Signal* signal)
/* ONLY PAGE INFO AND OVERFLOW PAGE INFO CAN BE LOGGED BY THIS ROUTINE. A */ /* ONLY PAGE INFO AND OVERFLOW PAGE INFO CAN BE LOGGED BY THIS ROUTINE. A */
/* SERIOUS ERROR. */ /* SERIOUS ERROR. */
/* --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- */
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
} }
} else { } else {
if (fragrecptr.p->fragState == LCP_SEND_OVER_PAGES) { if (fragrecptr.p->fragState == LCP_SEND_OVER_PAGES) {
@ -8159,7 +8171,7 @@ void Dbacc::srReadPagesLab(Signal* signal)
for (Uint32 i = 0; i < limitLoop; i++) { for (Uint32 i = 0; i < limitLoop; i++) {
jam(); jam();
seizePage(signal); seizePage(signal);
ndbrequire(tresult <= ZLIMIT_OF_ERROR); ndbrequireErr(tresult <= ZLIMIT_OF_ERROR, NDBD_EXIT_SR_OUT_OF_INDEXMEMORY);
fragrecptr.p->datapages[i] = spPageptr.i; fragrecptr.p->datapages[i] = spPageptr.i;
signal->theData[i + 6] = spPageptr.i; signal->theData[i + 6] = spPageptr.i;
}//for }//for
@ -8532,7 +8544,7 @@ void Dbacc::startActiveUndo(Signal* signal)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (cfsFirstfreeconnect == RNIL) { if (cfsFirstfreeconnect == RNIL) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
seizeFsConnectRec(signal); seizeFsConnectRec(signal);
cactiveSrFsPtr = fsConnectptr.i; cactiveSrFsPtr = fsConnectptr.i;
@ -8709,7 +8721,8 @@ void Dbacc::srDoUndoLab(Signal* signal)
ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec); ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec);
} else { } else {
jam(); jam();
progError(__LINE__, 0, "Invalid local fragment id in undo log"); progError(__LINE__, NDBD_EXIT_SR_UNDOLOG,
"Invalid local fragment id in undo log");
return; return;
}//if }//if
}//if }//if
@ -8886,7 +8899,7 @@ void Dbacc::srDoUndoLab(Signal* signal)
default: default:
jam(); jam();
progError(__LINE__, 0, "Invalid pagetype in undo log"); progError(__LINE__, NDBD_EXIT_SR_UNDOLOG, "Invalid pagetype in undo log");
break; break;
}//switch(tpageType) }//switch(tpageType)
@ -9356,7 +9369,7 @@ void Dbacc::checkNextBucketLab(Signal* signal)
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */
if (scanPtr.p->minBucketIndexToRescan != 0) { if (scanPtr.p->minBucketIndexToRescan != 0) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
return; return;
}//if }//if
scanPtr.p->maxBucketIndexToRescan = fragrecptr.p->p + fragrecptr.p->maxp; scanPtr.p->maxBucketIndexToRescan = fragrecptr.p->p + fragrecptr.p->maxp;
@ -9521,7 +9534,7 @@ void Dbacc::checkNextFragmentLab(Signal* signal)
} else { } else {
jam(); jam();
/* ALL ELEMENTS ARE SENT */ /* ALL ELEMENTS ARE SENT */
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
}//if }//if
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */
@ -10119,7 +10132,7 @@ void Dbacc::releaseScanContainer(Signal* signal)
if (trscContainerlen < 4) { if (trscContainerlen < 4) {
if (trscContainerlen != ZCON_HEAD_SIZE) { if (trscContainerlen != ZCON_HEAD_SIZE) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
return; /* 2 IS THE MINIMUM SIZE OF THE ELEMENT */ return; /* 2 IS THE MINIMUM SIZE OF THE ELEMENT */
}//if }//if
@ -10154,7 +10167,7 @@ void Dbacc::releaseScanContainer(Signal* signal)
} while (trscElemlens > 1); } while (trscElemlens > 1);
if (trscElemlens != 0) { if (trscElemlens != 0) {
jam(); jam();
sendSystemerror(signal); sendSystemerror(signal, __LINE__);
}//if }//if
}//Dbacc::releaseScanContainer() }//Dbacc::releaseScanContainer()
@ -11271,9 +11284,9 @@ void Dbacc::seizeSrVerRec(Signal* signal)
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */
/* SEND_SYSTEMERROR */ /* SEND_SYSTEMERROR */
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */
void Dbacc::sendSystemerror(Signal* signal) void Dbacc::sendSystemerror(Signal* signal, int line)
{ {
progError(0, 0); progError(line, NDBD_EXIT_PRGERR);
}//Dbacc::sendSystemerror() }//Dbacc::sendSystemerror()
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */

View file

@ -5401,7 +5401,10 @@ void Dbdict::execWAIT_GCP_REF(Signal* signal)
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
// Error Handling code needed // Error Handling code needed
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
progError(ref->errorCode, 0); char buf[32];
BaseString::snprintf(buf, sizeof(buf), "WAIT_GCP_REF ErrorCode=%d",
ref->errorCode);
progError(__LINE__, NDBD_EXIT_NDBREQUIRE, buf);
}//execWAIT_GCP_REF() }//execWAIT_GCP_REF()

View file

@ -262,8 +262,6 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_CREATE_FRAGMENTATION_REQ, addRecSignal(GSN_CREATE_FRAGMENTATION_REQ,
&Dbdih::execCREATE_FRAGMENTATION_REQ); &Dbdih::execCREATE_FRAGMENTATION_REQ);
initData();
}//Dbdih::Dbdih() }//Dbdih::Dbdih()
Dbdih::~Dbdih() Dbdih::~Dbdih()

View file

@ -1051,17 +1051,25 @@ void Dbdih::execREAD_CONFIG_REQ(Signal* signal)
const ndb_mgm_configuration_iterator * p = const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator(); theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0); ndbrequireErr(p != 0, NDBD_EXIT_INVALID_CONFIG);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_API_CONNECT, initData();
&capiConnectFileSize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_CONNECT,&cconnectFileSize)); ndbrequireErr(!ndb_mgm_get_int_parameter(p, CFG_DIH_API_CONNECT,
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT, &capiConnectFileSize),
&cfragstoreFileSize)); NDBD_EXIT_INVALID_CONFIG);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_REPLICAS, ndbrequireErr(!ndb_mgm_get_int_parameter(p, CFG_DIH_CONNECT,
&creplicaFileSize)); &cconnectFileSize),
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_TABLE, &ctabFileSize)) NDBD_EXIT_INVALID_CONFIG);
cfileFileSize = (2 * ctabFileSize) + 2; ndbrequireErr(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT,
&cfragstoreFileSize),
NDBD_EXIT_INVALID_CONFIG);
ndbrequireErr(!ndb_mgm_get_int_parameter(p, CFG_DIH_REPLICAS,
&creplicaFileSize),
NDBD_EXIT_INVALID_CONFIG);
ndbrequireErr(!ndb_mgm_get_int_parameter(p, CFG_DIH_TABLE, &ctabFileSize),
NDBD_EXIT_INVALID_CONFIG);
cfileFileSize = (2 * ctabFileSize) + 2;
initRecords(); initRecords();
initialiseRecordsLab(signal, 0, ref, senderData); initialiseRecordsLab(signal, 0, ref, senderData);
return; return;
@ -1465,9 +1473,7 @@ void Dbdih::execREAD_NODESCONF(Signal* signal)
"Illegal configuration change." "Illegal configuration change."
" Initial start needs to be performed " " Initial start needs to be performed "
" when changing no of storage nodes (node %d)", i); " when changing no of storage nodes (node %d)", i);
progError(__LINE__, progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf);
ERR_INVALID_CONFIG,
buf);
} }
} }
@ -3528,9 +3534,7 @@ void Dbdih::selectMasterCandidateAndSend(Signal* signal)
" Initial start needs to be performed " " Initial start needs to be performed "
" when changing no of replicas (%d != %d)", " when changing no of replicas (%d != %d)",
node_groups[nodePtr.i], cnoReplicas); node_groups[nodePtr.i], cnoReplicas);
progError(__LINE__, progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf);
ERR_INVALID_CONFIG,
buf);
} }
} }
}//Dbdih::selectMasterCandidate() }//Dbdih::selectMasterCandidate()
@ -3811,9 +3815,7 @@ void Dbdih::execNODE_FAILREP(Signal* signal)
if(getNodeState().getNodeRestartInProgress()){ if(getNodeState().getNodeRestartInProgress()){
jam(); jam();
progError(__LINE__, progError(__LINE__, NDBD_EXIT_MASTER_FAILURE_DURING_NR);
ERR_SYSTEM_ERROR,
"Unhandle master failure during node restart");
} }
} }
@ -8263,7 +8265,7 @@ Dbdih::resetReplicaSr(TabRecordPtr tabPtr){
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
/* THE NODE IS ALIVE AND KICKING AND ACTIVE, LET'S USE IT. */ /* THE NODE IS ALIVE AND KICKING AND ACTIVE, LET'S USE IT. */
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
arrGuard(noCrashedReplicas, 8); arrGuardErr(noCrashedReplicas, 8, NDBD_EXIT_MAX_CRASHED_REPLICAS);
Uint32 lastGci = replicaPtr.p->replicaLastGci[noCrashedReplicas]; Uint32 lastGci = replicaPtr.p->replicaLastGci[noCrashedReplicas];
if(lastGci >= newestRestorableGCI){ if(lastGci >= newestRestorableGCI){
jam(); jam();
@ -8736,14 +8738,10 @@ void Dbdih::startFragment(Signal* signal, Uint32 tableId, Uint32 fragId)
/* THIS WILL DECREASE THE GCI TO RESTORE WHICH HOPEFULLY WILL MAKE IT */ /* THIS WILL DECREASE THE GCI TO RESTORE WHICH HOPEFULLY WILL MAKE IT */
/* POSSIBLE TO RESTORE THE SYSTEM. */ /* POSSIBLE TO RESTORE THE SYSTEM. */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
char buf[100]; char buf[64];
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf), "table: %d fragment: %d gci: %d",
"Unable to find restorable replica for " tableId, fragId, SYSFILE->newestRestorableGCI);
"table: %d fragment: %d gci: %d", progError(__LINE__, NDBD_EXIT_NO_RESTORABLE_REPLICA, buf);
tableId, fragId, SYSFILE->newestRestorableGCI);
progError(__LINE__,
ERR_SYSTEM_ERROR,
buf);
ndbrequire(false); ndbrequire(false);
return; return;
}//if }//if
@ -10591,7 +10589,7 @@ void Dbdih::calculateHotSpare()
break; break;
default: default:
jam(); jam();
progError(0, 0); ndbrequire(false);
break; break;
}//switch }//switch
}//Dbdih::calculateHotSpare() }//Dbdih::calculateHotSpare()
@ -10624,7 +10622,7 @@ void Dbdih::checkEscalation()
jam(); jam();
if (TnodeGroup[i] == ZFALSE) { if (TnodeGroup[i] == ZFALSE) {
jam(); jam();
progError(__LINE__, ERR_SYSTEM_ERROR, "Lost node group"); progError(__LINE__, NDBD_EXIT_LOST_NODE_GROUP, "Lost node group");
}//if }//if
}//for }//for
}//Dbdih::checkEscalation() }//Dbdih::checkEscalation()

View file

@ -2412,7 +2412,7 @@ private:
void startNextExecSr(Signal* signal); void startNextExecSr(Signal* signal);
void startTimeSupervision(Signal* signal); void startTimeSupervision(Signal* signal);
void stepAhead(Signal* signal, Uint32 stepAheadWords); void stepAhead(Signal* signal, Uint32 stepAheadWords);
void systemError(Signal* signal); void systemError(Signal* signal, int line);
void writeAbortLog(Signal* signal); void writeAbortLog(Signal* signal);
void writeCommitLog(Signal* signal, LogPartRecordPtr regLogPartPtr); void writeCommitLog(Signal* signal, LogPartRecordPtr regLogPartPtr);
void writeCompletedGciLog(Signal* signal); void writeCompletedGciLog(Signal* signal);
@ -2431,7 +2431,7 @@ private:
Uint32 calcPageCheckSum(LogPageRecordPtr logP); Uint32 calcPageCheckSum(LogPageRecordPtr logP);
// Generated statement blocks // Generated statement blocks
void systemErrorLab(Signal* signal); void systemErrorLab(Signal* signal, int line);
void initFourth(Signal* signal); void initFourth(Signal* signal);
void packLqhkeyreqLab(Signal* signal); void packLqhkeyreqLab(Signal* signal);
void sendNdbSttorryLab(Signal* signal); void sendNdbSttorryLab(Signal* signal);
@ -2441,7 +2441,6 @@ private:
void srLogLimits(Signal* signal); void srLogLimits(Signal* signal);
void srGciLimits(Signal* signal); void srGciLimits(Signal* signal);
void srPhase3Start(Signal* signal); void srPhase3Start(Signal* signal);
void warningHandlerLab(Signal* signal);
void checkStartCompletedLab(Signal* signal); void checkStartCompletedLab(Signal* signal);
void continueAbortLab(Signal* signal); void continueAbortLab(Signal* signal);
void abortContinueAfterBlockedLab(Signal* signal, bool canBlock); void abortContinueAfterBlockedLab(Signal* signal, bool canBlock);

View file

@ -168,11 +168,11 @@ void Dblqh::execTUP_COM_UNBLOCK(Signal* signal)
/* ------- SEND SYSTEM ERROR ------- */ /* ------- SEND SYSTEM ERROR ------- */
/* */ /* */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
void Dblqh::systemError(Signal* signal) void Dblqh::systemError(Signal* signal, int line)
{ {
signal->theData[0] = 2304; signal->theData[0] = 2304;
execDUMP_STATE_ORD(signal); execDUMP_STATE_ORD(signal);
progError(0, 0); progError(line, NDBD_EXIT_NDBREQUIRE);
}//Dblqh::systemError() }//Dblqh::systemError()
/* *************** */ /* *************** */
@ -5130,7 +5130,7 @@ void Dblqh::errorReport(Signal* signal, int place)
jam(); jam();
break; break;
}//switch }//switch
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dblqh::errorReport() }//Dblqh::errorReport()
@ -5191,7 +5191,7 @@ void Dblqh::execCOMMITREQ(Signal* signal)
Uint32 transid2 = signal->theData[4]; Uint32 transid2 = signal->theData[4];
Uint32 tcOprec = signal->theData[6]; Uint32 tcOprec = signal->theData[6];
if (ERROR_INSERTED(5004)) { if (ERROR_INSERTED(5004)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
} }
if (ERROR_INSERTED(5017)) { if (ERROR_INSERTED(5017)) {
CLEAR_ERROR_INSERT_VALUE; CLEAR_ERROR_INSERT_VALUE;
@ -5313,7 +5313,7 @@ void Dblqh::execCOMPLETEREQ(Signal* signal)
Uint32 transid2 = signal->theData[3]; Uint32 transid2 = signal->theData[3];
Uint32 tcOprec = signal->theData[5]; Uint32 tcOprec = signal->theData[5];
if (ERROR_INSERTED(5005)) { if (ERROR_INSERTED(5005)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
} }
if (ERROR_INSERTED(5018)) { if (ERROR_INSERTED(5018)) {
CLEAR_ERROR_INSERT_VALUE; CLEAR_ERROR_INSERT_VALUE;
@ -5944,7 +5944,7 @@ void Dblqh::execABORTREQ(Signal* signal)
Uint32 transid2 = signal->theData[3]; Uint32 transid2 = signal->theData[3];
Uint32 tcOprec = signal->theData[5]; Uint32 tcOprec = signal->theData[5];
if (ERROR_INSERTED(5006)) { if (ERROR_INSERTED(5006)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
} }
if (ERROR_INSERTED(5016)) { if (ERROR_INSERTED(5016)) {
CLEAR_ERROR_INSERT_VALUE; CLEAR_ERROR_INSERT_VALUE;
@ -6755,7 +6755,7 @@ void Dblqh::lqhTransNextLab(Signal* signal)
/* ------------------------------------------------------------ /* ------------------------------------------------------------
* THIS IS AN ERROR THAT SHOULD NOT OCCUR. WE CRASH THE SYSTEM. * THIS IS AN ERROR THAT SHOULD NOT OCCUR. WE CRASH THE SYSTEM.
* ------------------------------------------------------------ */ * ------------------------------------------------------------ */
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
}//if }//if
@ -6932,7 +6932,7 @@ void Dblqh::execNEXT_SCANCONF(Signal* signal)
void Dblqh::execNEXT_SCANREF(Signal* signal) void Dblqh::execNEXT_SCANREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dblqh::execNEXT_SCANREF() }//Dblqh::execNEXT_SCANREF()
@ -9211,7 +9211,7 @@ void Dblqh::storedProcConfCopyLab(Signal* signal)
jam(); jam();
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -9503,7 +9503,7 @@ void Dblqh::copyCompletedLab(Signal* signal)
// Make sure that something is in progress. Otherwise we will simply stop // Make sure that something is in progress. Otherwise we will simply stop
// and nothing more will happen. // and nothing more will happen.
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
return; return;
@ -9522,7 +9522,7 @@ void Dblqh::nextRecordCopy(Signal* signal)
// scans on the same record and this will certainly lead to unexpected // scans on the same record and this will certainly lead to unexpected
// behaviour. // behaviour.
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
scanptr.p->scanState = ScanRecord::WAIT_NEXT_SCAN_COPY; scanptr.p->scanState = ScanRecord::WAIT_NEXT_SCAN_COPY;
@ -9549,7 +9549,7 @@ void Dblqh::nextRecordCopy(Signal* signal)
jam(); jam();
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -9623,7 +9623,7 @@ void Dblqh::closeCopyLab(Signal* signal)
jam(); jam();
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -10644,7 +10644,7 @@ void Dblqh::restartOperationsAfterStopLab(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -11468,7 +11468,7 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal)
const GCPSaveReq * const saveReq = (GCPSaveReq *)&signal->theData[0]; const GCPSaveReq * const saveReq = (GCPSaveReq *)&signal->theData[0];
if (ERROR_INSERTED(5000)) { if (ERROR_INSERTED(5000)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
} }
if (ERROR_INSERTED(5007)){ if (ERROR_INSERTED(5007)){
@ -11834,7 +11834,7 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
return; return;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dblqh::execFSCLOSECONF() }//Dblqh::execFSCLOSECONF()
@ -11909,7 +11909,7 @@ void Dblqh::execFSOPENCONF(Signal* signal)
return; return;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dblqh::execFSOPENCONF() }//Dblqh::execFSOPENCONF()
@ -11968,7 +11968,7 @@ void Dblqh::execFSREADCONF(Signal* signal)
return; return;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dblqh::execFSREADCONF() }//Dblqh::execFSREADCONF()
@ -12070,7 +12070,7 @@ void Dblqh::execFSWRITECONF(Signal* signal)
return; return;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dblqh::execFSWRITECONF() }//Dblqh::execFSWRITECONF()
@ -12114,7 +12114,7 @@ void Dblqh::execFSWRITEREF(Signal* signal)
break; break;
case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES: case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
default: default:
jam(); jam();
break; break;
@ -12328,7 +12328,7 @@ void Dblqh::writeLogfileLab(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -13562,7 +13562,7 @@ void Dblqh::execACC_SRCONF(Signal* signal)
ptrCheckGuard(lcpLocptr, clcpLocrecFileSize, lcpLocRecord); ptrCheckGuard(lcpLocptr, clcpLocrecFileSize, lcpLocRecord);
if (lcpLocptr.p->lcpLocstate != LcpLocRecord::SR_ACC_STARTED) { if (lcpLocptr.p->lcpLocstate != LcpLocRecord::SR_ACC_STARTED) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
@ -13584,7 +13584,7 @@ void Dblqh::execACC_SRREF(Signal* signal)
{ {
jamEntry(); jamEntry();
terrorCode = signal->theData[1]; terrorCode = signal->theData[1];
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dblqh::execACC_SRREF() }//Dblqh::execACC_SRREF()
@ -13724,7 +13724,7 @@ void Dblqh::execTUP_SRREF(Signal* signal)
{ {
jamEntry(); jamEntry();
terrorCode = signal->theData[1]; terrorCode = signal->theData[1];
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dblqh::execTUP_SRREF() }//Dblqh::execTUP_SRREF()
@ -14024,7 +14024,7 @@ void Dblqh::execEXEC_FRAGREF(Signal* signal)
{ {
jamEntry(); jamEntry();
terrorCode = signal->theData[1]; terrorCode = signal->theData[1];
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dblqh::execEXEC_FRAGREF() }//Dblqh::execEXEC_FRAGREF()
@ -14116,7 +14116,7 @@ void Dblqh::execSrCompletedLab(Signal* signal)
* PROBLEM. THIS SHOULD NOT OCCUR. IF IT OCCURS ANYWAY THEN WE * PROBLEM. THIS SHOULD NOT OCCUR. IF IT OCCURS ANYWAY THEN WE
* HAVE TO FIND A CURE FOR THIS PROBLEM. * HAVE TO FIND A CURE FOR THIS PROBLEM.
* ----------------------------------------------------------------- */ * ----------------------------------------------------------------- */
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
signal->theData[0] = ZSR_LOG_LIMITS; signal->theData[0] = ZSR_LOG_LIMITS;
@ -14643,7 +14643,7 @@ void Dblqh::execSr(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -14922,7 +14922,7 @@ void Dblqh::execDEBUG_SIG(Signal* signal)
signal->theData[2], signal->theData[3], signal->theData[4], signal->theData[2], signal->theData[3], signal->theData[4],
signal->theData[5], signal->theData[6], signal->theData[7]); signal->theData[5], signal->theData[6], signal->theData[7]);
progError(__LINE__, ERR_SR_REDOLOG, buf); progError(__LINE__, NDBD_EXIT_SR_REDOLOG, buf);
return; return;
}//Dblqh::execDEBUG_SIG() }//Dblqh::execDEBUG_SIG()
@ -14994,12 +14994,12 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
jam(); jam();
if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG_INVALIDATE) { if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG_INVALIDATE) {
jam(); jam();
systemError(signal); systemError(signal, __LINE__);
} }
if (logFilePtr.p->fileNo != logPartPtr.p->invalidateFileNo) { if (logFilePtr.p->fileNo != logPartPtr.p->invalidateFileNo) {
jam(); jam();
systemError(signal); systemError(signal, __LINE__);
} }
switch (lfoPtr.p->lfoState) { switch (lfoPtr.p->lfoState) {
@ -15054,7 +15054,7 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
default: default:
jam(); jam();
systemError(signal); systemError(signal, __LINE__);
return; return;
break; break;
} }
@ -15202,7 +15202,7 @@ void Dblqh::execLogComp(Signal* signal)
if (logPartPtr.p->logPartState != LogPartRecord::SR_THIRD_PHASE_COMPLETED) { if (logPartPtr.p->logPartState != LogPartRecord::SR_THIRD_PHASE_COMPLETED) {
if (logPartPtr.p->logPartState != LogPartRecord::SR_THIRD_PHASE_STARTED) { if (logPartPtr.p->logPartState != LogPartRecord::SR_THIRD_PHASE_STARTED) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
} else { } else {
jam(); jam();
@ -15460,7 +15460,7 @@ void Dblqh::openSrFourthZeroSkipInitLab(Signal* signal)
* THE HEADER PAGE IN THE LOG IS PAGE ZERO IN FILE ZERO. * THE HEADER PAGE IN THE LOG IS PAGE ZERO IN FILE ZERO.
* THIS SHOULD NEVER OCCUR. * THIS SHOULD NEVER OCCUR.
* ------------------------------------------------------------------- */ * ------------------------------------------------------------------- */
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
}//if }//if
@ -15514,7 +15514,7 @@ void Dblqh::srFourthComp(Signal* signal)
if (logPartPtr.p->logPartState != LogPartRecord::SR_FOURTH_PHASE_COMPLETED) { if (logPartPtr.p->logPartState != LogPartRecord::SR_FOURTH_PHASE_COMPLETED) {
if (logPartPtr.p->logPartState != LogPartRecord::SR_FOURTH_PHASE_STARTED) { if (logPartPtr.p->logPartState != LogPartRecord::SR_FOURTH_PHASE_STARTED) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
} else { } else {
jam(); jam();
@ -15575,11 +15575,6 @@ void Dblqh::srFourthComp(Signal* signal)
/* ####### ERROR MODULE ####### */ /* ####### ERROR MODULE ####### */
/* */ /* */
/* ######################################################################### */ /* ######################################################################### */
void Dblqh::warningHandlerLab(Signal* signal)
{
systemErrorLab(signal);
return;
}//Dblqh::warningHandlerLab()
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* AN ERROR OCCURRED THAT WE WILL NOT TREAT AS SYSTEM ERROR. MOST OFTEN THIS */ /* AN ERROR OCCURRED THAT WE WILL NOT TREAT AS SYSTEM ERROR. MOST OFTEN THIS */
@ -15600,10 +15595,10 @@ void Dblqh::warningHandlerLab(Signal* signal)
/* THE COMMIT, COMPLETE OR ABORT PHASE, WE PERFORM A CRASH OF THE AXE VM*/ /* THE COMMIT, COMPLETE OR ABORT PHASE, WE PERFORM A CRASH OF THE AXE VM*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void Dblqh::systemErrorLab(Signal* signal) void Dblqh::systemErrorLab(Signal* signal, int line)
{ {
systemError(signal); systemError(signal, line);
progError(0, 0); progError(line, NDBD_EXIT_NDBREQUIRE);
/*************************************************************************>*/ /*************************************************************************>*/
/* WE WANT TO INVOKE AN IMMEDIATE ERROR HERE SO WE GET THAT BY */ /* WE WANT TO INVOKE AN IMMEDIATE ERROR HERE SO WE GET THAT BY */
/* INSERTING A CERTAIN POINTER OUT OF RANGE. */ /* INSERTING A CERTAIN POINTER OUT OF RANGE. */
@ -15812,7 +15807,7 @@ void Dblqh::buildLinkedLogPageList(Signal* signal)
// Uint32 checkSum = bllLogPagePtr.p->logPageWord[ZPOS_CHECKSUM]; // Uint32 checkSum = bllLogPagePtr.p->logPageWord[ZPOS_CHECKSUM];
// if (checkSum != calcCheckSum) { // if (checkSum != calcCheckSum) {
// ndbout << "Redolog: Checksum failure." << endl; // ndbout << "Redolog: Checksum failure." << endl;
// progError(__LINE__, ERR_NDBREQUIRE, "Redolog: Checksum failure."); // progError(__LINE__, NDBD_EXIT_NDBREQUIRE, "Redolog: Checksum failure.");
// } // }
// #endif // #endif
@ -15938,7 +15933,7 @@ CSC_ACC_DOWHILE:
jam(); jam();
if (cscLcpLocptr.p->lcpLocstate != LcpLocRecord::SR_ACC_STARTED) { if (cscLcpLocptr.p->lcpLocstate != LcpLocRecord::SR_ACC_STARTED) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
return; return;
@ -15955,7 +15950,7 @@ CSC_TUP_DOWHILE:
jam(); jam();
if (cscLcpLocptr.p->lcpLocstate != LcpLocRecord::SR_TUP_STARTED) { if (cscLcpLocptr.p->lcpLocstate != LcpLocRecord::SR_TUP_STARTED) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
return; return;
@ -17523,7 +17518,7 @@ void Dblqh::releaseAccList(Signal* signal)
racTcNextConnectptr.i = tcConnectptr.p->nextTc; racTcNextConnectptr.i = tcConnectptr.p->nextTc;
if (tcConnectptr.p->listState != TcConnectionrec::ACC_BLOCK_LIST) { if (tcConnectptr.p->listState != TcConnectionrec::ACC_BLOCK_LIST) {
jam(); jam();
systemError(signal); systemError(signal, __LINE__);
}//if }//if
tcConnectptr.p->listState = TcConnectionrec::NOT_IN_LIST; tcConnectptr.p->listState = TcConnectionrec::NOT_IN_LIST;
if (racTcNextConnectptr.i != RNIL) { if (racTcNextConnectptr.i != RNIL) {
@ -17702,7 +17697,7 @@ void Dblqh::releaseWaitQueue(Signal* signal)
rwaTcNextConnectptr.i = tcConnectptr.p->nextTc; rwaTcNextConnectptr.i = tcConnectptr.p->nextTc;
if (tcConnectptr.p->listState != TcConnectionrec::WAIT_QUEUE_LIST) { if (tcConnectptr.p->listState != TcConnectionrec::WAIT_QUEUE_LIST) {
jam(); jam();
systemError(signal); systemError(signal, __LINE__);
}//if }//if
tcConnectptr.p->listState = TcConnectionrec::NOT_IN_LIST; tcConnectptr.p->listState = TcConnectionrec::NOT_IN_LIST;
if (rwaTcNextConnectptr.i != RNIL) { if (rwaTcNextConnectptr.i != RNIL) {
@ -18266,7 +18261,7 @@ void Dblqh::writeNextLog(Signal* signal)
/* CAN INVOKE THIS SYSTEM CRASH. HOWEVER ONLY */ /* CAN INVOKE THIS SYSTEM CRASH. HOWEVER ONLY */
/* VERY SERIOUS TIMING PROBLEMS. */ /* VERY SERIOUS TIMING PROBLEMS. */
/* -------------------------------------------------- */ /* -------------------------------------------------- */
systemError(signal); systemError(signal, __LINE__);
}//if }//if
}//if }//if
if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) { if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) {
@ -18531,7 +18526,10 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
if(arg== 2305) if(arg== 2305)
{ {
progError(__LINE__, ERR_SYSTEM_ERROR, progError(__LINE__, NDBD_EXIT_SYSTEM_ERROR,
"Please report this as a bug. "
"Provide as much info as possible, expecially all the "
"ndb_*_out.log files, Thanks. "
"Shutting down node due to failed handling of GCP_SAVEREQ"); "Shutting down node due to failed handling of GCP_SAVEREQ");
} }

View file

@ -1472,7 +1472,7 @@ private:
void sendContinueTimeOutControl(Signal* signal, Uint32 TapiConPtr); void sendContinueTimeOutControl(Signal* signal, Uint32 TapiConPtr);
void sendKeyinfo(Signal* signal, BlockReference TBRef, Uint32 len); void sendKeyinfo(Signal* signal, BlockReference TBRef, Uint32 len);
void sendlqhkeyreq(Signal* signal, BlockReference TBRef); void sendlqhkeyreq(Signal* signal, BlockReference TBRef);
void sendSystemError(Signal* signal); void sendSystemError(Signal* signal, int line);
void sendtckeyconf(Signal* signal, UintR TcommitFlag); void sendtckeyconf(Signal* signal, UintR TcommitFlag);
void sendTcIndxConf(Signal* signal, UintR TcommitFlag); void sendTcIndxConf(Signal* signal, UintR TcommitFlag);
void unlinkApiConnect(Signal* signal); void unlinkApiConnect(Signal* signal);
@ -1548,8 +1548,8 @@ private:
bool holdOperation = false); bool holdOperation = false);
void releaseFiredTriggerData(DLFifoList<TcFiredTriggerData>* triggers); void releaseFiredTriggerData(DLFifoList<TcFiredTriggerData>* triggers);
// Generated statement blocks // Generated statement blocks
void warningHandlerLab(Signal* signal); void warningHandlerLab(Signal* signal, int line);
void systemErrorLab(Signal* signal); void systemErrorLab(Signal* signal, int line);
void sendSignalErrorRefuseLab(Signal* signal); void sendSignalErrorRefuseLab(Signal* signal);
void scanTabRefLab(Signal* signal, Uint32 errCode); void scanTabRefLab(Signal* signal, Uint32 errCode);
void diFcountReqLab(Signal* signal, ScanRecordPtr); void diFcountReqLab(Signal* signal, ScanRecordPtr);

View file

@ -291,8 +291,6 @@ Dbtc::Dbtc(const class Configuration & conf):
addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ); addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ);
initData();
#ifdef VM_TRACE #ifdef VM_TRACE
{ {
void* tmp[] = { &apiConnectptr, void* tmp[] = { &apiConnectptr,

View file

@ -608,6 +608,8 @@ void Dbtc::execREAD_CONFIG_REQ(Signal* signal)
theConfiguration.getOwnConfigIterator(); theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0); ndbrequire(p != 0);
initData();
UintR apiConnect; UintR apiConnect;
UintR tcConnect; UintR tcConnect;
UintR tables; UintR tables;
@ -1029,7 +1031,7 @@ Dbtc::handleFailedApiNode(Signal* signal,
/*********************************************************************/ /*********************************************************************/
// Not implemented yet. // Not implemented yet.
/*********************************************************************/ /*********************************************************************/
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
case CS_RESTART: case CS_RESTART:
jam(); jam();
@ -1053,7 +1055,7 @@ Dbtc::handleFailedApiNode(Signal* signal,
/*********************************************************************/ /*********************************************************************/
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
} else { } else {
@ -1392,7 +1394,7 @@ void Dbtc::printState(Signal* signal, int place)
<< " keylen = " << regCachePtr->keylen << endl; << " keylen = " << regCachePtr->keylen << endl;
} else { } else {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
}//if }//if
#endif #endif
@ -1446,7 +1448,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
return; return;
case 6: case 6:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
case 7: case 7:
@ -1467,7 +1469,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 10: case 10:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 11: case 11:
@ -1498,7 +1500,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
/* PARTICULAR TC CONNECT RECORD. THIS MUST BE CAUSED BY NDB */ /* PARTICULAR TC CONNECT RECORD. THIS MUST BE CAUSED BY NDB */
/* INTERNAL ERROR. */ /* INTERNAL ERROR. */
/********************************************************************/ /********************************************************************/
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
return; return;
@ -1511,17 +1513,17 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 16: case 16:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 17: case 17:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 18: case 18:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
case 19: case 19:
@ -1530,22 +1532,22 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 20: case 20:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
case 21: case 21:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 22: case 22:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 23: case 23:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 24: case 24:
@ -1555,7 +1557,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 25: case 25:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
case 26: case 26:
@ -1563,7 +1565,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
return; return;
case 27: case 27:
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
jam(); jam();
return; return;
@ -1574,92 +1576,92 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 29: case 29:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 30: case 30:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 31: case 31:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 32: case 32:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 33: case 33:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 34: case 34:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 35: case 35:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 36: case 36:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 37: case 37:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 38: case 38:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 39: case 39:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 40: case 40:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 41: case 41:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 42: case 42:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 43: case 43:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 44: case 44:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 45: case 45:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 46: case 46:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 47: case 47:
@ -1681,7 +1683,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
case 50: case 50:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
case 51: case 51:
@ -1757,7 +1759,7 @@ Dbtc::TCKEY_abort(Signal* signal, int place)
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
} }
@ -1770,7 +1772,7 @@ void Dbtc::execKEYINFO(Signal* signal)
tmaxData = 20; tmaxData = 20;
if (apiConnectptr.i >= capiConnectFilesize) { if (apiConnectptr.i >= capiConnectFilesize) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
ptrAss(apiConnectptr, apiConnectRecord); ptrAss(apiConnectptr, apiConnectRecord);
@ -1817,7 +1819,7 @@ void Dbtc::execKEYINFO(Signal* signal)
return; return;
default: default:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//switch }//switch
@ -3083,7 +3085,7 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
attrinfoDihReceivedLab(signal); attrinfoDihReceivedLab(signal);
@ -3150,7 +3152,7 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
CacheRecord * const regCachePtr = cachePtr.p; CacheRecord * const regCachePtr = cachePtr.p;
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
if (ERROR_INSERTED(8002)) { if (ERROR_INSERTED(8002)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
if (ERROR_INSERTED(8007)) { if (ERROR_INSERTED(8007)) {
if (apiConnectptr.p->apiConnectstate == CS_STARTED) { if (apiConnectptr.p->apiConnectstate == CS_STARTED) {
@ -3409,7 +3411,7 @@ void Dbtc::releaseAttrinfo()
regApiPtr->cachePtr = RNIL; regApiPtr->cachePtr = RNIL;
return; return;
}//if }//if
systemErrorLab(0); systemErrorLab(0, __LINE__);
return; return;
}//Dbtc::releaseAttrinfo() }//Dbtc::releaseAttrinfo()
@ -3522,7 +3524,7 @@ void Dbtc::execPACKED_SIGNAL(Signal* signal)
Tlength = signal->length(); Tlength = signal->length();
if (Tlength > 25) { if (Tlength > 25) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
Uint32* TpackDataPtr; Uint32* TpackDataPtr;
@ -3577,7 +3579,7 @@ void Dbtc::execPACKED_SIGNAL(Signal* signal)
Tstep += LqhKeyConf::SignalLength; Tstep += LqhKeyConf::SignalLength;
break; break;
default: default:
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//while }//while
@ -3655,7 +3657,7 @@ void Dbtc::execLQHKEYCONF(Signal* signal)
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
if (ERROR_INSERTED(8029)) { if (ERROR_INSERTED(8029)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
if (ERROR_INSERTED(8003)) { if (ERROR_INSERTED(8003)) {
if (regApiPtr->apiConnectstate == CS_STARTED) { if (regApiPtr->apiConnectstate == CS_STARTED) {
@ -4140,7 +4142,7 @@ void Dbtc::diverify010Lab(Signal* signal)
signal->theData[0] = apiConnectptr.i; signal->theData[0] = apiConnectptr.i;
if (ERROR_INSERTED(8022)) { if (ERROR_INSERTED(8022)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
if (TfirstfreeApiConnectCopy != RNIL) { if (TfirstfreeApiConnectCopy != RNIL) {
seizeApiConnectCopy(signal); seizeApiConnectCopy(signal);
@ -4488,7 +4490,7 @@ void Dbtc::execCOMMITTED(Signal* signal)
return; return;
}//if }//if
if (ERROR_INSERTED(8030)) { if (ERROR_INSERTED(8030)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
if (ERROR_INSERTED(8025)) { if (ERROR_INSERTED(8025)) {
SET_ERROR_INSERT_VALUE(8026); SET_ERROR_INSERT_VALUE(8026);
@ -4542,7 +4544,7 @@ void Dbtc::execCOMMITTED(Signal* signal)
}//if }//if
if (ERROR_INSERTED(8020)) { if (ERROR_INSERTED(8020)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
/* THE ENTIRE TRANSACTION IS NOW COMMITED */ /* THE ENTIRE TRANSACTION IS NOW COMMITED */
@ -4780,7 +4782,7 @@ Dbtc::execTC_COMMIT_ACK(Signal* signal){
m_commitAckMarkerHash.release(removedMarker, key); m_commitAckMarkerHash.release(removedMarker, key);
if (removedMarker.i == RNIL) { if (removedMarker.i == RNIL) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
sendRemoveMarkers(signal, removedMarker.p); sendRemoveMarkers(signal, removedMarker.p);
@ -4842,7 +4844,7 @@ void Dbtc::execCOMPLETED(Signal* signal)
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
if (ERROR_INSERTED(8031)) { if (ERROR_INSERTED(8031)) {
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
if (ERROR_INSERTED(8019)) { if (ERROR_INSERTED(8019)) {
CLEAR_ERROR_INSERT_VALUE; CLEAR_ERROR_INSERT_VALUE;
@ -4901,7 +4903,7 @@ void Dbtc::execCOMPLETED(Signal* signal)
}//if }//if
if (ERROR_INSERTED(8021)) { if (ERROR_INSERTED(8021)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
apiConnectptr = localApiConnectptr; apiConnectptr = localApiConnectptr;
releaseTransResources(signal); releaseTransResources(signal);
@ -5354,7 +5356,7 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
return; return;
break; break;
default: default:
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//switch }//switch
TcCommitRef * const commitRef = (TcCommitRef*)&signal->theData[0]; TcCommitRef * const commitRef = (TcCommitRef*)&signal->theData[0];
@ -5367,7 +5369,7 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
return; return;
} else /** apiConnectptr.i < capiConnectFilesize */ { } else /** apiConnectptr.i < capiConnectFilesize */ {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
} }
}//Dbtc::execTC_COMMITREQ() }//Dbtc::execTC_COMMITREQ()
@ -5463,12 +5465,12 @@ void Dbtc::execTCROLLBACKREQ(Signal* signal)
TC_ROLL_warning: TC_ROLL_warning:
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
TC_ROLL_system_error: TC_ROLL_system_error:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dbtc::execTCROLLBACKREQ() }//Dbtc::execTCROLLBACKREQ()
@ -5709,7 +5711,7 @@ void Dbtc::errorReport(Signal* signal, int place)
jam(); jam();
break; break;
}//switch }//switch
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Dbtc::errorReport() }//Dbtc::errorReport()
@ -5766,7 +5768,7 @@ void Dbtc::execABORTED(Signal* signal)
}//if }//if
if (ERROR_INSERTED(8024)) { if (ERROR_INSERTED(8024)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
/** /**
@ -5939,12 +5941,12 @@ ABORT020:
case OS_ABORT_SENT: case OS_ABORT_SENT:
jam(); jam();
DEBUG("ABORT_SENT state in abort015Lab(), not expected"); DEBUG("ABORT_SENT state in abort015Lab(), not expected");
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
default: default:
jam(); jam();
DEBUG("tcConnectstate = " << tcConnectptr.p->tcConnectstate); DEBUG("tcConnectstate = " << tcConnectptr.p->tcConnectstate);
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
@ -6060,7 +6062,7 @@ void Dbtc::checkStartTimeout(Signal* signal)
ctimeOutMissedHeartbeats++; ctimeOutMissedHeartbeats++;
if (ctimeOutMissedHeartbeats > 100){ if (ctimeOutMissedHeartbeats > 100){
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
} }
} }
ctimeOutCheckLastHeartbeat = ctimeOutCheckHeartbeat; ctimeOutCheckLastHeartbeat = ctimeOutCheckHeartbeat;
@ -6249,7 +6251,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
if (((ctcTimer - getApiConTimer(apiConnectptr.i)) > (10 * ctimeOutValue)) && if (((ctcTimer - getApiConTimer(apiConnectptr.i)) > (10 * ctimeOutValue)) &&
((ctcTimer - getApiConTimer(apiConnectptr.i)) > 500)) { ((ctcTimer - getApiConTimer(apiConnectptr.i)) > 500)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
break; break;
case CS_COMMIT_SENT: case CS_COMMIT_SENT:
@ -6397,7 +6399,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
/* AN IMPOSSIBLE STATE IS SET. CRASH THE SYSTEM. */ /* AN IMPOSSIBLE STATE IS SET. CRASH THE SYSTEM. */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
DEBUG("State = " << apiConnectptr.p->apiConnectstate); DEBUG("State = " << apiConnectptr.p->apiConnectstate);
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
return; return;
@ -6667,7 +6669,7 @@ void Dbtc::execSCAN_HBREP(Signal* signal)
break; break;
default: default:
DEBUG("execSCAN_HBREP: scanFragState="<<scanFragptr.p->scanFragState); DEBUG("execSCAN_HBREP: scanFragState="<<scanFragptr.p->scanFragState);
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
} }
@ -6765,7 +6767,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr)
* version. In a release version we will simply set the time-out to zero. * version. In a release version we will simply set the time-out to zero.
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
#ifdef VM_TRACE #ifdef VM_TRACE
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
#endif #endif
scanFragptr.p->stopFragTimer(); scanFragptr.p->stopFragTimer();
break; break;
@ -6774,7 +6776,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr)
/*----------------------------------------------------------------------- /*-----------------------------------------------------------------------
* Non-existent state. Crash. * Non-existent state. Crash.
*-----------------------------------------------------------------------*/ *-----------------------------------------------------------------------*/
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
@ -7112,7 +7114,7 @@ void Dbtc::execTAKE_OVERTCCONF(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dbtc::execTAKE_OVERTCCONF() }//Dbtc::execTAKE_OVERTCCONF()
@ -7341,7 +7343,7 @@ void Dbtc::completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd)
arrGuard(TtakeOverInd, MAX_NDB_NODES); arrGuard(TtakeOverInd, MAX_NDB_NODES);
if (tcNodeFailptr.p->takeOverProcState[TtakeOverInd] != ZTAKE_OVER_ACTIVE) { if (tcNodeFailptr.p->takeOverProcState[TtakeOverInd] != ZTAKE_OVER_ACTIVE) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
tcNodeFailptr.p->takeOverProcState[TtakeOverInd] = ZTAKE_OVER_IDLE; tcNodeFailptr.p->takeOverProcState[TtakeOverInd] = ZTAKE_OVER_IDLE;
@ -7468,7 +7470,7 @@ void Dbtc::completeTransAtTakeOverDoOne(Signal* signal, UintR TtakeOverInd)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//Dbtc::completeTransAtTakeOverDoOne() }//Dbtc::completeTransAtTakeOverDoOne()
@ -7594,7 +7596,7 @@ void Dbtc::toAbortHandlingLab(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//switch }//switch
}//if }//if
@ -7703,7 +7705,7 @@ void Dbtc::execCOMMITCONF(Signal* signal)
}//if }//if
if (ERROR_INSERTED(8026)) { if (ERROR_INSERTED(8026)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
tcurrentReplicaNo = (Uint8)Z8NIL; tcurrentReplicaNo = (Uint8)Z8NIL;
tcConnectptr.p->tcConnectstate = OS_COMMITTED; tcConnectptr.p->tcConnectstate = OS_COMMITTED;
@ -7753,7 +7755,7 @@ void Dbtc::toCommitHandlingLab(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -7848,7 +7850,7 @@ void Dbtc::execCOMPLETECONF(Signal* signal)
}//if }//if
if (ERROR_INSERTED(8028)) { if (ERROR_INSERTED(8028)) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
tcConnectptr.p->tcConnectstate = OS_COMPLETED; tcConnectptr.p->tcConnectstate = OS_COMPLETED;
tcurrentReplicaNo = (Uint8)Z8NIL; tcurrentReplicaNo = (Uint8)Z8NIL;
@ -7963,7 +7965,7 @@ FAF_LOOP:
jam(); jam();
if (cfirstfreeApiConnectFail == RNIL) { if (cfirstfreeApiConnectFail == RNIL) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
seizeApiConnectFail(signal); seizeApiConnectFail(signal);
@ -8007,7 +8009,7 @@ void Dbtc::findTcConnectFail(Signal* signal)
jam(); jam();
if (cfirstfreeTcConnectFail == RNIL) { if (cfirstfreeTcConnectFail == RNIL) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//if }//if
seizeTcConnectFail(signal); seizeTcConnectFail(signal);
@ -8066,7 +8068,7 @@ void Dbtc::initApiConnectFail(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
apiConnectptr.p->commitAckMarker = RNIL; apiConnectptr.p->commitAckMarker = RNIL;
if(LqhTransConf::getMarkerFlag(treqinfo)){ if(LqhTransConf::getMarkerFlag(treqinfo)){
@ -8188,7 +8190,7 @@ void Dbtc::setupFailData(Signal* signal)
break; break;
default: default:
jam(); jam();
sendSystemError(signal); sendSystemError(signal, __LINE__);
break; break;
}//switch }//switch
if (tabortInd != ZCOMMIT_SETUP) { if (tabortInd != ZCOMMIT_SETUP) {
@ -8275,7 +8277,7 @@ void Dbtc::updateApiStateFail(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
break; break;
@ -8298,7 +8300,7 @@ void Dbtc::updateApiStateFail(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
break; break;
@ -8308,7 +8310,7 @@ void Dbtc::updateApiStateFail(Signal* signal)
case CS_FAIL_COMMITTING: case CS_FAIL_COMMITTING:
case CS_FAIL_COMMITTED: case CS_FAIL_COMMITTED:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
case CS_FAIL_PREPARED: case CS_FAIL_PREPARED:
jam(); jam();
@ -8321,7 +8323,7 @@ void Dbtc::updateApiStateFail(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
break; break;
@ -8330,7 +8332,7 @@ void Dbtc::updateApiStateFail(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
}//Dbtc::updateApiStateFail() }//Dbtc::updateApiStateFail()
@ -8448,14 +8450,14 @@ void Dbtc::releaseAtErrorLab(Signal* signal)
abortErrorLab(signal); abortErrorLab(signal);
}//Dbtc::releaseAtErrorLab() }//Dbtc::releaseAtErrorLab()
void Dbtc::warningHandlerLab(Signal* signal) void Dbtc::warningHandlerLab(Signal* signal, int line)
{ {
ndbassert(false); ndbassert(false);
}//Dbtc::warningHandlerLab() }//Dbtc::warningHandlerLab()
void Dbtc::systemErrorLab(Signal* signal) void Dbtc::systemErrorLab(Signal* signal, int line)
{ {
progError(0, 0); progError(line, NDBD_EXIT_NDBREQUIRE);
}//Dbtc::systemErrorLab() }//Dbtc::systemErrorLab()
@ -8585,7 +8587,7 @@ void Dbtc::execSCAN_TABREQ(Signal* signal)
if (apiConnectptr.i >= capiConnectFilesize) if (apiConnectptr.i >= capiConnectFilesize)
{ {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
@ -9225,7 +9227,7 @@ void Dbtc::execSCAN_FRAGREF(Signal* signal)
transid1 = transid1 | transid2; transid1 = transid1 | transid2;
if (transid1 != 0) { if (transid1 != 0) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
/** /**
@ -9321,7 +9323,7 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal)
transid1 = transid1 | transid2; transid1 = transid1 | transid2;
if (transid1 != 0) { if (transid1 != 0) {
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
}//if }//if
ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::LQH_ACTIVE); ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::LQH_ACTIVE);
@ -9409,7 +9411,7 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal)
apiConnectptr.i = req->apiConnectPtr; apiConnectptr.i = req->apiConnectPtr;
if (apiConnectptr.i >= capiConnectFilesize) { if (apiConnectptr.i >= capiConnectFilesize) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
ptrAss(apiConnectptr, apiConnectRecord); ptrAss(apiConnectptr, apiConnectRecord);
@ -10058,7 +10060,7 @@ void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0,
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -10295,7 +10297,7 @@ void Dbtc::releaseAbortResources(Signal* signal)
if(!ok){ if(!ok){
jam(); jam();
ndbout_c("returnsignal = %d", apiConnectptr.p->returnsignal); ndbout_c("returnsignal = %d", apiConnectptr.p->returnsignal);
sendSystemError(signal); sendSystemError(signal, __LINE__);
}//if }//if
} }
@ -10522,9 +10524,9 @@ void Dbtc::sendKeyinfo(Signal* signal, BlockReference TBRef, Uint32 len)
sendSignal(TBRef, GSN_KEYINFO, signal, 3 + len, JBB); sendSignal(TBRef, GSN_KEYINFO, signal, 3 + len, JBB);
}//Dbtc::sendKeyinfo() }//Dbtc::sendKeyinfo()
void Dbtc::sendSystemError(Signal* signal) void Dbtc::sendSystemError(Signal* signal, int line)
{ {
progError(0, 0); progError(line, NDBD_EXIT_NDBREQUIRE);
}//Dbtc::sendSystemError() }//Dbtc::sendSystemError()
/* ========================================================================= */ /* ========================================================================= */
@ -10545,7 +10547,7 @@ void Dbtc::unlinkGcp(Signal* signal)
* WE ARE TRYING TO REMOVE A GLOBAL CHECKPOINT WHICH WAS NOT THE OLDEST. * WE ARE TRYING TO REMOVE A GLOBAL CHECKPOINT WHICH WAS NOT THE OLDEST.
* THIS IS A SYSTEM ERROR. * THIS IS A SYSTEM ERROR.
* ------------------------------------------------------------------- */ * ------------------------------------------------------------------- */
sendSystemError(signal); sendSystemError(signal, __LINE__);
}//if }//if
gcpPtr.p->nextGcp = cfirstfreeGcp; gcpPtr.p->nextGcp = cfirstfreeGcp;
cfirstfreeGcp = gcpPtr.i; cfirstfreeGcp = gcpPtr.i;
@ -11275,7 +11277,7 @@ void Dbtc::execTCINDXREQ(Signal* signal)
transPtr.i = TapiIndex; transPtr.i = TapiIndex;
if (transPtr.i >= capiConnectFilesize) { if (transPtr.i >= capiConnectFilesize) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
ptrAss(transPtr, apiConnectRecord); ptrAss(transPtr, apiConnectRecord);
@ -11429,7 +11431,7 @@ void Dbtc::execINDXKEYINFO(Signal* signal)
transPtr.i = TconnectIndex; transPtr.i = TconnectIndex;
if (transPtr.i >= capiConnectFilesize) { if (transPtr.i >= capiConnectFilesize) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
ptrAss(transPtr, apiConnectRecord); ptrAss(transPtr, apiConnectRecord);
@ -11462,7 +11464,7 @@ void Dbtc::execINDXATTRINFO(Signal* signal)
transPtr.i = TconnectIndex; transPtr.i = TconnectIndex;
if (transPtr.i >= capiConnectFilesize) { if (transPtr.i >= capiConnectFilesize) {
jam(); jam();
warningHandlerLab(signal); warningHandlerLab(signal, __LINE__);
return; return;
}//if }//if
ptrAss(transPtr, apiConnectRecord); ptrAss(transPtr, apiConnectRecord);

View file

@ -75,25 +75,8 @@ Dbtup::Dbtup(const class Configuration & conf)
c_storedProcPool(), c_storedProcPool(),
c_buildIndexList(c_buildIndexPool) c_buildIndexList(c_buildIndexPool)
{ {
Uint32 log_page_size= 0;
BLOCK_CONSTRUCTOR(Dbtup); BLOCK_CONSTRUCTOR(Dbtup);
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
ndb_mgm_get_int_parameter(p, CFG_DB_UNDO_DATA_BUFFER,
&log_page_size);
/**
* Always set page size in half MBytes
*/
cnoOfUndoPage= (log_page_size / sizeof(UndoPage));
Uint32 mega_byte_part= cnoOfUndoPage & 15;
if (mega_byte_part != 0) {
jam();
cnoOfUndoPage+= (16 - mega_byte_part);
}
addRecSignal(GSN_DEBUG_SIG, &Dbtup::execDEBUG_SIG); addRecSignal(GSN_DEBUG_SIG, &Dbtup::execDEBUG_SIG);
addRecSignal(GSN_CONTINUEB, &Dbtup::execCONTINUEB); addRecSignal(GSN_CONTINUEB, &Dbtup::execCONTINUEB);
@ -603,6 +586,20 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
theConfiguration.getOwnConfigIterator(); theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0); ndbrequire(p != 0);
Uint32 log_page_size= 0;
ndb_mgm_get_int_parameter(p, CFG_DB_UNDO_DATA_BUFFER,
&log_page_size);
/**
* Always set page size in half MBytes
*/
cnoOfUndoPage= (log_page_size / sizeof(UndoPage));
Uint32 mega_byte_part= cnoOfUndoPage & 15;
if (mega_byte_part != 0) {
jam();
cnoOfUndoPage+= (16 - mega_byte_part);
}
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &cnoOfOprec)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &cnoOfOprec));
@ -622,16 +619,19 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGERS, ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TRIGGERS,
&noOfTriggers)); &noOfTriggers));
Uint32 nScanOp; // use TUX config for now
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
cnoOfTabDescrRec = (cnoOfTabDescrRec & 0xFFFFFFF0) + 16; cnoOfTabDescrRec = (cnoOfTabDescrRec & 0xFFFFFFF0) + 16;
initRecords();
c_storedProcPool.setSize(noOfStoredProc); c_storedProcPool.setSize(noOfStoredProc);
c_buildIndexPool.setSize(c_noOfBuildIndexRec); c_buildIndexPool.setSize(c_noOfBuildIndexRec);
c_triggerPool.setSize(noOfTriggers); c_triggerPool.setSize(noOfTriggers);
Uint32 nScanOp; // use TUX config for now
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
c_scanOpPool.setSize(nScanOp); c_scanOpPool.setSize(nScanOp);
initRecords();
czero = 0; czero = 0;
cminusOne = czero - 1; cminusOne = czero - 1;
clastBitMask = 1; clastBitMask = 1;
@ -656,6 +656,19 @@ void Dbtup::initRecords()
unsigned i; unsigned i;
// Records with dynamic sizes // Records with dynamic sizes
page = (Page*)allocRecord("Page",
sizeof(Page),
cnoOfPage,
false);
undoPage = (UndoPage*)allocRecord("UndoPage",
sizeof(UndoPage),
cnoOfUndoPage);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
cnoOfOprec);
attrbufrec = (Attrbufrec*)allocRecord("Attrbufrec", attrbufrec = (Attrbufrec*)allocRecord("Attrbufrec",
sizeof(Attrbufrec), sizeof(Attrbufrec),
cnoOfAttrbufrec); cnoOfAttrbufrec);
@ -690,15 +703,6 @@ void Dbtup::initRecords()
sizeof(LocalLogInfo), sizeof(LocalLogInfo),
cnoOfParallellUndoFiles); cnoOfParallellUndoFiles);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
cnoOfOprec);
page = (Page*)allocRecord("Page",
sizeof(Page),
cnoOfPage,
false);
pageRange = (PageRange*)allocRecord("PageRange", pageRange = (PageRange*)allocRecord("PageRange",
sizeof(PageRange), sizeof(PageRange),
cnoOfPageRangeRec); cnoOfPageRangeRec);
@ -728,11 +732,6 @@ void Dbtup::initRecords()
sizeof(TableDescriptor), sizeof(TableDescriptor),
cnoOfTabDescrRec); cnoOfTabDescrRec);
undoPage = (UndoPage*)allocRecord("UndoPage",
sizeof(UndoPage),
cnoOfUndoPage);
// Initialize BAT for interface to file system // Initialize BAT for interface to file system
NewVARIABLE* bat = allocateBat(3); NewVARIABLE* bat = allocateBat(3);
bat[1].WA = &page->pageWord[0]; bat[1].WA = &page->pageWord[0];

View file

@ -187,7 +187,7 @@ Dbtup::rfrInitRestartInfoLab(Signal* signal, DiskBufferSegmentInfoPtr dbsiPtr)
const Uint32 pageCount = riPtr.p->sriNumDataPages - regFragPtr.p->noOfPages; const Uint32 pageCount = riPtr.p->sriNumDataPages - regFragPtr.p->noOfPages;
if(pageCount > 0){ if(pageCount > 0){
Uint32 noAllocPages = allocFragPages(regFragPtr.p, pageCount); Uint32 noAllocPages = allocFragPages(regFragPtr.p, pageCount);
ndbrequire(noAllocPages == pageCount); ndbrequireErr(noAllocPages == pageCount, NDBD_EXIT_SR_OUT_OF_DATAMEMORY);
}//if }//if
ndbrequire(getNoOfPages(regFragPtr.p) == riPtr.p->sriNumDataPages); ndbrequire(getNoOfPages(regFragPtr.p) == riPtr.p->sriNumDataPages);

View file

@ -60,6 +60,7 @@ DbUtil::DbUtil(const Configuration & conf) :
BLOCK_CONSTRUCTOR(DbUtil); BLOCK_CONSTRUCTOR(DbUtil);
// Add received signals // Add received signals
addRecSignal(GSN_READ_CONFIG_REQ, &DbUtil::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &DbUtil::execSTTOR); addRecSignal(GSN_STTOR, &DbUtil::execSTTOR);
addRecSignal(GSN_NDB_STTOR, &DbUtil::execNDB_STTOR); addRecSignal(GSN_NDB_STTOR, &DbUtil::execNDB_STTOR);
addRecSignal(GSN_DUMP_STATE_ORD, &DbUtil::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &DbUtil::execDUMP_STATE_ORD);
@ -111,47 +112,6 @@ DbUtil::DbUtil(const Configuration & conf) :
addRecSignal(GSN_UTIL_RELEASE_REQ, &DbUtil::execUTIL_RELEASE_REQ); addRecSignal(GSN_UTIL_RELEASE_REQ, &DbUtil::execUTIL_RELEASE_REQ);
addRecSignal(GSN_UTIL_RELEASE_CONF, &DbUtil::execUTIL_RELEASE_CONF); addRecSignal(GSN_UTIL_RELEASE_CONF, &DbUtil::execUTIL_RELEASE_CONF);
addRecSignal(GSN_UTIL_RELEASE_REF, &DbUtil::execUTIL_RELEASE_REF); addRecSignal(GSN_UTIL_RELEASE_REF, &DbUtil::execUTIL_RELEASE_REF);
c_pagePool.setSize(10);
c_preparePool.setSize(1); // one parallel prepare at a time
c_preparedOperationPool.setSize(5); // three hardcoded, two for test
c_operationPool.setSize(64); // 64 parallel operations
c_transactionPool.setSize(32); // 16 parallel transactions
c_attrMappingPool.setSize(100);
c_dataBufPool.setSize(6000); // 6000*11*4 = 264K > 8k+8k*16 = 256k
{
SLList<Prepare> tmp(c_preparePool);
PreparePtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Prepare(c_pagePool);
tmp.release();
}
{
SLList<Operation> tmp(c_operationPool);
OperationPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Operation(c_dataBufPool, c_dataBufPool, c_dataBufPool);
tmp.release();
}
{
SLList<PreparedOperation> tmp(c_preparedOperationPool);
PreparedOperationPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) PreparedOperation(c_attrMappingPool,
c_dataBufPool, c_dataBufPool);
tmp.release();
}
{
SLList<Transaction> tmp(c_transactionPool);
TransactionPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Transaction(c_pagePool, c_operationPool);
tmp.release();
}
c_lockQueuePool.setSize(5);
c_lockElementPool.setSize(5);
c_lockQueues.setSize(8);
} }
DbUtil::~DbUtil() DbUtil::~DbUtil()
@ -197,6 +157,68 @@ DbUtil::releaseTransaction(TransactionPtr transPtr){
c_runningTransactions.release(transPtr); c_runningTransactions.release(transPtr);
} }
void
DbUtil::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
c_pagePool.setSize(10);
c_preparePool.setSize(1); // one parallel prepare at a time
c_preparedOperationPool.setSize(5); // three hardcoded, two for test
c_operationPool.setSize(64); // 64 parallel operations
c_transactionPool.setSize(32); // 16 parallel transactions
c_attrMappingPool.setSize(100);
c_dataBufPool.setSize(6000); // 6000*11*4 = 264K > 8k+8k*16 = 256k
{
SLList<Prepare> tmp(c_preparePool);
PreparePtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Prepare(c_pagePool);
tmp.release();
}
{
SLList<Operation> tmp(c_operationPool);
OperationPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Operation(c_dataBufPool, c_dataBufPool, c_dataBufPool);
tmp.release();
}
{
SLList<PreparedOperation> tmp(c_preparedOperationPool);
PreparedOperationPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) PreparedOperation(c_attrMappingPool,
c_dataBufPool, c_dataBufPool);
tmp.release();
}
{
SLList<Transaction> tmp(c_transactionPool);
TransactionPtr ptr;
while(tmp.seize(ptr))
new (ptr.p) Transaction(c_pagePool, c_operationPool);
tmp.release();
}
c_lockQueuePool.setSize(5);
c_lockElementPool.setSize(5);
c_lockQueues.setSize(8);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void void
DbUtil::execSTTOR(Signal* signal) DbUtil::execSTTOR(Signal* signal)
{ {

View file

@ -69,6 +69,7 @@ protected:
/** /**
* Startup & Misc * Startup & Misc
*/ */
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);

View file

@ -174,6 +174,7 @@ private:
// Received signals // Received signals
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execTCSEIZECONF(Signal* signal); void execTCSEIZECONF(Signal* signal);
void execTCSEIZEREF(Signal* signal); void execTCSEIZEREF(Signal* signal);
@ -225,7 +226,7 @@ private:
CheckNodeGroups::Output checkNodeGroups(Signal*, const NdbNodeBitmask &); CheckNodeGroups::Output checkNodeGroups(Signal*, const NdbNodeBitmask &);
// Generated statement blocks // Generated statement blocks
void systemErrorLab(Signal* signal); void systemErrorLab(Signal* signal, int line);
void createSystableLab(Signal* signal, unsigned index); void createSystableLab(Signal* signal, unsigned index);
void crSystab7Lab(Signal* signal); void crSystab7Lab(Signal* signal);

View file

@ -61,6 +61,7 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
// Received signals // Received signals
addRecSignal(GSN_DUMP_STATE_ORD, &Ndbcntr::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &Ndbcntr::execDUMP_STATE_ORD);
addRecSignal(GSN_READ_CONFIG_REQ, &Ndbcntr::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &Ndbcntr::execSTTOR); addRecSignal(GSN_STTOR, &Ndbcntr::execSTTOR);
addRecSignal(GSN_TCSEIZECONF, &Ndbcntr::execTCSEIZECONF); addRecSignal(GSN_TCSEIZECONF, &Ndbcntr::execTCSEIZECONF);
addRecSignal(GSN_TCSEIZEREF, &Ndbcntr::execTCSEIZEREF); addRecSignal(GSN_TCSEIZEREF, &Ndbcntr::execTCSEIZEREF);

View file

@ -49,6 +49,10 @@
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <NdbTick.h> #include <NdbTick.h>
// used during shutdown for reporting current startphase
// accessed from Emulator.cpp, NdbShutdown()
Uint32 g_currentStartPhase;
/** /**
* ALL_BLOCKS Used during start phases and while changing node state * ALL_BLOCKS Used during start phases and while changing node state
* *
@ -81,6 +85,24 @@ static BlockInfo ALL_BLOCKS[] = {
static const Uint32 ALL_BLOCKS_SZ = sizeof(ALL_BLOCKS)/sizeof(BlockInfo); static const Uint32 ALL_BLOCKS_SZ = sizeof(ALL_BLOCKS)/sizeof(BlockInfo);
static BlockReference readConfigOrder[ALL_BLOCKS_SZ] = {
DBTUP_REF,
DBACC_REF,
DBTC_REF,
DBLQH_REF,
DBTUX_REF,
DBDICT_REF,
DBDIH_REF,
NDBFS_REF,
NDBCNTR_REF,
QMGR_REF,
CMVMI_REF,
TRIX_REF,
BACKUP_REF,
DBUTIL_REF,
SUMA_REF
};
/*******************************/ /*******************************/
/* CONTINUEB */ /* CONTINUEB */
/*******************************/ /*******************************/
@ -117,7 +139,7 @@ void Ndbcntr::execCONTINUEB(Signal* signal)
else else
tmp.appfmt(" %d", to_3); tmp.appfmt(" %d", to_3);
progError(__LINE__, ERR_SYSTEM_ERROR, tmp.c_str()); progError(__LINE__, NDBD_EXIT_RESTART_TIMEOUT, tmp.c_str());
} }
signal->theData[0] = ZSTARTUP; signal->theData[0] = ZSTARTUP;
@ -130,7 +152,7 @@ void Ndbcntr::execCONTINUEB(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -158,13 +180,6 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
jamEntry(); jamEntry();
switch (sysErr->errorCode){ switch (sysErr->errorCode){
case SystemError::StartInProgressError:
BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because "
"master start in progress error",
killingNode);
break;
case SystemError::GCPStopDetected: case SystemError::GCPStopDetected:
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because " "Node %d killed this node because "
@ -172,20 +187,6 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
killingNode); killingNode);
break; break;
case SystemError::ScanfragTimeout:
BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because "
"a fragment scan timed out and could not be stopped",
killingNode);
break;
case SystemError::ScanfragStateError:
BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because "
"the state of a fragment scan was out of sync.",
killingNode);
break;
case SystemError::CopyFragRefError: case SystemError::CopyFragRefError:
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because " "Node %d killed this node because "
@ -201,12 +202,31 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
break; break;
} }
progError(__LINE__, progError(__LINE__, NDBD_EXIT_SYSTEM_ERROR, buf);
ERR_SYSTEM_ERROR,
buf);
return; return;
}//Ndbcntr::execSYSTEM_ERROR() }//Ndbcntr::execSYSTEM_ERROR()
void
Ndbcntr::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void Ndbcntr::execSTTOR(Signal* signal) void Ndbcntr::execSTTOR(Signal* signal)
{ {
jamEntry(); jamEntry();
@ -326,7 +346,7 @@ void Ndbcntr::execNDB_STTORRY(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
break; break;
}//switch }//switch
@ -366,7 +386,7 @@ void Ndbcntr::startPhase1Lab(Signal* signal)
void Ndbcntr::execREAD_NODESREF(Signal* signal) void Ndbcntr::execREAD_NODESREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execREAD_NODESREF() }//Ndbcntr::execREAD_NODESREF()
@ -377,7 +397,7 @@ void Ndbcntr::execREAD_NODESREF(Signal* signal)
void Ndbcntr::execNDB_STARTREF(Signal* signal) void Ndbcntr::execNDB_STARTREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execNDB_STARTREF() }//Ndbcntr::execNDB_STARTREF()
@ -1358,7 +1378,7 @@ void Ndbcntr::execCNTR_WAITREP(Signal* signal)
break; break;
default: default:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
break; break;
}//switch }//switch
}//Ndbcntr::execCNTR_WAITREP() }//Ndbcntr::execCNTR_WAITREP()
@ -1414,22 +1434,19 @@ void Ndbcntr::execNODE_FAILREP(Signal* signal)
const bool tStartConf = (phase > 2) || (phase == 2 && cndbBlocksCount > 0); const bool tStartConf = (phase > 2) || (phase == 2 && cndbBlocksCount > 0);
if(tMasterFailed){ if(tMasterFailed){
progError(__LINE__, progError(__LINE__, NDBD_EXIT_SR_OTHERNODEFAILED,
ERR_SR_OTHERNODEFAILED,
"Unhandled node failure during restart"); "Unhandled node failure during restart");
} }
if(tStartConf && tStarting){ if(tStartConf && tStarting){
// One of other starting nodes has crashed... // One of other starting nodes has crashed...
progError(__LINE__, progError(__LINE__, NDBD_EXIT_SR_OTHERNODEFAILED,
ERR_SR_OTHERNODEFAILED,
"Unhandled node failure of starting node during restart"); "Unhandled node failure of starting node during restart");
} }
if(tStartConf && tStarted){ if(tStartConf && tStarted){
// One of other started nodes has crashed... // One of other started nodes has crashed...
progError(__LINE__, progError(__LINE__, NDBD_EXIT_SR_OTHERNODEFAILED,
ERR_SR_OTHERNODEFAILED,
"Unhandled node failure of started node during restart"); "Unhandled node failure of started node during restart");
} }
@ -1538,9 +1555,9 @@ void Ndbcntr::execREAD_NODESREQ(Signal* signal)
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
// SENDS APPL_ERROR TO QMGR AND THEN SET A POINTER OUT OF BOUNDS // SENDS APPL_ERROR TO QMGR AND THEN SET A POINTER OUT OF BOUNDS
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
void Ndbcntr::systemErrorLab(Signal* signal) void Ndbcntr::systemErrorLab(Signal* signal, int line)
{ {
progError(0, 0); /* BUG INSERTION */ progError(line, NDBD_EXIT_NDBREQUIRE); /* BUG INSERTION */
return; return;
}//Ndbcntr::systemErrorLab() }//Ndbcntr::systemErrorLab()
@ -1612,7 +1629,7 @@ void Ndbcntr::createSystableLab(Signal* signal, unsigned index)
void Ndbcntr::execCREATE_TABLE_REF(Signal* signal) void Ndbcntr::execCREATE_TABLE_REF(Signal* signal)
{ {
jamEntry(); jamEntry();
progError(0,0); progError(__LINE__,NDBD_EXIT_NDBREQUIRE, "CREATE_TABLE_REF");
return; return;
}//Ndbcntr::execDICTTABREF() }//Ndbcntr::execDICTTABREF()
@ -1813,28 +1830,28 @@ void Ndbcntr::execGETGCICONF(Signal* signal)
void Ndbcntr::execTCKEYREF(Signal* signal) void Ndbcntr::execTCKEYREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execTCKEYREF() }//Ndbcntr::execTCKEYREF()
void Ndbcntr::execTCROLLBACKREP(Signal* signal) void Ndbcntr::execTCROLLBACKREP(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execTCROLLBACKREP() }//Ndbcntr::execTCROLLBACKREP()
void Ndbcntr::execTCRELEASEREF(Signal* signal) void Ndbcntr::execTCRELEASEREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execTCRELEASEREF() }//Ndbcntr::execTCRELEASEREF()
void Ndbcntr::execTCSEIZEREF(Signal* signal) void Ndbcntr::execTCSEIZEREF(Signal* signal)
{ {
jamEntry(); jamEntry();
systemErrorLab(signal); systemErrorLab(signal, __LINE__);
return; return;
}//Ndbcntr::execTCSEIZEREF() }//Ndbcntr::execTCSEIZEREF()
@ -2467,7 +2484,7 @@ void Ndbcntr::Missra::sendNextREAD_CONFIG_REQ(Signal* signal){
req->senderRef = cntr.reference(); req->senderRef = cntr.reference();
req->noOfParameters = 0; req->noOfParameters = 0;
const BlockReference ref = ALL_BLOCKS[currentBlockIndex].Ref; const BlockReference ref = readConfigOrder[currentBlockIndex];
#if 0 #if 0
ndbout_c("sending READ_CONFIG_REQ to %s(ref=%x index=%d)", ndbout_c("sending READ_CONFIG_REQ to %s(ref=%x index=%d)",
@ -2498,7 +2515,8 @@ void Ndbcntr::Missra::execREAD_CONFIG_CONF(Signal* signal){
const ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtr(); const ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtr();
const Uint32 ref = conf->senderRef; const Uint32 ref = conf->senderRef;
ndbrequire(refToBlock(ALL_BLOCKS[currentBlockIndex].Ref) == refToBlock(ref)); ndbrequire(refToBlock(readConfigOrder[currentBlockIndex])
== refToBlock(ref));
currentBlockIndex++; currentBlockIndex++;
sendNextREAD_CONFIG_REQ(signal); sendNextREAD_CONFIG_REQ(signal);
@ -2526,11 +2544,12 @@ void Ndbcntr::Missra::execSTTORRY(Signal* signal){
void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){ void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){
for(; currentStartPhase < 255 ; currentStartPhase++){ for(; currentStartPhase < 255 ;
currentStartPhase++, g_currentStartPhase = currentStartPhase){
jam(); jam();
const Uint32 start = currentBlockIndex; const Uint32 start = currentBlockIndex;
if (currentStartPhase == ZSTART_PHASE_6) if (currentStartPhase == ZSTART_PHASE_6)
{ {
// Ndbd has passed the critical startphases. // Ndbd has passed the critical startphases.
@ -2681,7 +2700,8 @@ UpgradeStartup::execCM_APPCHG(SimulatedBlock & block, Signal* signal){
return; return;
} }
} }
block.progError(0,0); block.progError(__LINE__,NDBD_EXIT_NDBREQUIRE,
"UpgradeStartup::execCM_APPCHG");
} }
void void
@ -2694,7 +2714,9 @@ UpgradeStartup::sendCntrMasterReq(Ndbcntr& cntr, Signal* signal, Uint32 n){
} }
if(node == NdbNodeBitmask::NotFound){ if(node == NdbNodeBitmask::NotFound){
cntr.progError(0,0); cntr.progError(__LINE__,NDBD_EXIT_NDBREQUIRE,
"UpgradeStartup::sendCntrMasterReq "
"NdbNodeBitmask::NotFound");
} }
CntrMasterReq * const cntrMasterReq = (CntrMasterReq*)&signal->theData[0]; CntrMasterReq * const cntrMasterReq = (CntrMasterReq*)&signal->theData[0];
@ -2736,5 +2758,6 @@ UpgradeStartup::execCNTR_MASTER_REPLY(SimulatedBlock & block, Signal* signal){
} }
} }
} }
block.progError(0,0); block.progError(__LINE__,NDBD_EXIT_NDBREQUIRE,
"UpgradeStartup::execCNTR_MASTER_REPLY");
} }

View file

@ -18,12 +18,11 @@
#include <my_sys.h> #include <my_sys.h>
#include <my_pthread.h> #include <my_pthread.h>
#include <Error.hpp>
#include "AsyncFile.hpp" #include "AsyncFile.hpp"
#include <ErrorHandlingMacros.hpp> #include <ErrorHandlingMacros.hpp>
#include <kernel_types.h> #include <kernel_types.h>
#include <NdbMem.h> #include <ndbd_malloc.hpp>
#include <NdbThread.h> #include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp> #include <signaldata/FsOpenReq.hpp>
@ -162,7 +161,7 @@ AsyncFile::run()
theStartFlag = true; theStartFlag = true;
// Create write buffer for bigger writes // Create write buffer for bigger writes
theWriteBufferSize = WRITEBUFFERSIZE; theWriteBufferSize = WRITEBUFFERSIZE;
theWriteBuffer = (char *) NdbMem_Allocate(theWriteBufferSize); theWriteBuffer = (char *) ndbd_malloc(theWriteBufferSize);
NdbMutex_Unlock(theStartMutexPtr); NdbMutex_Unlock(theStartMutexPtr);
NdbCondition_Signal(theStartConditionPtr); NdbCondition_Signal(theStartConditionPtr);
@ -517,7 +516,7 @@ AsyncFile::extendfile(Request* request) {
DEBUG(ndbout_c("extendfile: maxOffset=%d, size=%d", maxOffset, maxSize)); DEBUG(ndbout_c("extendfile: maxOffset=%d, size=%d", maxOffset, maxSize));
// Allocate a buffer and fill it with zeros // Allocate a buffer and fill it with zeros
void* pbuf = NdbMem_Allocate(maxSize); void* pbuf = ndbd_malloc(maxSize);
memset(pbuf, 0, maxSize); memset(pbuf, 0, maxSize);
for (int p = 0; p <= maxOffset; p = p + maxSize) { for (int p = 0; p <= maxOffset; p = p + maxSize) {
int return_value; int return_value;
@ -525,16 +524,18 @@ AsyncFile::extendfile(Request* request) {
p, p,
SEEK_SET); SEEK_SET);
if((return_value == -1 ) || (return_value != p)) { if((return_value == -1 ) || (return_value != p)) {
ndbd_free(pbuf,maxSize);
return -1; return -1;
} }
return_value = ::write(theFd, return_value = ::write(theFd,
pbuf, pbuf,
maxSize); maxSize);
if ((return_value == -1) || (return_value != maxSize)) { if ((return_value == -1) || (return_value != maxSize)) {
ndbd_free(pbuf,maxSize);
return -1; return -1;
} }
} }
free(pbuf); ndbd_free(pbuf,maxSize);
DEBUG(ndbout_c("extendfile: \"%s\" OK!", theFileName.c_str())); DEBUG(ndbout_c("extendfile: \"%s\" OK!", theFileName.c_str()));
return 0; return 0;
@ -884,7 +885,7 @@ AsyncFile::rmrfReq(Request * request, char * path, bool removePath){
void AsyncFile::endReq() void AsyncFile::endReq()
{ {
// Thread is ended with return // Thread is ended with return
if (theWriteBuffer) NdbMem_Free(theWriteBuffer); if (theWriteBuffer) ndbd_free(theWriteBuffer, theWriteBufferSize);
} }

View file

@ -20,7 +20,6 @@
#include "Filename.hpp" #include "Filename.hpp"
#include "ErrorHandlingMacros.hpp" #include "ErrorHandlingMacros.hpp"
#include "Error.hpp"
#include "RefConvert.hpp" #include "RefConvert.hpp"
#include "DebuggerNames.hpp" #include "DebuggerNames.hpp"
@ -52,7 +51,7 @@ Filename::init(Uint32 nodeid,
DBUG_ENTER("Filename::init"); DBUG_ENTER("Filename::init");
if (pFileSystemPath == NULL) { if (pFileSystemPath == NULL) {
ERROR_SET(fatal, AFS_ERROR_NOPATH, ""," Filename::init()"); ERROR_SET(fatal, NDBD_EXIT_AFS_NOPATH, "","Missing FileSystemPath");
return; return;
} }
@ -109,7 +108,7 @@ Filename::set(BlockReference blockReference,
{ {
const char* blockName = getBlockName( refToBlock(blockReference) ); const char* blockName = getBlockName( refToBlock(blockReference) );
if (blockName == NULL){ if (blockName == NULL){
ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","No Block Name"); ERROR_SET(ecError, NDBD_EXIT_AFS_PARAMETER,"","No Block Name");
return; return;
} }
BaseString::snprintf(buf, sizeof(buf), "%s%s", blockName, DIR_SEPARATOR); BaseString::snprintf(buf, sizeof(buf), "%s%s", blockName, DIR_SEPARATOR);
@ -165,7 +164,7 @@ Filename::set(BlockReference blockReference,
const Uint32 diskNo = FsOpenReq::v1_getDisk(filenumber); const Uint32 diskNo = FsOpenReq::v1_getDisk(filenumber);
if(diskNo == 0xFF){ if(diskNo == 0xFF){
ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","Invalid disk specification"); ERROR_SET(ecError, NDBD_EXIT_AFS_PARAMETER,"","Invalid disk specification");
} }
BaseString::snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR); BaseString::snprintf(buf, sizeof(buf), "D%d%s", diskNo, DIR_SEPARATOR);
@ -174,10 +173,10 @@ Filename::set(BlockReference blockReference,
} }
break; break;
default: default:
ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","Wrong version"); ERROR_SET(ecError, NDBD_EXIT_AFS_PARAMETER,"","Wrong version");
} }
if (type >= noOfExtensions){ if (type >= noOfExtensions){
ERROR_SET(ecError, AFS_ERROR_PARAMETER,"","File Type doesn't exist"); ERROR_SET(ecError, NDBD_EXIT_AFS_PARAMETER,"","File Type doesn't exist");
return; return;
} }
strcat(theName, fileExtension[type]); strcat(theName, fileExtension[type]);

View file

@ -70,7 +70,6 @@
#else #else
#include "ErrorHandlingMacros.hpp" #include "ErrorHandlingMacros.hpp"
#include "Error.hpp"
#include "CircularIndex.hpp" #include "CircularIndex.hpp"
#include "NdbMutex.h" #include "NdbMutex.h"
#include "NdbCondition.h" #include "NdbCondition.h"

View file

@ -19,7 +19,6 @@
#include "Ndbfs.hpp" #include "Ndbfs.hpp"
#include "AsyncFile.hpp" #include "AsyncFile.hpp"
#include "Filename.hpp" #include "Filename.hpp"
#include "Error.hpp"
#include <signaldata/FsOpenReq.hpp> #include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsCloseReq.hpp> #include <signaldata/FsCloseReq.hpp>
@ -57,26 +56,10 @@ Ndbfs::Ndbfs(const Configuration & conf) :
theLastId(0), theLastId(0),
m_maxOpenedFiles(0) m_maxOpenedFiles(0)
{ {
theFileSystemPath = conf.fileSystemPath();
theBackupFilePath = conf.backupFilePath();
theRequestPool = new Pool<Request>;
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
m_maxFiles = 40;
ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
// Create idle AsyncFiles
Uint32 noIdleFiles = m_maxFiles > 27 ? 27 : m_maxFiles ;
for (Uint32 i = 0; i < noIdleFiles; i++){
theIdleFiles.push_back(createAsyncFile());
}
BLOCK_CONSTRUCTOR(Ndbfs); BLOCK_CONSTRUCTOR(Ndbfs);
// Set received signals // Set received signals
addRecSignal(GSN_READ_CONFIG_REQ, &Ndbfs::execREAD_CONFIG_REQ);
addRecSignal(GSN_DUMP_STATE_ORD, &Ndbfs::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &Ndbfs::execDUMP_STATE_ORD);
addRecSignal(GSN_STTOR, &Ndbfs::execSTTOR); addRecSignal(GSN_STTOR, &Ndbfs::execSTTOR);
addRecSignal(GSN_FSOPENREQ, &Ndbfs::execFSOPENREQ); addRecSignal(GSN_FSOPENREQ, &Ndbfs::execFSOPENREQ);
@ -105,6 +88,39 @@ Ndbfs::~Ndbfs()
delete theRequestPool; delete theRequestPool;
} }
void
Ndbfs::execREAD_CONFIG_REQ(Signal* signal)
{
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
theFileSystemPath = theConfiguration.fileSystemPath();
theBackupFilePath = theConfiguration.backupFilePath();
theRequestPool = new Pool<Request>;
m_maxFiles = 40;
ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
// Create idle AsyncFiles
Uint32 noIdleFiles = m_maxFiles > 27 ? 27 : m_maxFiles ;
for (Uint32 i = 0; i < noIdleFiles; i++){
theIdleFiles.push_back(createAsyncFile());
}
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
/* Received a restart signal. /* Received a restart signal.
* Answer it like any other block * Answer it like any other block
* PR0 : StartCase * PR0 : StartCase
@ -557,7 +573,7 @@ Ndbfs::createAsyncFile(){
AsyncFile* file = theFiles[i]; AsyncFile* file = theFiles[i];
ndbout_c("%2d (0x%x): %s", i, file, file->isOpen()?"OPEN":"CLOSED"); ndbout_c("%2d (0x%x): %s", i, file, file->isOpen()?"OPEN":"CLOSED");
} }
ERROR_SET(fatal, AFS_ERROR_MAXOPEN,""," Ndbfs::createAsyncFile"); ERROR_SET(fatal, NDBD_EXIT_AFS_MAXOPEN,""," Ndbfs::createAsyncFile");
} }
AsyncFile* file = new AsyncFile; AsyncFile* file = new AsyncFile;

View file

@ -41,6 +41,7 @@ protected:
BLOCK_DEFINES(Ndbfs); BLOCK_DEFINES(Ndbfs);
// The signal processing functions // The signal processing functions
void execREAD_CONFIG_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);
void execFSOPENREQ(Signal* signal); void execFSOPENREQ(Signal* signal);
void execFSCLOSEREQ(Signal* signal); void execFSCLOSEREQ(Signal* signal);

View file

@ -88,7 +88,7 @@ inline bool OpenFiles::insert(AsyncFile* file, Uint16 id){
names.assfmt("open: >%s< existing: >%s<", names.assfmt("open: >%s< existing: >%s<",
file->theFileName.c_str(), file->theFileName.c_str(),
m_files[i].m_file->theFileName.c_str()); m_files[i].m_file->theFileName.c_str());
ERROR_SET(fatal, AFS_ERROR_ALLREADY_OPEN, names.c_str(), ERROR_SET(fatal, NDBD_EXIT_AFS_ALREADY_OPEN, names.c_str(),
"OpenFiles::insert()"); "OpenFiles::insert()");
} }
} }

View file

@ -20,7 +20,6 @@
#include "Ndbfs.hpp" #include "Ndbfs.hpp"
#include "AsyncFile.hpp" #include "AsyncFile.hpp"
#include "Filename.hpp" #include "Filename.hpp"
#include "Error.hpp"
#include <signaldata/FsOpenReq.hpp> #include <signaldata/FsOpenReq.hpp>
#include <signaldata/FsCloseReq.hpp> #include <signaldata/FsCloseReq.hpp>

View file

@ -209,6 +209,7 @@ private:
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);
void execCONNECT_REP(Signal* signal); void execCONNECT_REP(Signal* signal);
void execNDB_FAILCONF(Signal* signal); void execNDB_FAILCONF(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execCM_INFOCONF(Signal* signal); void execCM_INFOCONF(Signal* signal);
void execCLOSE_COMCONF(Signal* signal); void execCLOSE_COMCONF(Signal* signal);

View file

@ -75,6 +75,7 @@ Qmgr::Qmgr(const class Configuration & conf)
// Received signals // Received signals
addRecSignal(GSN_CONNECT_REP, &Qmgr::execCONNECT_REP); addRecSignal(GSN_CONNECT_REP, &Qmgr::execCONNECT_REP);
addRecSignal(GSN_NDB_FAILCONF, &Qmgr::execNDB_FAILCONF); addRecSignal(GSN_NDB_FAILCONF, &Qmgr::execNDB_FAILCONF);
addRecSignal(GSN_READ_CONFIG_REQ, &Qmgr::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &Qmgr::execSTTOR); addRecSignal(GSN_STTOR, &Qmgr::execSTTOR);
addRecSignal(GSN_CLOSE_COMCONF, &Qmgr::execCLOSE_COMCONF); addRecSignal(GSN_CLOSE_COMCONF, &Qmgr::execCLOSE_COMCONF);
addRecSignal(GSN_API_REGREQ, &Qmgr::execAPI_REGREQ); addRecSignal(GSN_API_REGREQ, &Qmgr::execAPI_REGREQ);

View file

@ -166,6 +166,27 @@ void Qmgr::execPRES_TOREQ(Signal* signal)
return; return;
}//Qmgr::execPRES_TOREQ() }//Qmgr::execPRES_TOREQ()
void
Qmgr::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
/* /*
4.2 ADD NODE MODULE*/ 4.2 ADD NODE MODULE*/
/*##########################################################################*/ /*##########################################################################*/
@ -700,11 +721,11 @@ void Qmgr::execCM_REGREF(Signal* signal)
break; break;
case CmRegRef::ZNOT_IN_CFG: case CmRegRef::ZNOT_IN_CFG:
jam(); jam();
progError(__LINE__, ERR_NODE_NOT_IN_CONFIG); progError(__LINE__, NDBD_EXIT_NODE_NOT_IN_CONFIG);
break; break;
case CmRegRef::ZNOT_DEAD: case CmRegRef::ZNOT_DEAD:
jam(); jam();
progError(__LINE__, ERR_NODE_NOT_DEAD); progError(__LINE__, NDBD_EXIT_NODE_NOT_DEAD);
break; break;
case CmRegRef::ZELECTION: case CmRegRef::ZELECTION:
jam(); jam();
@ -2683,7 +2704,7 @@ void Qmgr::systemErrorBecauseOtherNodeFailed(Signal* signal, Uint32 line,
"Node was shutdown during startup because node %d failed", "Node was shutdown during startup because node %d failed",
failedNodeId); failedNodeId);
progError(line, ERR_SR_OTHERNODEFAILED, buf); progError(line, NDBD_EXIT_SR_OTHERNODEFAILED, buf);
} }
@ -2695,7 +2716,7 @@ void Qmgr::systemErrorLab(Signal* signal, Uint32 line, const char * message)
// If it's known why shutdown occured // If it's known why shutdown occured
// an error message has been passed to this function // an error message has been passed to this function
progError(line, 0, message); progError(line, NDBD_EXIT_NDBREQUIRE, message);
return; return;
}//Qmgr::systemErrorLab() }//Qmgr::systemErrorLab()
@ -3789,7 +3810,8 @@ Qmgr::stateArbitCrash(Signal* signal)
if (! (arbitRec.getTimediff() > getArbitTimeout())) if (! (arbitRec.getTimediff() > getArbitTimeout()))
return; return;
#endif #endif
progError(__LINE__, ERR_ARBIT_SHUTDOWN, "Arbitrator decided to shutdown this node"); progError(__LINE__, NDBD_EXIT_ARBIT_SHUTDOWN,
"Arbitrator decided to shutdown this node");
} }
/** /**

View file

@ -147,6 +147,64 @@ Suma::getNodeGroupMembers(Signal* signal)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
void
Suma::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
// SumaParticipant
Uint32 noTables;
ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES,
&noTables);
/**
* @todo: fix pool sizes
*/
c_tablePool_.setSize(noTables);
c_tables.setSize(noTables);
c_subscriptions.setSize(20); //10
c_subscriberPool.setSize(64);
c_subscriptionPool.setSize(64); //2
c_syncPool.setSize(20); //2
c_dataBufferPool.setSize(128);
{
SLList<SyncRecord> tmp(c_syncPool);
Ptr<SyncRecord> ptr;
while(tmp.seize(ptr))
new (ptr.p) SyncRecord(* this, c_dataBufferPool);
tmp.release();
}
// Suma
c_nodePool.setSize(MAX_NDB_NODES);
c_masterNodeId = getOwnNodeId();
c_nodeGroup = c_noNodesInGroup = c_idInNodeGroup = 0;
for (int i = 0; i < MAX_REPLICAS; i++) {
c_nodesInGroup[i] = 0;
}
c_subCoordinatorPool.setSize(10);
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void void
Suma::execSTTOR(Signal* signal) { Suma::execSTTOR(Signal* signal) {
jamEntry(); jamEntry();
@ -395,40 +453,6 @@ Suma::send_handover_req(Signal* signal)
SumaHandoverReq::SignalLength, JBB); SumaHandoverReq::SignalLength, JBB);
} }
#if 0
void
Suma::execREAD_CONFIG_REQ(Signal* signal)
{
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
ndbrequire(req->noOfParameters == 0);
jamEntry();
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_FILES,
&cnoLogFiles));
ndbrequire(cnoLogFiles > 0);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &cfragrecFileSize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TABLE, &ctabrecFileSize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TC_CONNECT,
&ctcConnectrecFileSize));
clogFileFileSize = 4 * cnoLogFiles;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_SCAN, &cscanrecFileSize));
cmaxAccOps = cscanrecFileSize * MAX_PARALLEL_SCANS_PER_FRAG;
initRecords();
initialiseRecordsLab(signal, 0, ref, senderData);
return;
}//Dblqh::execSIZEALT_REP()
#endif
void void
Suma::sendSTTORRY(Signal* signal){ Suma::sendSTTORRY(Signal* signal){
signal->theData[0] = 0; signal->theData[0] = 0;

View file

@ -392,6 +392,8 @@ public:
void getNodeGroupMembers(Signal* signal); void getNodeGroupMembers(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void sendSTTORRY(Signal*); void sendSTTORRY(Signal*);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);

View file

@ -36,6 +36,7 @@ Suma::Suma(const Configuration & conf) :
} }
// Add received signals // Add received signals
addRecSignal(GSN_READ_CONFIG_REQ, &Suma::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &Suma::execSTTOR); addRecSignal(GSN_STTOR, &Suma::execSTTOR);
addRecSignal(GSN_NDB_STTOR, &Suma::execNDB_STTOR); addRecSignal(GSN_NDB_STTOR, &Suma::execNDB_STTOR);
addRecSignal(GSN_DUMP_STATE_ORD, &Suma::execDUMP_STATE_ORD); addRecSignal(GSN_DUMP_STATE_ORD, &Suma::execDUMP_STATE_ORD);

View file

@ -52,6 +52,7 @@ Trix::Trix(const Configuration & conf) :
BLOCK_CONSTRUCTOR(Trix); BLOCK_CONSTRUCTOR(Trix);
// Add received signals // Add received signals
addRecSignal(GSN_READ_CONFIG_REQ, &Trix::execREAD_CONFIG_REQ);
addRecSignal(GSN_STTOR, &Trix::execSTTOR); addRecSignal(GSN_STTOR, &Trix::execSTTOR);
addRecSignal(GSN_NDB_STTOR, &Trix::execNDB_STTOR); // Forwarded from DICT addRecSignal(GSN_NDB_STTOR, &Trix::execNDB_STTOR); // Forwarded from DICT
addRecSignal(GSN_READ_NODESCONF, &Trix::execREAD_NODESCONF); addRecSignal(GSN_READ_NODESCONF, &Trix::execREAD_NODESCONF);
@ -84,6 +85,28 @@ Trix::Trix(const Configuration & conf) :
addRecSignal(GSN_SUB_SYNC_REF, &Trix::execSUB_SYNC_REF); addRecSignal(GSN_SUB_SYNC_REF, &Trix::execSUB_SYNC_REF);
addRecSignal(GSN_SUB_SYNC_CONTINUE_REQ, &Trix::execSUB_SYNC_CONTINUE_REQ); addRecSignal(GSN_SUB_SYNC_CONTINUE_REQ, &Trix::execSUB_SYNC_CONTINUE_REQ);
addRecSignal(GSN_SUB_TABLE_DATA, &Trix::execSUB_TABLE_DATA); addRecSignal(GSN_SUB_TABLE_DATA, &Trix::execSUB_TABLE_DATA);
}
/**
*
*/
Trix::~Trix()
{
}
void
Trix::execREAD_CONFIG_REQ(Signal* signal)
{
jamEntry();
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
const ndb_mgm_configuration_iterator * p =
theConfiguration.getOwnConfigIterator();
ndbrequire(p != 0);
// Allocate pool sizes // Allocate pool sizes
c_theAttrOrderBufferPool.setSize(100); c_theAttrOrderBufferPool.setSize(100);
@ -95,13 +118,12 @@ Trix::Trix(const Configuration & conf) :
new (subptr.p) SubscriptionRecord(c_theAttrOrderBufferPool); new (subptr.p) SubscriptionRecord(c_theAttrOrderBufferPool);
} }
subscriptions.release(); subscriptions.release();
}
/** ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
* conf->senderRef = reference();
*/ conf->senderData = senderData;
Trix::~Trix() sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
{ ReadConfigConf::SignalLength, JBB);
} }
/** /**

View file

@ -139,6 +139,7 @@ private:
ArrayList<SubscriptionRecord> c_theSubscriptions; ArrayList<SubscriptionRecord> c_theSubscriptions;
// System start // System start
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);

View file

@ -1,85 +0,0 @@
/* Copyright (C) 2003 MySQL 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef ERROR_H
#define ERROR_H
/**
* Errorcodes for NDB
*
* These errorcodes should be used whenever a condition
* is detected where it's necesssary to shutdown NDB.
*
* Example: When another node fails while a NDB node are performing
* a system restart the node should be shutdown. This
* is kind of an error but the cause of the error is known
* and a proper errormessage describing the problem should
* be printed in error.log. It's therefore important to use
* the proper errorcode.
*
* TODO: In the future the errorcodes should be classified
*
*/
enum ErrorCategory
{
warning,
ecError,
fatal,
assert
};
const int ERR_BASE = 1000;
// Errorcodes for all blocks except filseystem
const int ERR_ERR_BASE = ERR_BASE + 1300;
const int ERR_ERROR_PRGERR = ERR_ERR_BASE+1;
const int ERR_NODE_NOT_IN_CONFIG = ERR_ERR_BASE+2;
const int ERR_SYSTEM_ERROR = ERR_ERR_BASE+3;
const int ERR_INDEX_NOTINRANGE = ERR_ERR_BASE+4;
const int ERR_ARBIT_SHUTDOWN = ERR_ERR_BASE+5;
const int ERR_POINTER_NOTINRANGE = ERR_ERR_BASE+6;
const int ERR_PROGRAMERROR = ERR_ERR_BASE+7;
const int ERR_SR_OTHERNODEFAILED = ERR_ERR_BASE+8;
const int ERR_NODE_NOT_DEAD = ERR_ERR_BASE+9;
const int ERR_SR_REDOLOG = ERR_ERR_BASE+10;
const int ERR_SR_RESTARTCONFLICT = ERR_ERR_BASE+11;
const int ERR_NO_MORE_UNDOLOG = ERR_ERR_BASE+12;
const int ERR_SR_UNDOLOG = ERR_ERR_BASE+13;
const int ERR_MEMALLOC = ERR_ERR_BASE+27;
const int BLOCK_ERROR_JBUFCONGESTION = ERR_ERR_BASE+34;
const int ERROR_TIME_QUEUE_SHORT = ERR_ERR_BASE+35;
const int ERROR_TIME_QUEUE_LONG = ERR_ERR_BASE+36;
const int ERROR_TIME_QUEUE_DELAY = ERR_ERR_BASE+37;
const int ERROR_TIME_QUEUE_INDEX = ERR_ERR_BASE+38;
const int BLOCK_ERROR_BNR_ZERO = ERR_ERR_BASE+39;
const int ERROR_WRONG_PRIO_LEVEL = ERR_ERR_BASE+40;
const int ERR_NDBREQUIRE = ERR_ERR_BASE+41;
const int ERR_ERROR_INSERT = ERR_ERR_BASE+42;
const int ERR_INVALID_CONFIG = ERR_ERR_BASE+50;
const int ERR_OUT_OF_LONG_SIGNAL_MEMORY = ERR_ERR_BASE+51;
// Errorcodes for NDB filesystem
const int AFS_ERR_BASE = ERR_BASE + 1800;
const int AFS_ERROR_NOPATH = AFS_ERR_BASE+1;
const int AFS_ERROR_CHANNALFULL = AFS_ERR_BASE+2;
const int AFS_ERROR_NOMORETHREADS = AFS_ERR_BASE+3;
const int AFS_ERROR_PARAMETER = AFS_ERR_BASE+4;
const int AFS_ERROR_INVALIDPATH = AFS_ERR_BASE+5;
const int AFS_ERROR_MAXOPEN = AFS_ERR_BASE+6;
const int AFS_ERROR_ALLREADY_OPEN = AFS_ERR_BASE+7;
#endif // ERROR_H

View file

@ -17,22 +17,27 @@
#ifndef ERRORHANDLINGMACROS_H #ifndef ERRORHANDLINGMACROS_H
#define ERRORHANDLINGMACROS_H #define ERRORHANDLINGMACROS_H
#include <ndbd_exit_codes.h>
#include "ErrorReporter.hpp" #include "ErrorReporter.hpp"
#include "Error.hpp"
extern const char programName[]; extern const char programName[];
#define ERROR_SET_SIGNAL(messageCategory, messageID, problemData, objectRef) \ enum NotUsed
ErrorReporter::handleError(messageCategory, messageID, problemData, objectRef, NST_ErrorHandlerSignal) {
#define ERROR_SET(messageCategory, messageID, problemData, objectRef) \ warning,
ErrorReporter::handleError(messageCategory, messageID, problemData, objectRef) ecError,
fatal,
assert
};
#define ERROR_SET_SIGNAL(not_used, messageID, problemData, objectRef) \
ErrorReporter::handleError(messageID, problemData, objectRef, NST_ErrorHandlerSignal)
#define ERROR_SET(not_used, messageID, problemData, objectRef) \
ErrorReporter::handleError(messageID, problemData, objectRef)
// Description: // Description:
// Call ErrorHandler with the supplied arguments. The // Call ErrorHandler with the supplied arguments. The
// ErrorHandler decides how to report the error. // ErrorHandler decides how to report the error.
// Parameters: // Parameters:
// messageCategory IN A hint to the error handler how the
// error should be reported. Can be
// error, fatal (or warning, use WARNING_SET instead).
// messageID IN Code identifying the error. If less // messageID IN Code identifying the error. If less
// than 1000 a unix error is assumed. If // than 1000 a unix error is assumed. If
// greater than 1000 the code is treated // greater than 1000 the code is treated

View file

@ -1,75 +0,0 @@
/* Copyright (C) 2003 MySQL 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "ErrorMessages.hpp"
struct ErrStruct {
int fauldId;
const char* text;
};
const ErrStruct errArray[] = {
{2301, "Assertion, probably a programming error"},
{2302, "Own Node Id not a NDB node, configuration error"},
{2303, "System error"},
{2304, "Index too large"},
{2305, "Arbitrator shutdown"},
{2306, "Pointer too large"},
{2307, "Internal program error"},
{2308, "Node failed during system restart"},
{2309, "Node state conflict"},
{2310, "Error while reading the REDO log"},
{2311, "Conflict when selecting restart type"},
{2312, "No more free UNDO log"},
{2313, "Error while reading the datapages and UNDO log"},
{2327, "Memory allocation failure"},
{2334, "Job buffer congestion"},
{2335, "Error in short time queue"},
{2336, "Error in long time queue"},
{2337, "Error in time queue, too long delay"},
{2338, "Time queue index out of range"},
{2339, "Send signal error"},
{2340, "Wrong prio level when sending signal"},
{2341, "Internal program error (failed ndbrequire)"},
{2342, "Error insert executed" },
{2350, "Invalid Configuration fetched from Management Server" },
// Ndbfs error messages
{2801, "No file system path"},
{2802, "Channel is full"},
{2803, "No more threads"},
{2804, "Bad parameter"},
{2805, "Illegal file system path"},
{2806, "Max number of open files exceeded"},
{2807, "File has already been opened"},
// Sentinel
{0, "No message slogan found"}
};
const unsigned short NO_OF_ERROR_MESSAGES = sizeof(errArray)/sizeof(ErrStruct);
const char* lookupErrorMessage(int faultId)
{
int i = 0;
while (errArray[i].fauldId != faultId && errArray[i].fauldId != 0)
i++;
return errArray[i].text;
}

View file

@ -17,9 +17,8 @@
#include <ndb_global.h> #include <ndb_global.h>
#include "Error.hpp" #include <ndbd_exit_codes.h>
#include "ErrorReporter.hpp" #include "ErrorReporter.hpp"
#include "ErrorMessages.hpp"
#include <FastScheduler.hpp> #include <FastScheduler.hpp>
#include <DebuggerNames.hpp> #include <DebuggerNames.hpp>
@ -29,17 +28,9 @@
#include <NdbAutoPtr.hpp> #include <NdbAutoPtr.hpp>
#define MESSAGE_LENGTH 400 #define MESSAGE_LENGTH 500
const char* errorType[] = { static int WriteMessage(int thrdMessageID,
"warning",
"error",
"fatal",
"assert"
};
static int WriteMessage(ErrorCategory thrdType, int thrdMessageID,
const char* thrdProblemData, const char* thrdProblemData,
const char* thrdObjRef, const char* thrdObjRef,
Uint32 thrdTheEmulatedJamIndex, Uint32 thrdTheEmulatedJamIndex,
@ -116,24 +107,35 @@ ErrorReporter::get_trace_no(){
void void
ErrorReporter::formatMessage(ErrorCategory type, ErrorReporter::formatMessage(int faultID,
int faultID,
const char* problemData, const char* problemData,
const char* objRef, const char* objRef,
const char* theNameOfTheTraceFile, const char* theNameOfTheTraceFile,
char* messptr){ char* messptr){
int processId; int processId;
ndbd_exit_classification cl;
ndbd_exit_status st;
const char *exit_msg = ndbd_exit_message(faultID, &cl);
const char *exit_cl_msg = ndbd_exit_classification_message(cl, &st);
const char *exit_st_msg = ndbd_exit_status_message(st);
processId = NdbHost_GetProcessId(); processId = NdbHost_GetProcessId();
BaseString::snprintf(messptr, MESSAGE_LENGTH, BaseString::snprintf(messptr, MESSAGE_LENGTH,
"Date/Time: %s\nType of error: %s\n" "Time: %s\n"
"Message: %s\nFault ID: %d\nProblem data: %s" "Status: %s\n"
"\nObject of reference: %s\nProgramName: %s\n" "Message: %s (%s)\n"
"ProcessID: %d\nTraceFile: %s\n%s\n***EOM***\n", "Error: %d\n"
"Error data: %s\n"
"Error object: %s\n"
"Program: %s\n"
"Pid: %d\n"
"Trace: %s\n"
"Version: %s\n"
"***EOM***\n",
formatTimeStampString() , formatTimeStampString() ,
errorType[type], exit_st_msg,
lookupErrorMessage(faultID), exit_msg, exit_cl_msg,
faultID, faultID,
(problemData == NULL) ? "" : problemData, (problemData == NULL) ? "" : problemData,
objRef, objRef,
@ -160,8 +162,10 @@ ErrorReporter::setErrorHandlerShutdownType(NdbShutdownType nst)
s_errorHandlerShutdownType = nst; s_errorHandlerShutdownType = nst;
} }
void childReportError(int error);
void void
ErrorReporter::handleAssert(const char* message, const char* file, int line) ErrorReporter::handleAssert(const char* message, const char* file, int line, int ec)
{ {
char refMessage[100]; char refMessage[100];
@ -175,38 +179,26 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line)
BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)", BaseString::snprintf(refMessage, 100, "%s line: %d (block: %s)",
file, line, blockName); file, line, blockName);
#endif #endif
WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage, WriteMessage(ec, message, refMessage,
theEmulatedJamIndex, theEmulatedJam); theEmulatedJamIndex, theEmulatedJam);
childReportError(ec);
NdbShutdown(s_errorHandlerShutdownType); NdbShutdown(s_errorHandlerShutdownType);
} }
void void
ErrorReporter::handleThreadAssert(const char* message, ErrorReporter::handleError(int messageID,
const char* file,
int line)
{
char refMessage[100];
BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d - %s",
file, line, message);
NdbShutdown(s_errorHandlerShutdownType);
}//ErrorReporter::handleThreadAssert()
void
ErrorReporter::handleError(ErrorCategory type, int messageID,
const char* problemData, const char* problemData,
const char* objRef, const char* objRef,
NdbShutdownType nst) NdbShutdownType nst)
{ {
type = ecError; WriteMessage(messageID, problemData,
// The value for type is not always set correctly in the calling function.
// So, to correct this, we set it set it to the value corresponding to
// the function that is called.
WriteMessage(type, messageID, problemData,
objRef, theEmulatedJamIndex, theEmulatedJam); objRef, theEmulatedJamIndex, theEmulatedJam);
if(messageID == ERR_ERROR_INSERT){
childReportError(messageID);
if(messageID == NDBD_EXIT_ERROR_INSERT){
NdbShutdown(NST_ErrorInsert); NdbShutdown(NST_ErrorInsert);
} else { } else {
if (nst == NST_ErrorHandler) if (nst == NST_ErrorHandler)
@ -216,7 +208,7 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
} }
int int
WriteMessage(ErrorCategory thrdType, int thrdMessageID, WriteMessage(int thrdMessageID,
const char* thrdProblemData, const char* thrdObjRef, const char* thrdProblemData, const char* thrdObjRef,
Uint32 thrdTheEmulatedJamIndex, Uint32 thrdTheEmulatedJamIndex,
Uint8 thrdTheEmulatedJam[]){ Uint8 thrdTheEmulatedJam[]){
@ -257,7 +249,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID,
" \n\n\n"); " \n\n\n");
// ...and write the error-message... // ...and write the error-message...
ErrorReporter::formatMessage(thrdType, thrdMessageID, ErrorReporter::formatMessage(thrdMessageID,
thrdProblemData, thrdObjRef, thrdProblemData, thrdObjRef,
theTraceFileName, theMessage); theTraceFileName, theMessage);
fprintf(stream, "%s", theMessage); fprintf(stream, "%s", theMessage);
@ -284,7 +276,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID,
fseek(stream, offset, SEEK_SET); fseek(stream, offset, SEEK_SET);
// ...and write the error-message there... // ...and write the error-message there...
ErrorReporter::formatMessage(thrdType, thrdMessageID, ErrorReporter::formatMessage(thrdMessageID,
thrdProblemData, thrdObjRef, thrdProblemData, thrdObjRef,
theTraceFileName, theMessage); theTraceFileName, theMessage);
fprintf(stream, "%s", theMessage); fprintf(stream, "%s", theMessage);

View file

@ -18,9 +18,9 @@
#define ERRORREPORTER_H #define ERRORREPORTER_H
#include <ndb_global.h> #include <ndb_global.h>
#include <ndbd_exit_codes.h>
#include "TimeModule.hpp" #include "TimeModule.hpp"
#include "Error.hpp"
#include <Emulator.hpp> #include <Emulator.hpp>
class ErrorReporter class ErrorReporter
@ -29,25 +29,18 @@ public:
static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler); static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler);
static void handleAssert(const char* message, static void handleAssert(const char* message,
const char* file, const char* file,
int line); int line, int ec = NDBD_EXIT_PRGERR);
static void handleThreadAssert(const char* message, static void handleError(int faultID,
const char* file,
int line);
static void handleError(ErrorCategory type,
int faultID,
const char* problemData, const char* problemData,
const char* objRef, const char* objRef,
enum NdbShutdownType = NST_ErrorHandler); enum NdbShutdownType = NST_ErrorHandler);
static void handleWarning(ErrorCategory type, static void handleWarning(int faultID,
int faultID,
const char* problemData, const char* problemData,
const char* objRef); const char* objRef);
static void formatMessage(ErrorCategory type, static void formatMessage(int faultID,
int faultID,
const char* problemData, const char* problemData,
const char* objRef, const char* objRef,
const char* theNameOfTheTraceFile, const char* theNameOfTheTraceFile,

View file

@ -2,7 +2,7 @@ noinst_LIBRARIES = liberror.a
liberror_a_SOURCES = TimeModule.cpp \ liberror_a_SOURCES = TimeModule.cpp \
ErrorReporter.cpp \ ErrorReporter.cpp \
ErrorMessages.cpp ndbd_exit_codes.c
include $(top_srcdir)/storage/ndb/config/common.mk.am include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am

View file

@ -37,6 +37,8 @@
#include <NdbAutoPtr.hpp> #include <NdbAutoPtr.hpp>
#include <Properties.hpp>
#include <mgmapi_debug.h> #include <mgmapi_debug.h>
#if defined NDB_SOLARIS // ok #if defined NDB_SOLARIS // ok
@ -61,16 +63,181 @@ extern "C" void handler_sigusr1(int signum); // child signalling failed restart
void systemInfo(const Configuration & conf, void systemInfo(const Configuration & conf,
const LogLevel & ll); const LogLevel & ll);
static FILE *child_info_file_r= 0;
static FILE *child_info_file_w= 0;
static void writeChildInfo(const char *token, int val)
{
fprintf(child_info_file_w, "%s=%d\n", token, val);
fflush(child_info_file_w);
}
void childReportSignal(int signum)
{
writeChildInfo("signal", signum);
}
void childReportError(int error)
{
writeChildInfo("error", error);
}
void childExit(int code, Uint32 currentStartPhase)
{
writeChildInfo("sphase", currentStartPhase);
writeChildInfo("exit", code);
fprintf(child_info_file_w, "\n");
fclose(child_info_file_r);
fclose(child_info_file_w);
exit(code);
}
void childAbort(int code, Uint32 currentStartPhase)
{
writeChildInfo("sphase", currentStartPhase);
writeChildInfo("exit", code);
fprintf(child_info_file_w, "\n");
fclose(child_info_file_r);
fclose(child_info_file_w);
signal(6, SIG_DFL);
abort();
}
static int insert(const char * pair, Properties & p)
{
BaseString tmp(pair);
tmp.trim(" \t\n\r");
Vector<BaseString> split;
tmp.split(split, ":=", 2);
if(split.size() != 2)
return -1;
p.put(split[0].trim().c_str(), split[1].trim().c_str());
return 0;
}
static int readChildInfo(Properties &info)
{
fclose(child_info_file_w);
char buf[128];
while (fgets(buf,sizeof(buf),child_info_file_r))
insert(buf,info);
fclose(child_info_file_r);
return 0;
}
static bool get_int_property(Properties &info,
const char *token, Uint32 *int_val)
{
const char *str_val= 0;
if (!info.get(token, &str_val))
return false;
char *endptr;
long int tmp= strtol(str_val, &endptr, 10);
if (str_val == endptr)
return false;
*int_val = tmp;
return true;
}
int reportShutdown(class Configuration *config, int error_exit, int restart)
{
Uint32 error= 0, signum= 0, sphase= 256;
Properties info;
readChildInfo(info);
get_int_property(info, "signal", &signum);
get_int_property(info, "error", &error);
get_int_property(info, "sphase", &sphase);
Uint32 length, theData[25];
EventReport *rep = (EventReport *)theData;
rep->setNodeId(globalData.ownId);
if (restart)
theData[1] = 1 |
(globalData.theRestartFlag == initial_state ? 2 : 0) |
(config->getInitialStart() ? 4 : 0);
else
theData[1] = 0;
if (error_exit == 0)
{
rep->setEventType(NDB_LE_NDBStopCompleted);
theData[2] = signum;
length = 3;
}
else
{
rep->setEventType(NDB_LE_NDBStopForced);
theData[2] = signum;
theData[3] = error;
theData[4] = sphase;
theData[5] = 0; // extra
length = 6;
}
{ // Log event
const EventReport * const eventReport = (EventReport *)&theData[0];
g_eventLogger.log(eventReport->getEventType(), theData,
eventReport->getNodeId(), 0);
}
for (unsigned n = 0; n < config->m_mgmds.size(); n++)
{
NdbMgmHandle h = ndb_mgm_create_handle();
if (h == 0 ||
ndb_mgm_set_connectstring(h, config->m_mgmds[n].c_str()) ||
ndb_mgm_connect(h,
1, //no_retries
0, //retry_delay_in_seconds
0 //verbose
))
goto handle_error;
{
if (ndb_mgm_report_event(h, theData, length))
goto handle_error;
}
goto do_next;
handle_error:
if (h)
{
BaseString tmp(ndb_mgm_get_latest_error_msg(h));
tmp.append(" : ");
tmp.append(ndb_mgm_get_latest_error_desc(h));
g_eventLogger.warning("Unable to report shutdown reason to %s: %s",
config->m_mgmds[n].c_str(), tmp.c_str());
}
else
{
g_eventLogger.error("Unable to report shutdown reason to %s",
config->m_mgmds[n].c_str());
}
do_next:
if (h)
{
ndb_mgm_disconnect(h);
ndb_mgm_destroy_handle(&h);
}
}
return 0;
}
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
// Print to stdout/console // Print to stdout/console
g_eventLogger.createConsoleHandler(); g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("ndbd"); g_eventLogger.setCategory("ndbd");
g_eventLogger.enable(Logger::LL_ON, Logger::LL_INFO);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL); g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING); g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
g_eventLogger.m_logLevel.setLogLevel(LogLevel::llStartUp, 15);
globalEmulatorData.create(); globalEmulatorData.create();
// Parse command line options // Parse command line options
@ -103,10 +270,38 @@ int main(int argc, char** argv)
#ifndef NDB_WIN32 #ifndef NDB_WIN32
signal(SIGUSR1, handler_sigusr1); signal(SIGUSR1, handler_sigusr1);
for(pid_t child = fork(); child != 0; child = fork()){ pid_t child;
while (1)
{
// setup reporting between child and parent
int filedes[2];
if (pipe(filedes))
{
g_eventLogger.error("pipe() failed with errno=%d (%s)",
errno, strerror(errno));
return 1;
}
else
{
if (!(child_info_file_w= fdopen(filedes[1],"w")))
{
g_eventLogger.error("fdopen() failed with errno=%d (%s)",
errno, strerror(errno));
}
if (!(child_info_file_r= fdopen(filedes[0],"r")))
{
g_eventLogger.error("fdopen() failed with errno=%d (%s)",
errno, strerror(errno));
}
}
if ((child = fork()) <= 0)
break; // child or error
/** /**
* Parent * Parent
*/ */
catchsigs(true); catchsigs(true);
/** /**
@ -115,12 +310,13 @@ int main(int argc, char** argv)
*/ */
theConfig->closeConfiguration(); theConfig->closeConfiguration();
int status = 0; int status = 0, error_exit = 0, signum = 0;
while(waitpid(child, &status, 0) != child); while(waitpid(child, &status, 0) != child);
if(WIFEXITED(status)){ if(WIFEXITED(status)){
switch(WEXITSTATUS(status)){ switch(WEXITSTATUS(status)){
case NRT_Default: case NRT_Default:
g_eventLogger.info("Angel shutting down"); g_eventLogger.info("Angel shutting down");
reportShutdown(theConfig, 0, 0);
exit(0); exit(0);
break; break;
case NRT_NoStart_Restart: case NRT_NoStart_Restart:
@ -136,10 +332,12 @@ int main(int argc, char** argv)
globalData.theRestartFlag = perform_start; globalData.theRestartFlag = perform_start;
break; break;
default: default:
error_exit = 1;
if(theConfig->stopOnError()){ if(theConfig->stopOnError()){
/** /**
* Error shutdown && stopOnError() * Error shutdown && stopOnError()
*/ */
reportShutdown(theConfig, error_exit, 0);
exit(0); exit(0);
} }
// Fall-through // Fall-through
@ -148,12 +346,27 @@ int main(int argc, char** argv)
globalData.theRestartFlag = perform_start; globalData.theRestartFlag = perform_start;
break; break;
} }
} else if(theConfig->stopOnError()){ } else {
/** error_exit = 1;
* Error shutdown && stopOnError() if (WIFSIGNALED(status))
*/ {
exit(0); signum = WTERMSIG(status);
childReportSignal(signum);
}
else
{
signum = 127;
g_eventLogger.info("Unknown exit reason. Stopped.");
}
if(theConfig->stopOnError()){
/**
* Error shutdown && stopOnError()
*/
reportShutdown(theConfig, error_exit, 0);
exit(0);
}
} }
if (!failed_startup_flag) if (!failed_startup_flag)
{ {
// Reset the counter for consecutive failed startups // Reset the counter for consecutive failed startups
@ -164,15 +377,21 @@ int main(int argc, char** argv)
/** /**
* Error shutdown && stopOnError() * Error shutdown && stopOnError()
*/ */
g_eventLogger.alert("Ndbd has failed %u consecutive startups. Not restarting", failed_startups); g_eventLogger.alert("Ndbd has failed %u consecutive startups. "
"Not restarting", failed_startups);
reportShutdown(theConfig, error_exit, 0);
exit(0); exit(0);
} }
failed_startup_flag = false; failed_startup_flag = false;
reportShutdown(theConfig, error_exit, 1);
g_eventLogger.info("Ndb has terminated (pid %d) restarting", child); g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
theConfig->fetch_configuration(); theConfig->fetch_configuration();
} }
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); if (child >= 0)
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
else
g_eventLogger.info("Ndb pid: %d", getpid());
#else #else
g_eventLogger.info("Ndb started"); g_eventLogger.info("Ndb started");
#endif #endif
@ -226,7 +445,7 @@ int main(int argc, char** argv)
// Re-use the mgm handle as a transporter // Re-use the mgm handle as a transporter
if(!globalTransporterRegistry.connect_client( if(!globalTransporterRegistry.connect_client(
theConfig->get_config_retriever()->get_mgmHandlePtr())) theConfig->get_config_retriever()->get_mgmHandlePtr()))
ERROR_SET(fatal, ERR_INVALID_CONFIG, ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
"Connection to mgmd terminated before setup was complete", "Connection to mgmd terminated before setup was complete",
"StopOnError missing"); "StopOnError missing");
@ -371,6 +590,8 @@ extern "C"
void void
handler_shutdown(int signum){ handler_shutdown(int signum){
g_eventLogger.info("Received signal %d. Performing stop.", signum); g_eventLogger.info("Received signal %d. Performing stop.", signum);
childReportError(0);
childReportSignal(signum);
globalData.theRestartFlag = perform_stop; globalData.theRestartFlag = perform_stop;
} }
@ -395,10 +616,15 @@ handler_error(int signum){
NdbSleep_MilliSleep(10); NdbSleep_MilliSleep(10);
thread_id= my_thread_id(); thread_id= my_thread_id();
g_eventLogger.info("Received signal %d. Running error handler.", signum); g_eventLogger.info("Received signal %d. Running error handler.", signum);
childReportSignal(signum);
// restart the system // restart the system
char errorData[40]; char errorData[64], *info= 0;
BaseString::snprintf(errorData, 40, "Signal %d received", signum); #ifdef HAVE_STRSIGNAL
ERROR_SET_SIGNAL(fatal, 0, errorData, __FILE__); info= strsignal(signum);
#endif
BaseString::snprintf(errorData, sizeof(errorData), "Signal %d received; %s", signum,
info ? info : "No text for signal available");
ERROR_SET_SIGNAL(fatal, NDBD_EXIT_OS_SIGNAL_RECEIVED, errorData, __FILE__);
} }
extern "C" extern "C"

View file

@ -18,6 +18,7 @@
#define ARRAY_POOL_HPP #define ARRAY_POOL_HPP
#include <ndb_global.h> #include <ndb_global.h>
#include "ndbd_malloc.hpp"
#include <pc.hpp> #include <pc.hpp>
#include <ErrorReporter.hpp> #include <ErrorReporter.hpp>
@ -44,7 +45,7 @@ public:
* *
* Note, can currently only be called once * Note, can currently only be called once
*/ */
bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true);
inline Uint32 getNoOfFree() const { inline Uint32 getNoOfFree() const {
return noOfFree; return noOfFree;
@ -201,7 +202,7 @@ template <class T>
inline inline
ArrayPool<T>::~ArrayPool(){ ArrayPool<T>::~ArrayPool(){
if(theArray != 0){ if(theArray != 0){
NdbMem_Free(theArray); ndbd_free(theArray, size * sizeof(T));
theArray = 0; theArray = 0;
#ifdef ARRAY_GUARD #ifdef ARRAY_GUARD
delete []theAllocatedBitmask; delete []theAllocatedBitmask;
@ -218,13 +219,19 @@ ArrayPool<T>::~ArrayPool(){
template <class T> template <class T>
inline inline
bool bool
ArrayPool<T>::setSize(Uint32 noOfElements){ ArrayPool<T>::setSize(Uint32 noOfElements, bool exit_on_error){
if(size == 0){ if(size == 0){
if(noOfElements == 0) if(noOfElements == 0)
return true; return true;
theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); theArray = (T *)ndbd_malloc(noOfElements * sizeof(T));
if(theArray == 0) if(theArray == 0)
return false; {
if (!exit_on_error)
return false;
ErrorReporter::handleAssert("ArrayPool<T>::setSize malloc failed",
__FILE__, __LINE__, NDBD_EXIT_MEMALLOC);
return false; // not reached
}
size = noOfElements; size = noOfElements;
noOfFree = noOfElements; noOfFree = noOfElements;
@ -247,7 +254,11 @@ ArrayPool<T>::setSize(Uint32 noOfElements){
return true; return true;
} }
return false; if (!exit_on_error)
return false;
ErrorReporter::handleAssert("ArrayPool<T>::setSize called twice", __FILE__, __LINE__);
return false; // not reached
} }
template <class T> template <class T>

View file

@ -17,6 +17,8 @@
#ifndef CARRAY_HPP #ifndef CARRAY_HPP
#define CARRAY_HPP #define CARRAY_HPP
#include "ndbd_malloc.hpp"
/** /**
* Template class used for implementing an c - array * Template class used for implementing an c - array
*/ */
@ -31,7 +33,7 @@ public:
* *
* Note, can currently only be called once * Note, can currently only be called once
*/ */
bool setSize(Uint32 noOfElements); bool setSize(Uint32 noOfElements, bool exit_on_error = true);
/** /**
* Get size * Get size
@ -69,7 +71,7 @@ template <class T>
inline inline
CArray<T>::~CArray(){ CArray<T>::~CArray(){
if(theArray != 0){ if(theArray != 0){
NdbMem_Free(theArray); ndbd_free(theArray, size * sizeof(T));
theArray = 0; theArray = 0;
} }
} }
@ -82,13 +84,19 @@ CArray<T>::~CArray(){
template <class T> template <class T>
inline inline
bool bool
CArray<T>::setSize(Uint32 noOfElements){ CArray<T>::setSize(Uint32 noOfElements, bool exit_on_error){
if(size == noOfElements) if(size == noOfElements)
return true; return true;
theArray = (T *)NdbMem_Allocate(noOfElements * sizeof(T)); theArray = (T *)ndbd_malloc(noOfElements * sizeof(T));
if(theArray == 0) if(theArray == 0)
return false; {
if (!exit_on_error)
return false;
ErrorReporter::handleAssert("CArray<T>::setSize malloc failed",
__FILE__, __LINE__, NDBD_EXIT_MEMALLOC);
return false; // not reached
}
size = noOfElements; size = noOfElements;
return true; return true;
} }

View file

@ -359,12 +359,12 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){
if(!db.get(tmp[i].attrib, tmp[i].storage)){ if(!db.get(tmp[i].attrib, tmp[i].storage)){
char buf[255]; char buf[255];
BaseString::snprintf(buf, sizeof(buf), "%s not found", tmp[i].attrib); BaseString::snprintf(buf, sizeof(buf), "%s not found", tmp[i].attrib);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
} }
if(!p.get("NoOfNodes", &cd.SizeAltData.noOfNodes)){ if(!p.get("NoOfNodes", &cd.SizeAltData.noOfNodes)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "NoOfNodes missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "NoOfNodes missing");
} }
Properties::Iterator it(&p); Properties::Iterator it(&p);
@ -378,36 +378,36 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){
const Properties * node; const Properties * node;
if(!p.get(name, &node)){ if(!p.get(name, &node)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "Node data missing");
} }
if(!node->get("Id", &nodeId)){ if(!node->get("Id", &nodeId)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Id) missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "Node data (Id) missing");
} }
if(!node->get("Type", &nodeType)){ if(!node->get("Type", &nodeType)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Type) missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "Node data (Type) missing");
} }
if(nodeId > MAX_NODES){ if(nodeId > MAX_NODES){
char buf[255]; char buf[255];
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Maximum DB node id allowed is: %d", MAX_NDB_NODES); "Maximum DB node id allowed is: %d", MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
if(nodeId == 0){ if(nodeId == 0){
char buf[255]; char buf[255];
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Minimum node id allowed in the cluster is: 1"); "Minimum node id allowed in the cluster is: 1");
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
for(unsigned j = 0; j<nodeNo; j++){ for(unsigned j = 0; j<nodeNo; j++){
if(cd.nodeData[j].nodeId == nodeId){ if(cd.nodeData[j].nodeId == nodeId){
char buf[255]; char buf[255];
BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id"); BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id");
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
} }
@ -430,14 +430,14 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){
if(nodeId > MAX_NDB_NODES){ if(nodeId > MAX_NDB_NODES){
char buf[255]; char buf[255];
BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
if(cd.SizeAltData.noOfNDBNodes > MAX_NDB_NODES){ if(cd.SizeAltData.noOfNDBNodes > MAX_NDB_NODES){
char buf[255]; char buf[255];
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf),
"Maximum %d ndb nodes is allowed in the cluster", "Maximum %d ndb nodes is allowed in the cluster",
MAX_NDB_NODES); MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
} else if(strcmp("API", nodeType) == 0){ } else if(strcmp("API", nodeType) == 0){
cd.nodeData[nodeNo].nodeType = NodeInfo::API; cd.nodeData[nodeNo].nodeType = NodeInfo::API;
@ -452,7 +452,7 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){
cd.SizeAltData.noOfMGMNodes++; // No of MGM processes cd.SizeAltData.noOfMGMNodes++; // No of MGM processes
tmpApiMgmProperties = "MGM"; tmpApiMgmProperties = "MGM";
} else { } else {
ERROR_SET(fatal, ERR_INVALID_CONFIG, ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
"Invalid configuration: Unknown node type", "Invalid configuration: Unknown node type",
nodeType); nodeType);
} }
@ -462,7 +462,7 @@ void ClusterConfiguration::init(const Properties & p, const Properties & db){
const Properties* q = 0; const Properties* q = 0;
if (!p.get(tmpApiMgmProperties, nodeId, &q)) { if (!p.get(tmpApiMgmProperties, nodeId, &q)) {
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, tmpApiMgmProperties); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, tmpApiMgmProperties);
} else { } else {
*/ */
Uint32 rank = 0; Uint32 rank = 0;

View file

@ -194,7 +194,7 @@ Configuration::fetch_configuration(){
if (m_config_retriever->hasError()) if (m_config_retriever->hasError())
{ {
ERROR_SET(fatal, ERR_INVALID_CONFIG, ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
"Could not connect initialize handle to management server", "Could not connect initialize handle to management server",
m_config_retriever->getErrorString()); m_config_retriever->getErrorString());
} }
@ -206,7 +206,7 @@ Configuration::fetch_configuration(){
/* Set stop on error to true otherwise NDB will /* Set stop on error to true otherwise NDB will
go into an restart loop... go into an restart loop...
*/ */
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Could not connect to ndb_mgmd", s); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Could not connect to ndb_mgmd", s);
} }
m_mgmd_port= m_config_retriever->get_mgmd_port(); m_mgmd_port= m_config_retriever->get_mgmd_port();
@ -224,7 +224,7 @@ Configuration::fetch_configuration(){
globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/); globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/);
if(globalData.ownId == 0){ if(globalData.ownId == 0){
ERROR_SET(fatal, ERR_INVALID_CONFIG, ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
"Unable to alloc node id", m_config_retriever->getErrorString()); "Unable to alloc node id", m_config_retriever->getErrorString());
} }
@ -238,7 +238,7 @@ Configuration::fetch_configuration(){
go into an restart loop... go into an restart loop...
*/ */
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Could not fetch configuration" ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Could not fetch configuration"
"/invalid configuration", s); "/invalid configuration", s);
} }
if(m_clusterConfig) if(m_clusterConfig)
@ -248,13 +248,36 @@ Configuration::fetch_configuration(){
ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE); ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
if (iter.find(CFG_NODE_ID, globalData.ownId)){ if (iter.find(CFG_NODE_ID, globalData.ownId)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", "DB missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched", "DB missing");
} }
if(iter.get(CFG_DB_STOP_ON_ERROR, &_stopOnError)){ if(iter.get(CFG_DB_STOP_ON_ERROR, &_stopOnError)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"StopOnError missing"); "StopOnError missing");
} }
m_mgmds.clear();
for(ndb_mgm_first(&iter); ndb_mgm_valid(&iter); ndb_mgm_next(&iter))
{
Uint32 nodeType, port;
char const *hostname;
ndb_mgm_get_int_parameter(&iter,CFG_TYPE_OF_SECTION,&nodeType);
if (nodeType != NodeInfo::MGM)
continue;
if (ndb_mgm_get_string_parameter(&iter,CFG_NODE_HOST, &hostname) ||
ndb_mgm_get_int_parameter(&iter,CFG_MGM_PORT, &port) ||
hostname == 0 || hostname[0] == 0)
{
continue;
}
BaseString connectstring(hostname);
connectstring.appfmt(":%d", port);
m_mgmds.push_back(connectstring);
}
} }
static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
@ -262,12 +285,12 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
{ {
const char* path = NULL; const char* path = NULL;
if(iter.get(param, &path)){ if(iter.get(param, &path)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched missing ", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched missing ",
param_string); param_string);
} }
if(path == 0 || strlen(path) == 0){ if(path == 0 || strlen(path) == 0){
ERROR_SET(fatal, ERR_INVALID_CONFIG, ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
"Invalid configuration fetched. Configuration does not contain valid ", "Invalid configuration fetched. Configuration does not contain valid ",
param_string); param_string);
} }
@ -285,7 +308,7 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
(::access(buf2, W_OK) != 0)) (::access(buf2, W_OK) != 0))
#endif #endif
{ {
ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); ERROR_SET(fatal, NDBD_EXIT_AFS_INVALIDPATH, path, param_string);
} }
if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR)) if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR))
@ -309,7 +332,7 @@ Configuration::setupConfiguration(){
* p, * p,
globalTransporterRegistry); globalTransporterRegistry);
if(res <= 0){ if(res <= 0){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"No transporters configured"); "No transporters configured");
} }
} }
@ -319,27 +342,27 @@ Configuration::setupConfiguration(){
*/ */
ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE); ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
if (iter.find(CFG_NODE_ID, globalData.ownId)){ if (iter.find(CFG_NODE_ID, globalData.ownId)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", "DB missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched", "DB missing");
} }
unsigned type; unsigned type;
if(!(iter.get(CFG_TYPE_OF_SECTION, &type) == 0 && type == NODE_TYPE_DB)){ if(!(iter.get(CFG_TYPE_OF_SECTION, &type) == 0 && type == NODE_TYPE_DB)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"I'm wrong type of node"); "I'm wrong type of node");
} }
if(iter.get(CFG_DB_NO_SAVE_MSGS, &_maxErrorLogs)){ if(iter.get(CFG_DB_NO_SAVE_MSGS, &_maxErrorLogs)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"MaxNoOfSavedMessages missing"); "MaxNoOfSavedMessages missing");
} }
if(iter.get(CFG_DB_MEMLOCK, &_lockPagesInMainMemory)){ if(iter.get(CFG_DB_MEMLOCK, &_lockPagesInMainMemory)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"LockPagesInMainMemory missing"); "LockPagesInMainMemory missing");
} }
if(iter.get(CFG_DB_WATCHDOG_INTERVAL, &_timeBetweenWatchDogCheck)){ if(iter.get(CFG_DB_WATCHDOG_INTERVAL, &_timeBetweenWatchDogCheck)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"TimeBetweenWatchDogCheck missing"); "TimeBetweenWatchDogCheck missing");
} }
@ -354,7 +377,7 @@ Configuration::setupConfiguration(){
_backupPath= get_and_validate_path(iter, CFG_DB_BACKUP_DATADIR, "BackupDataDir"); _backupPath= get_and_validate_path(iter, CFG_DB_BACKUP_DATADIR, "BackupDataDir");
if(iter.get(CFG_DB_STOP_ON_ERROR_INSERT, &m_restartOnErrorInsert)){ if(iter.get(CFG_DB_STOP_ON_ERROR_INSERT, &m_restartOnErrorInsert)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Invalid configuration fetched", ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched",
"RestartOnErrorInsert missing"); "RestartOnErrorInsert missing");
} }
@ -496,7 +519,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
*tmp[i].storage = 0; *tmp[i].storage = 0;
} else { } else {
BaseString::snprintf(buf, sizeof(buf),"ConfigParam: %d not found", tmp[i].paramId); BaseString::snprintf(buf, sizeof(buf),"ConfigParam: %d not found", tmp[i].paramId);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
} }
} }
@ -506,12 +529,12 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
ndb_mgm_get_int64_parameter(&db, CFG_DB_INDEX_MEM, &indexMem); ndb_mgm_get_int64_parameter(&db, CFG_DB_INDEX_MEM, &indexMem);
if(dataMem == 0){ if(dataMem == 0){
BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_DATA_MEM); BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_DATA_MEM);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
if(indexMem == 0){ if(indexMem == 0){
BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_INDEX_MEM); BaseString::snprintf(buf, sizeof(buf), "ConfigParam: %d not found", CFG_DB_INDEX_MEM);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
noOfDataPages = (dataMem / 32768); noOfDataPages = (dataMem / 32768);
@ -535,23 +558,23 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
Uint32 nodeType; Uint32 nodeType;
if(ndb_mgm_get_int_parameter(p, CFG_NODE_ID, &nodeId)){ if(ndb_mgm_get_int_parameter(p, CFG_NODE_ID, &nodeId)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Id) missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "Node data (Id) missing");
} }
if(ndb_mgm_get_int_parameter(p, CFG_TYPE_OF_SECTION, &nodeType)){ if(ndb_mgm_get_int_parameter(p, CFG_TYPE_OF_SECTION, &nodeType)){
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, "Node data (Type) missing"); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, "Node data (Type) missing");
} }
if(nodeId > MAX_NODES || nodeId == 0){ if(nodeId > MAX_NODES || nodeId == 0){
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf),
"Invalid node id: %d", nodeId); "Invalid node id: %d", nodeId);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
if(nodes.get(nodeId)){ if(nodes.get(nodeId)){
BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id: %d", BaseString::snprintf(buf, sizeof(buf), "Two node can not have the same node id: %d",
nodeId); nodeId);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
nodes.set(nodeId); nodes.set(nodeId);
@ -562,7 +585,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
if(nodeId > MAX_NDB_NODES){ if(nodeId > MAX_NDB_NODES){
BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
MAX_NDB_NODES); MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
break; break;
case NODE_TYPE_API: case NODE_TYPE_API:
@ -573,7 +596,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
break; break;
default: default:
BaseString::snprintf(buf, sizeof(buf), "Unknown node type: %d", nodeType); BaseString::snprintf(buf, sizeof(buf), "Unknown node type: %d", nodeType);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, msg, buf);
} }
} }
noOfNodes = nodeNo; noOfNodes = nodeNo;

View file

@ -75,6 +75,8 @@ public:
private: private:
friend class Cmvmi; friend class Cmvmi;
friend class Qmgr; friend class Qmgr;
friend int reportShutdown(class Configuration *config, int error, int restart);
ndb_mgm_configuration_iterator * getClusterConfigIterator() const; ndb_mgm_configuration_iterator * getClusterConfigIterator() const;
Uint32 _stopOnError; Uint32 _stopOnError;
@ -91,6 +93,8 @@ private:
ConfigRetriever *m_config_retriever; ConfigRetriever *m_config_retriever;
Vector<BaseString> m_mgmds;
/** /**
* arguments to NDB process * arguments to NDB process
*/ */

View file

@ -35,11 +35,16 @@
#include <EventLogger.hpp> #include <EventLogger.hpp>
void childExit(int code, Uint32 currentStartPhase);
void childAbort(int code, Uint32 currentStartPhase);
extern "C" { extern "C" {
extern void (* ndb_new_handler)(); extern void (* ndb_new_handler)();
} }
extern EventLogger g_eventLogger; extern EventLogger g_eventLogger;
extern my_bool opt_core; extern my_bool opt_core;
// instantiated and updated in NdbcntrMain.cpp
extern Uint32 g_currentStartPhase;
/** /**
* Declare the global variables * Declare the global variables
@ -76,7 +81,7 @@ EmulatorData::EmulatorData(){
void void
ndb_new_handler_impl(){ ndb_new_handler_impl(){
ERROR_SET(fatal, ERR_MEMALLOC, "New handler", ""); ERROR_SET(fatal, NDBD_EXIT_MEMALLOC, "New handler", "");
} }
void void
@ -111,8 +116,8 @@ EmulatorData::destroy(){
void void
NdbShutdown(NdbShutdownType type, NdbShutdown(NdbShutdownType type,
NdbRestartType restartType){ NdbRestartType restartType)
{
if(type == NST_ErrorInsert){ if(type == NST_ErrorInsert){
type = NST_Restart; type = NST_Restart;
restartType = (NdbRestartType) restartType = (NdbRestartType)
@ -181,12 +186,11 @@ NdbShutdown(NdbShutdownType type,
g_eventLogger.info("Watchdog shutdown completed - %s", exitAbort); g_eventLogger.info("Watchdog shutdown completed - %s", exitAbort);
if (opt_core) if (opt_core)
{ {
signal(6, SIG_DFL); childAbort(-1,g_currentStartPhase);
abort();
} }
else else
{ {
exit(-1); childExit(-1,g_currentStartPhase);
} }
} }
@ -241,12 +245,11 @@ NdbShutdown(NdbShutdownType type,
g_eventLogger.info("Error handler shutdown completed - %s", exitAbort); g_eventLogger.info("Error handler shutdown completed - %s", exitAbort);
if (opt_core) if (opt_core)
{ {
signal(6, SIG_DFL); childAbort(-1,g_currentStartPhase);
abort();
} }
else else
{ {
exit(-1); childExit(-1,g_currentStartPhase);
} }
} }
@ -254,7 +257,7 @@ NdbShutdown(NdbShutdownType type,
* This is a normal restart, depend on angel * This is a normal restart, depend on angel
*/ */
if(type == NST_Restart){ if(type == NST_Restart){
exit(restartType); childExit(restartType,g_currentStartPhase);
} }
g_eventLogger.info("Shutdown completed - exiting"); g_eventLogger.info("Shutdown completed - exiting");
@ -269,10 +272,9 @@ NdbShutdown(NdbShutdownType type,
if (type== NST_Watchdog){ if (type== NST_Watchdog){
g_eventLogger.info("Watchdog is killing system the hard way"); g_eventLogger.info("Watchdog is killing system the hard way");
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) #if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
signal(6, SIG_DFL); childAbort(-1,g_currentStartPhase);
abort();
#else #else
exit(-1); childExit(-1,g_currentStartPhase);
#endif #endif
} }

View file

@ -19,7 +19,6 @@
#include "Emulator.hpp" #include "Emulator.hpp"
#include "VMSignal.hpp" #include "VMSignal.hpp"
#include <Error.hpp>
#include <SignalLoggerManager.hpp> #include <SignalLoggerManager.hpp>
#include <BlockNumbers.h> #include <BlockNumbers.h>
@ -444,21 +443,21 @@ void FastScheduler::dumpSignalMemory(FILE * output)
void void
FastScheduler::prio_level_error() FastScheduler::prio_level_error()
{ {
ERROR_SET(ecError, ERROR_WRONG_PRIO_LEVEL, ERROR_SET(ecError, NDBD_EXIT_WRONG_PRIO_LEVEL,
"Wrong Priority Level", "FastScheduler.C"); "Wrong Priority Level", "FastScheduler.C");
} }
void void
jbuf_error() jbuf_error()
{ {
ERROR_SET(ecError, BLOCK_ERROR_JBUFCONGESTION, ERROR_SET(ecError, NDBD_EXIT_BLOCK_JBUFCONGESTION,
"Job Buffer Full", "APZJobBuffer.C"); "Job Buffer Full", "APZJobBuffer.C");
} }
void void
bnr_error() bnr_error()
{ {
ERROR_SET(ecError, BLOCK_ERROR_BNR_ZERO, ERROR_SET(ecError, NDBD_EXIT_BLOCK_BNR_ZERO,
"Block Number Zero", "FastScheduler.C"); "Block Number Zero", "FastScheduler.C");
} }

View file

@ -18,7 +18,7 @@ libkernel_a_SOURCES = \
SimplePropertiesSection.cpp \ SimplePropertiesSection.cpp \
SectionReader.cpp \ SectionReader.cpp \
MetaData.cpp \ MetaData.cpp \
Mutex.cpp SafeCounter.cpp Mutex.cpp SafeCounter.cpp ndbd_malloc.cpp
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi

View file

@ -25,8 +25,8 @@ SafeCounterManager::SafeCounterManager(class SimulatedBlock & block)
{} {}
bool bool
SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes) { SafeCounterManager::setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error) {
return m_counterPool.setSize(maxNoOfActiveMutexes); return m_counterPool.setSize(maxNoOfActiveMutexes, exit_on_error);
} }
Uint32 Uint32

View file

@ -63,7 +63,7 @@ class SafeCounterManager {
public: public:
SafeCounterManager(class SimulatedBlock &); SafeCounterManager(class SimulatedBlock &);
bool setSize(Uint32 maxNoOfActiveMutexes); bool setSize(Uint32 maxNoOfActiveMutexes, bool exit_on_error = true);
Uint32 getSize() const ; Uint32 getSize() const ;
void execNODE_FAILREP(Signal*); void execNODE_FAILREP(Signal*);

View file

@ -25,11 +25,12 @@
#include <TransporterRegistry.hpp> #include <TransporterRegistry.hpp>
#include <SignalLoggerManager.hpp> #include <SignalLoggerManager.hpp>
#include <FastScheduler.hpp> #include <FastScheduler.hpp>
#include <NdbMem.h> #include "ndbd_malloc.hpp"
#include <signaldata/EventReport.hpp> #include <signaldata/EventReport.hpp>
#include <signaldata/ContinueFragmented.hpp> #include <signaldata/ContinueFragmented.hpp>
#include <signaldata/NodeStateSignalData.hpp> #include <signaldata/NodeStateSignalData.hpp>
#include <signaldata/FsRef.hpp> #include <signaldata/FsRef.hpp>
#include <signaldata/SignalDroppedRep.hpp>
#include <DebuggerNames.hpp> #include <DebuggerNames.hpp>
#include "LongSignal.hpp" #include "LongSignal.hpp"
@ -140,7 +141,6 @@ SimulatedBlock::installSimulatedBlockFunctions(){
a[GSN_UTIL_LOCK_CONF] = &SimulatedBlock::execUTIL_LOCK_CONF; a[GSN_UTIL_LOCK_CONF] = &SimulatedBlock::execUTIL_LOCK_CONF;
a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF; a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF;
a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF; a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF;
a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ;
a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF; a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF;
a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF; a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF;
a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF; a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF;
@ -158,8 +158,8 @@ SimulatedBlock::addRecSignalImpl(GlobalSignalNumber gsn,
if(gsn > MAX_GSN || (!force && theExecArray[gsn] != 0)){ if(gsn > MAX_GSN || (!force && theExecArray[gsn] != 0)){
char errorMsg[255]; char errorMsg[255];
BaseString::snprintf(errorMsg, 255, BaseString::snprintf(errorMsg, 255,
"Illeagal signal (%d %d)", gsn, MAX_GSN); "GSN %d(%d))", gsn, MAX_GSN);
ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); ERROR_SET(fatal, NDBD_EXIT_ILLEGAL_SIGNAL, errorMsg, errorMsg);
} }
theExecArray[gsn] = f; theExecArray[gsn] = f;
} }
@ -175,8 +175,7 @@ SimulatedBlock::signal_error(Uint32 gsn, Uint32 len, Uint32 recBlockNo,
"Signal (GSN: %d, Length: %d, Rec Block No: %d)", "Signal (GSN: %d, Length: %d, Rec Block No: %d)",
gsn, len, recBlockNo); gsn, len, recBlockNo);
ErrorReporter::handleError(ecError, ErrorReporter::handleError(NDBD_EXIT_BLOCK_BNR_ZERO,
BLOCK_ERROR_BNR_ZERO,
probData, probData,
objRef); objRef);
} }
@ -670,7 +669,7 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear)
n, n,
size); size);
#endif #endif
p = NdbMem_Allocate(size); p = ndbd_malloc(size);
if (p == NULL){ if (p == NULL){
char buf1[255]; char buf1[255];
char buf2[255]; char buf2[255];
@ -678,7 +677,7 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear)
getBlockName(number()), type); getBlockName(number()), type);
BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes",
(Uint32)s, (Uint32)n, (Uint32)size); (Uint32)s, (Uint32)n, (Uint32)size);
ERROR_SET(fatal, ERR_MEMALLOC, buf1, buf2); ERROR_SET(fatal, NDBD_EXIT_MEMALLOC, buf1, buf2);
} }
if(clear){ if(clear){
@ -701,11 +700,9 @@ void
SimulatedBlock::deallocRecord(void ** ptr, SimulatedBlock::deallocRecord(void ** ptr,
const char * type, size_t s, size_t n){ const char * type, size_t s, size_t n){
(void)type; (void)type;
(void)s;
(void)n;
if(* ptr != 0){ if(* ptr != 0){
NdbMem_Free(* ptr); ndbd_free(* ptr, n*s);
* ptr = 0; * ptr = 0;
} }
} }
@ -735,7 +732,7 @@ SimulatedBlock::progError(int line, int err_code, const char* extra) const {
BaseString::snprintf(&buf[0], 100, "%s (Line: %d) 0x%.8x", BaseString::snprintf(&buf[0], 100, "%s (Line: %d) 0x%.8x",
aBlockName, line, magicStatus); aBlockName, line, magicStatus);
ErrorReporter::handleError(ecError, err_code, extra, buf); ErrorReporter::handleError(err_code, extra, buf);
} }
@ -856,9 +853,12 @@ SimulatedBlock::execNDB_TAMPER(Signal * signal){
void void
SimulatedBlock::execSIGNAL_DROPPED_REP(Signal * signal){ SimulatedBlock::execSIGNAL_DROPPED_REP(Signal * signal){
ErrorReporter::handleError(ecError, char msg[64];
ERR_OUT_OF_LONG_SIGNAL_MEMORY, const SignalDroppedRep * const rep = (SignalDroppedRep *)&signal->theData[0];
"Signal lost, out of long signal memory", snprintf(msg, sizeof(msg), "%s GSN: %u (%u,%u)", getBlockName(number()),
rep->originalGsn, rep->originalLength,rep->originalSectionCount);
ErrorReporter::handleError(NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY,
msg,
__FILE__, __FILE__,
NST_ErrorHandler); NST_ErrorHandler);
} }
@ -1751,20 +1751,6 @@ void SimulatedBlock::execUTIL_UNLOCK_CONF(Signal* signal){
c_mutexMgr.execUTIL_UNLOCK_CONF(signal); c_mutexMgr.execUTIL_UNLOCK_CONF(signal);
} }
void
SimulatedBlock::execREAD_CONFIG_REQ(Signal* signal){
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr();
Uint32 ref = req->senderRef;
Uint32 senderData = req->senderData;
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
ReadConfigConf::SignalLength, JBB);
}
void void
SimulatedBlock::ignoreMutexUnlockCallback(Signal* signal, SimulatedBlock::ignoreMutexUnlockCallback(Signal* signal,
Uint32 ptrI, Uint32 retVal){ Uint32 ptrI, Uint32 retVal){

View file

@ -34,7 +34,6 @@
#include "LongSignal.hpp" #include "LongSignal.hpp"
#include <SignalLoggerManager.hpp> #include <SignalLoggerManager.hpp>
#include <Error.hpp>
#include <ErrorReporter.hpp> #include <ErrorReporter.hpp>
#include <ErrorHandlingMacros.hpp> #include <ErrorHandlingMacros.hpp>
@ -505,7 +504,6 @@ private:
void execUTIL_UNLOCK_REF(Signal* signal); void execUTIL_UNLOCK_REF(Signal* signal);
void execUTIL_UNLOCK_CONF(Signal* signal); void execUTIL_UNLOCK_CONF(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
protected: protected:
void execUPGRADE(Signal* signal); void execUPGRADE(Signal* signal);
@ -566,11 +564,11 @@ SimulatedBlock::executeFunction(GlobalSignalNumber gsn, Signal* signal){
char errorMsg[255]; char errorMsg[255];
if (!(gsn <= MAX_GSN)) { if (!(gsn <= MAX_GSN)) {
BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d too high)", gsn); BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d too high)", gsn);
ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); ERROR_SET(fatal, NDBD_EXIT_PRGERR, errorMsg, errorMsg);
} }
if (!(theExecArray[gsn] != 0)) { if (!(theExecArray[gsn] != 0)) {
BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d not added)", gsn); BaseString::snprintf(errorMsg, 255, "Illegal signal received (GSN %d not added)", gsn);
ERROR_SET(fatal, ERR_ERROR_PRGERR, errorMsg, errorMsg); ERROR_SET(fatal, NDBD_EXIT_PRGERR, errorMsg, errorMsg);
} }
ndbrequire(false); ndbrequire(false);
} }

View file

@ -19,7 +19,6 @@
#include <GlobalData.hpp> #include <GlobalData.hpp>
#include <FastScheduler.hpp> #include <FastScheduler.hpp>
#include <VMSignal.hpp> #include <VMSignal.hpp>
#include <Error.hpp>
static const int MAX_TIME_QUEUE_VALUE = 32000; static const int MAX_TIME_QUEUE_VALUE = 32000;
@ -70,7 +69,7 @@ TimeQueue::insert(Signal* signal, BlockNumber bnr,
if (regShortIndex == 0){ if (regShortIndex == 0){
theShortQueue[0].copy_struct = newEntry.copy_struct; theShortQueue[0].copy_struct = newEntry.copy_struct;
} else if (regShortIndex >= MAX_NO_OF_SHORT_TQ - 1) { } else if (regShortIndex >= MAX_NO_OF_SHORT_TQ - 1) {
ERROR_SET(ecError, ERROR_TIME_QUEUE_SHORT, ERROR_SET(ecError, NDBD_EXIT_TIME_QUEUE_SHORT,
"Too many in Short Time Queue", "TimeQueue.C" ); "Too many in Short Time Queue", "TimeQueue.C" );
} else { } else {
for (i = 0; i < regShortIndex; i++) { for (i = 0; i < regShortIndex; i++) {
@ -99,7 +98,7 @@ TimeQueue::insert(Signal* signal, BlockNumber bnr,
if (regLongIndex == 0) { if (regLongIndex == 0) {
theLongQueue[0].copy_struct = newEntry.copy_struct; theLongQueue[0].copy_struct = newEntry.copy_struct;
} else if (regLongIndex >= MAX_NO_OF_LONG_TQ - 1) { } else if (regLongIndex >= MAX_NO_OF_LONG_TQ - 1) {
ERROR_SET(ecError, ERROR_TIME_QUEUE_LONG, ERROR_SET(ecError, NDBD_EXIT_TIME_QUEUE_LONG,
"Too many in Long Time Queue", "TimeQueue.C" ); "Too many in Long Time Queue", "TimeQueue.C" );
} else { } else {
for (i = 0; i < regLongIndex; i++) { for (i = 0; i < regLongIndex; i++) {
@ -124,7 +123,7 @@ TimeQueue::insert(Signal* signal, BlockNumber bnr,
} }
globalData.theLongTQIndex = regLongIndex + 1; globalData.theLongTQIndex = regLongIndex + 1;
} else { } else {
ERROR_SET(ecError, ERROR_TIME_QUEUE_DELAY, ERROR_SET(ecError, NDBD_EXIT_TIME_QUEUE_DELAY,
"Too long delay for Time Queue", "TimeQueue.C" ); "Too long delay for Time Queue", "TimeQueue.C" );
} }
} }
@ -194,7 +193,7 @@ TimeQueue::getIndex()
Uint32 retValue = globalData.theFirstFreeTQIndex; Uint32 retValue = globalData.theFirstFreeTQIndex;
globalData.theFirstFreeTQIndex = (Uint32)theFreeIndex[retValue]; globalData.theFirstFreeTQIndex = (Uint32)theFreeIndex[retValue];
if (retValue >= MAX_NO_OF_TQ) if (retValue >= MAX_NO_OF_TQ)
ERROR_SET(fatal, ERROR_TIME_QUEUE_INDEX, ERROR_SET(fatal, NDBD_EXIT_TIME_QUEUE_INDEX,
"Index out of range", "TimeQueue.C" ); "Index out of range", "TimeQueue.C" );
return retValue; return retValue;
} }

View file

@ -314,18 +314,14 @@ reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){
#endif #endif
if(errorCode == TE_SIGNAL_LOST_SEND_BUFFER_FULL){ if(errorCode == TE_SIGNAL_LOST_SEND_BUFFER_FULL){
ErrorReporter::handleError(ecError, ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL,
ERR_PROGRAMERROR, "", __FILE__,
"Signal lost, send buffer full",
__FILE__,
NST_ErrorHandler); NST_ErrorHandler);
} }
if(errorCode == TE_SIGNAL_LOST){ if(errorCode == TE_SIGNAL_LOST){
ErrorReporter::handleError(ecError, ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST,
ERR_PROGRAMERROR, "", __FILE__,
"Signal lost (unknown reason)",
__FILE__,
NST_ErrorHandler); NST_ErrorHandler);
} }

View file

@ -95,39 +95,40 @@ WatchDog::run(){
globalData.incrementWatchDogCounter(0); globalData.incrementWatchDogCounter(0);
alerts = 0; alerts = 0;
} else { } else {
const char *last_stuck_action;
alerts++; alerts++;
ndbout << "Ndb kernel is stuck in: ";
switch (oldIPValue) { switch (oldIPValue) {
case 1: case 1:
ndbout << "Job Handling" << endl; last_stuck_action = "Job Handling";
break; break;
case 2: case 2:
ndbout << "Scanning Timers" << endl; last_stuck_action = "Scanning Timers";
break; break;
case 3: case 3:
ndbout << "External I/O" << endl; last_stuck_action = "External I/O";
break; break;
case 4: case 4:
ndbout << "Print Job Buffers at crash" << endl; last_stuck_action = "Print Job Buffers at crash";
break; break;
case 5: case 5:
ndbout << "Checking connections" << endl; last_stuck_action = "Checking connections";
break; break;
case 6: case 6:
ndbout << "Performing Send" << endl; last_stuck_action = "Performing Send";
break; break;
case 7: case 7:
ndbout << "Polling for Receive" << endl; last_stuck_action = "Polling for Receive";
break; break;
case 8: case 8:
ndbout << "Performing Receive" << endl; last_stuck_action = "Performing Receive";
break; break;
default: default:
ndbout << "Unknown place" << endl; last_stuck_action = "Unknown place";
break; break;
}//switch }//switch
ndbout << "Ndb kernel is stuck in: " << last_stuck_action << endl;
if(alerts == 3){ if(alerts == 3){
shutdownSystem(); shutdownSystem(last_stuck_action);
} }
} }
} }
@ -135,11 +136,10 @@ WatchDog::run(){
} }
void void
WatchDog::shutdownSystem(){ WatchDog::shutdownSystem(const char *last_stuck_action){
ErrorReporter::handleError(ecError, ErrorReporter::handleError(NDBD_EXIT_WATCHDOG_TERMINATE,
ERR_PROGRAMERROR, last_stuck_action,
"WatchDog terminate",
__FILE__, __FILE__,
NST_Watchdog); NST_Watchdog);
} }

View file

@ -50,7 +50,7 @@ private:
bool theStop; bool theStop;
void run(); void run();
void shutdownSystem(); void shutdownSystem(const char *last_stuck_action);
}; };
#endif // WatchDog_H #endif // WatchDog_H

Some files were not shown because too many files have changed in this diff Show more