Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f4721210
Commit
f4721210
authored
Sep 20, 2004
by
mysql@mc04.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Hand merge
parents
12fadb8c
5d19f4eb
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
672 additions
and
534 deletions
+672
-534
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+3
-0
acinclude.m4
acinclude.m4
+32
-18
configure.in
configure.in
+2
-2
ndb/config/type_ndbapitest.mk.am
ndb/config/type_ndbapitest.mk.am
+1
-1
ndb/config/type_ndbapitools.mk.am
ndb/config/type_ndbapitools.mk.am
+1
-1
ndb/include/mgmapi/mgmapi_config_parameters.h
ndb/include/mgmapi/mgmapi_config_parameters.h
+8
-10
ndb/include/transporter/TransporterDefinitions.hpp
ndb/include/transporter/TransporterDefinitions.hpp
+3
-9
ndb/src/common/mgmcommon/IPCConfig.cpp
ndb/src/common/mgmcommon/IPCConfig.cpp
+42
-39
ndb/src/common/transporter/Makefile.am
ndb/src/common/transporter/Makefile.am
+1
-1
ndb/src/common/transporter/Packer.cpp
ndb/src/common/transporter/Packer.cpp
+14
-7
ndb/src/common/transporter/SCI_Transporter.cpp
ndb/src/common/transporter/SCI_Transporter.cpp
+379
-354
ndb/src/common/transporter/SCI_Transporter.hpp
ndb/src/common/transporter/SCI_Transporter.hpp
+16
-13
ndb/src/common/transporter/SHM_Buffer.hpp
ndb/src/common/transporter/SHM_Buffer.hpp
+10
-10
ndb/src/common/transporter/SHM_Transporter.cpp
ndb/src/common/transporter/SHM_Transporter.cpp
+34
-18
ndb/src/common/transporter/SHM_Transporter.hpp
ndb/src/common/transporter/SHM_Transporter.hpp
+1
-1
ndb/src/common/transporter/TCP_Transporter.cpp
ndb/src/common/transporter/TCP_Transporter.cpp
+8
-5
ndb/src/common/transporter/TCP_Transporter.hpp
ndb/src/common/transporter/TCP_Transporter.hpp
+1
-2
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+33
-23
ndb/src/cw/cpcd/Makefile.am
ndb/src/cw/cpcd/Makefile.am
+1
-1
ndb/src/kernel/Makefile.am
ndb/src/kernel/Makefile.am
+1
-1
ndb/src/kernel/blocks/backup/restore/Makefile.am
ndb/src/kernel/blocks/backup/restore/Makefile.am
+1
-1
ndb/src/kernel/vm/FastScheduler.hpp
ndb/src/kernel/vm/FastScheduler.hpp
+1
-1
ndb/src/mgmclient/Makefile.am
ndb/src/mgmclient/Makefile.am
+1
-1
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+75
-12
ndb/src/mgmsrv/Makefile.am
ndb/src/mgmsrv/Makefile.am
+1
-1
ndb/test/run-test/Makefile.am
ndb/test/run-test/Makefile.am
+1
-1
sql/Makefile.am
sql/Makefile.am
+1
-1
No files found.
BitKeeper/etc/logging_ok
View file @
f4721210
...
@@ -100,6 +100,7 @@ miguel@hegel.txg.br
...
@@ -100,6 +100,7 @@ miguel@hegel.txg.br
miguel@light.
miguel@light.
miguel@light.local
miguel@light.local
miguel@sartre.local
miguel@sartre.local
mikael@mc04.(none)
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@mikael-ronstr-ms-dator.local
mikron@mikael-ronstr-ms-dator.local
mmatthew@markslaptop.
mmatthew@markslaptop.
...
@@ -129,6 +130,7 @@ mwagner@here.mwagner.org
...
@@ -129,6 +130,7 @@ mwagner@here.mwagner.org
mwagner@work.mysql.com
mwagner@work.mysql.com
mydev@mysql.com
mydev@mysql.com
mysql@home.(none)
mysql@home.(none)
mysql@mc04.(none)
mysqldev@build.mysql2.com
mysqldev@build.mysql2.com
mysqldev@melody.local
mysqldev@melody.local
mysqldev@mysql.com
mysqldev@mysql.com
...
@@ -158,6 +160,7 @@ ram@ram.(none)
...
@@ -158,6 +160,7 @@ ram@ram.(none)
ranger@regul.home.lan
ranger@regul.home.lan
rburnett@build.mysql.com
rburnett@build.mysql.com
root@home.(none)
root@home.(none)
root@mc04.(none)
root@x3.internalnet
root@x3.internalnet
salle@banica.(none)
salle@banica.(none)
salle@geopard.(none)
salle@geopard.(none)
...
...
acinclude.m4
View file @
f4721210
...
@@ -1548,16 +1548,43 @@ dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used
...
@@ -1548,16 +1548,43 @@ dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
AC_ARG_WITH([ndb-sci],
AC_HELP_STRING([--with-ndb-sci=DIR],
[Provide MySQL with a custom location of
sci library. Given DIR, sci library is
assumed to be in $DIR/lib and header files
in $DIR/include.]),
[mysql_sci_dir=${withval}],
[mysql_sci_dir=""])
case "$mysql_sci_dir" in
"no" )
have_ndb_sci=no
AC_MSG_RESULT([-- not including sci transporter])
;;
* )
if test -f "$mysql_sci_dir/lib/libsisci.a" -a \
-f "$mysql_sci_dir/include/sisci_api.h"; then
NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
NDB_SCI_LIBS="-L$mysql_sci_dir/lib -lsisci"
AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter])
AC_SUBST(NDB_SCI_INCLUDES)
AC_SUBST(NDB_SCI_LIBS)
have_ndb_sci="yes"
AC_MSG_RESULT([found sci transporter in $mysql_sci_dir/{include, lib}])
else
AC_MSG_RESULT([could not find sci transporter in $mysql_sci_dir/{include, lib}])
fi
;;
esac
AC_ARG_WITH([ndb-shm],
AC_ARG_WITH([ndb-shm],
[
[
--with-ndb-shm Include the NDB Cluster shared memory transporter],
--with-ndb-shm Include the NDB Cluster shared memory transporter],
[ndb_shm="$withval"],
[ndb_shm="$withval"],
[ndb_shm=no])
[ndb_shm=no])
AC_ARG_WITH([ndb-sci],
[
--with-ndb-sci Include the NDB Cluster sci transporter],
[ndb_sci="$withval"],
[ndb_sci=no])
AC_ARG_WITH([ndb-test],
AC_ARG_WITH([ndb-test],
[
[
--with-ndb-test Include the NDB Cluster ndbapi test programs],
--with-ndb-test Include the NDB Cluster ndbapi test programs],
...
@@ -1590,19 +1617,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
...
@@ -1590,19 +1617,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
;;
;;
esac
esac
have_ndb_sci=no
case "$ndb_sci" in
yes )
AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter])
have_ndb_sci="yes"
;;
* )
AC_MSG_RESULT([-- not including sci transporter])
;;
esac
have_ndb_test=no
have_ndb_test=no
case "$ndb_test" in
case "$ndb_test" in
yes )
yes )
...
...
configure.in
View file @
f4721210
...
@@ -3024,11 +3024,11 @@ AC_SUBST([ndb_port_base])
...
@@ -3024,11 +3024,11 @@ AC_SUBST([ndb_port_base])
ndb_transporter_opt_objs
=
""
ndb_transporter_opt_objs
=
""
if
test
X
"
$have_ndb_shm
"
=
Xyes
if
test
X
"
$have_ndb_shm
"
=
Xyes
then
then
ndb_transporter_opt_objs
=
"
$
(
ndb_transporter_opt_objs
)
SHM_Transporter.lo SHM_Transporter.unix.lo"
ndb_transporter_opt_objs
=
"
$
ndb_transporter_opt_objs
SHM_Transporter.lo SHM_Transporter.unix.lo"
fi
fi
if
test
X
"
$have_ndb_sci
"
=
Xyes
if
test
X
"
$have_ndb_sci
"
=
Xyes
then
then
ndb_transporter_opt_objs
=
"
$
(
ndb_transporter_opt_objs
)
SCI_Transporter.lo"
ndb_transporter_opt_objs
=
"
$
ndb_transporter_opt_objs
SCI_Transporter.lo"
fi
fi
AC_SUBST
([
ndb_transporter_opt_objs]
)
AC_SUBST
([
ndb_transporter_opt_objs]
)
...
...
ndb/config/type_ndbapitest.mk.am
View file @
f4721210
...
@@ -3,7 +3,7 @@ LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \
...
@@ -3,7 +3,7 @@ LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
$(top_builddir)/strings/libmystrings.a
@NDB_SCI_LIBS@
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/ndb/include \
-I$(top_srcdir)/ndb/include \
...
...
ndb/config/type_ndbapitools.mk.am
View file @
f4721210
...
@@ -3,7 +3,7 @@ LDADD += \
...
@@ -3,7 +3,7 @@ LDADD += \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
$(top_builddir)/strings/libmystrings.a
@NDB_SCI_LIBS@
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
-I$(top_srcdir)/ndb/include \
-I$(top_srcdir)/ndb/include \
...
...
ndb/include/mgmapi/mgmapi_config_parameters.h
View file @
f4721210
...
@@ -121,16 +121,14 @@
...
@@ -121,16 +121,14 @@
#define CFG_SHM_KEY 502
#define CFG_SHM_KEY 502
#define CFG_SHM_BUFFER_MEM 503
#define CFG_SHM_BUFFER_MEM 503
#define CFG_SCI_ID_0 550
#define CFG_SCI_HOST1_ID_0 550
#define CFG_SCI_ID_1 551
#define CFG_SCI_HOST1_ID_1 551
#define CFG_SCI_SEND_LIMIT 552
#define CFG_SCI_HOST2_ID_0 552
#define CFG_SCI_BUFFER_MEM 553
#define CFG_SCI_HOST2_ID_1 553
#define CFG_SCI_NODE1_ADAPTERS 554
#define CFG_SCI_HOSTNAME_1 554
#define CFG_SCI_NODE1_ADAPTER0 555
#define CFG_SCI_HOSTNAME_2 555
#define CFG_SCI_NODE1_ADAPTER1 556
#define CFG_SCI_SEND_LIMIT 556
#define CFG_SCI_NODE2_ADAPTERS 554
#define CFG_SCI_BUFFER_MEM 557
#define CFG_SCI_NODE2_ADAPTER0 555
#define CFG_SCI_NODE2_ADAPTER1 556
#define CFG_OSE_PRIO_A_SIZE 602
#define CFG_OSE_PRIO_A_SIZE 602
#define CFG_OSE_PRIO_B_SIZE 603
#define CFG_OSE_PRIO_B_SIZE 603
...
...
ndb/include/transporter/TransporterDefinitions.hpp
View file @
f4721210
...
@@ -59,8 +59,6 @@ struct TCP_TransporterConfiguration {
...
@@ -59,8 +59,6 @@ struct TCP_TransporterConfiguration {
NodeId
localNodeId
;
NodeId
localNodeId
;
Uint32
sendBufferSize
;
// Size of SendBuffer of priority B
Uint32
sendBufferSize
;
// Size of SendBuffer of priority B
Uint32
maxReceiveSize
;
// Maximum no of bytes to receive
Uint32
maxReceiveSize
;
// Maximum no of bytes to receive
Uint32
byteOrder
;
bool
compression
;
bool
checksum
;
bool
checksum
;
bool
signalId
;
bool
signalId
;
};
};
...
@@ -72,10 +70,8 @@ struct SHM_TransporterConfiguration {
...
@@ -72,10 +70,8 @@ struct SHM_TransporterConfiguration {
Uint32
port
;
Uint32
port
;
NodeId
remoteNodeId
;
NodeId
remoteNodeId
;
NodeId
localNodeId
;
NodeId
localNodeId
;
bool
compression
;
bool
checksum
;
bool
checksum
;
bool
signalId
;
bool
signalId
;
int
byteOrder
;
Uint32
shmKey
;
Uint32
shmKey
;
Uint32
shmSize
;
Uint32
shmSize
;
...
@@ -89,10 +85,8 @@ struct OSE_TransporterConfiguration {
...
@@ -89,10 +85,8 @@ struct OSE_TransporterConfiguration {
const
char
*
localHostName
;
const
char
*
localHostName
;
NodeId
remoteNodeId
;
NodeId
remoteNodeId
;
NodeId
localNodeId
;
NodeId
localNodeId
;
bool
compression
;
bool
checksum
;
bool
checksum
;
bool
signalId
;
bool
signalId
;
int
byteOrder
;
Uint32
prioASignalSize
;
Uint32
prioASignalSize
;
Uint32
prioBSignalSize
;
Uint32
prioBSignalSize
;
...
@@ -103,20 +97,20 @@ struct OSE_TransporterConfiguration {
...
@@ -103,20 +97,20 @@ struct OSE_TransporterConfiguration {
* SCI Transporter Configuration
* SCI Transporter Configuration
*/
*/
struct
SCI_TransporterConfiguration
{
struct
SCI_TransporterConfiguration
{
const
char
*
remoteHostName
;
const
char
*
localHostName
;
Uint32
port
;
Uint32
sendLimit
;
// Packet size
Uint32
sendLimit
;
// Packet size
Uint32
bufferSize
;
// Buffer size
Uint32
bufferSize
;
// Buffer size
Uint32
nLocalAdapters
;
// 1 or 2, the number of adapters on local host
Uint32
nLocalAdapters
;
// 1 or 2, the number of adapters on local host
Uint32
nRemoteAdapters
;
Uint32
remoteSciNodeId0
;
// SCInodeId for adapter 1
Uint32
remoteSciNodeId0
;
// SCInodeId for adapter 1
Uint32
remoteSciNodeId1
;
// SCInodeId for adapter 2
Uint32
remoteSciNodeId1
;
// SCInodeId for adapter 2
NodeId
localNodeId
;
// Local node Id
NodeId
localNodeId
;
// Local node Id
NodeId
remoteNodeId
;
// Remote node Id
NodeId
remoteNodeId
;
// Remote node Id
Uint32
byteOrder
;
bool
compression
;
bool
checksum
;
bool
checksum
;
bool
signalId
;
bool
signalId
;
...
...
ndb/src/common/mgmcommon/IPCConfig.cpp
View file @
f4721210
...
@@ -133,7 +133,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -133,7 +133,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
Uint32
compression
;
Uint32
compression
;
Uint32
checksum
;
Uint32
checksum
;
if
(
!
tmp
->
get
(
"SendSignalId"
,
&
sendSignalId
))
continue
;
if
(
!
tmp
->
get
(
"SendSignalId"
,
&
sendSignalId
))
continue
;
if
(
!
tmp
->
get
(
"Compression"
,
&
compression
))
continue
;
if
(
!
tmp
->
get
(
"Checksum"
,
&
checksum
))
continue
;
if
(
!
tmp
->
get
(
"Checksum"
,
&
checksum
))
continue
;
const
char
*
type
;
const
char
*
type
;
...
@@ -143,8 +142,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -143,8 +142,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
SHM_TransporterConfiguration
conf
;
SHM_TransporterConfiguration
conf
;
conf
.
localNodeId
=
the_ownId
;
conf
.
localNodeId
=
the_ownId
;
conf
.
remoteNodeId
=
(
nodeId1
!=
the_ownId
?
nodeId1
:
nodeId2
);
conf
.
remoteNodeId
=
(
nodeId1
!=
the_ownId
?
nodeId1
:
nodeId2
);
conf
.
byteOrder
=
0
;
conf
.
compression
=
compression
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -164,8 +161,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -164,8 +161,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
SCI_TransporterConfiguration
conf
;
SCI_TransporterConfiguration
conf
;
conf
.
localNodeId
=
the_ownId
;
conf
.
localNodeId
=
the_ownId
;
conf
.
remoteNodeId
=
(
nodeId1
!=
the_ownId
?
nodeId1
:
nodeId2
);
conf
.
remoteNodeId
=
(
nodeId1
!=
the_ownId
?
nodeId1
:
nodeId2
);
conf
.
byteOrder
=
0
;
conf
.
compression
=
compression
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -174,18 +169,16 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -174,18 +169,16 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
if
(
the_ownId
==
nodeId1
){
if
(
the_ownId
==
nodeId1
){
if
(
!
tmp
->
get
(
"Node1_NoOfAdapters"
,
&
conf
.
nLocalAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node1_NoOfAdapters"
,
&
conf
.
nLocalAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node2_NoOfAdapters"
,
&
conf
.
nRemoteAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node2_Adapter"
,
0
,
&
conf
.
remoteSciNodeId0
))
continue
;
if
(
!
tmp
->
get
(
"Node2_Adapter"
,
0
,
&
conf
.
remoteSciNodeId0
))
continue
;
if
(
conf
.
n
Remote
Adapters
>
1
){
if
(
conf
.
n
Local
Adapters
>
1
){
if
(
!
tmp
->
get
(
"Node2_Adapter"
,
1
,
&
conf
.
remoteSciNodeId1
))
continue
;
if
(
!
tmp
->
get
(
"Node2_Adapter"
,
1
,
&
conf
.
remoteSciNodeId1
))
continue
;
}
}
}
else
{
}
else
{
if
(
!
tmp
->
get
(
"Node2_NoOfAdapters"
,
&
conf
.
nLocalAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node2_NoOfAdapters"
,
&
conf
.
nLocalAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node1_NoOfAdapters"
,
&
conf
.
nRemoteAdapters
))
continue
;
if
(
!
tmp
->
get
(
"Node1_Adapter"
,
0
,
&
conf
.
remoteSciNodeId0
))
continue
;
if
(
!
tmp
->
get
(
"Node1_Adapter"
,
0
,
&
conf
.
remoteSciNodeId0
))
continue
;
if
(
conf
.
n
Remote
Adapters
>
1
){
if
(
conf
.
n
Local
Adapters
>
1
){
if
(
!
tmp
->
get
(
"Node1_Adapter"
,
1
,
&
conf
.
remoteSciNodeId1
))
continue
;
if
(
!
tmp
->
get
(
"Node1_Adapter"
,
1
,
&
conf
.
remoteSciNodeId1
))
continue
;
}
}
}
}
...
@@ -243,8 +236,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -243,8 +236,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
conf
.
localHostName
=
ownHostName
;
conf
.
localHostName
=
ownHostName
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
localNodeId
=
ownNodeId
;
conf
.
localNodeId
=
ownNodeId
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
compression
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -270,8 +261,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
...
@@ -270,8 +261,6 @@ IPCConfig::configureTransporters(TransporterRegistry * theTransporterRegistry){
conf
.
localHostName
=
ownHostName
;
conf
.
localHostName
=
ownHostName
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
localNodeId
=
ownNodeId
;
conf
.
localNodeId
=
ownNodeId
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
compression
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -344,6 +333,7 @@ Uint32
...
@@ -344,6 +333,7 @@ Uint32
IPCConfig
::
configureTransporters
(
Uint32
nodeId
,
IPCConfig
::
configureTransporters
(
Uint32
nodeId
,
const
class
ndb_mgm_configuration
&
config
,
const
class
ndb_mgm_configuration
&
config
,
class
TransporterRegistry
&
tr
){
class
TransporterRegistry
&
tr
){
DBUG_ENTER
(
"IPCConfig::configureTransporters"
);
Uint32
noOfTransportersCreated
=
0
;
Uint32
noOfTransportersCreated
=
0
;
ndb_mgm_configuration_iterator
iter
(
config
,
CFG_SECTION_CONNECTION
);
ndb_mgm_configuration_iterator
iter
(
config
,
CFG_SECTION_CONNECTION
);
...
@@ -379,14 +369,13 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -379,14 +369,13 @@ IPCConfig::configureTransporters(Uint32 nodeId,
if
(
nodeId
<=
nodeId1
&&
nodeId
<=
nodeId2
)
{
if
(
nodeId
<=
nodeId1
&&
nodeId
<=
nodeId2
)
{
tr
.
add_transporter_interface
(
localHostName
,
server_port
);
tr
.
add_transporter_interface
(
localHostName
,
server_port
);
}
}
DBUG_PRINT
(
"info"
,
(
"Transporter between this node %d and node %d using port %d, signalId %d, checksum %d"
,
nodeId
,
remoteNodeId
,
tmp_server_port
,
sendSignalId
,
checksum
));
switch
(
type
){
switch
(
type
){
case
CONNECTION_TYPE_SHM
:{
case
CONNECTION_TYPE_SHM
:{
SHM_TransporterConfiguration
conf
;
SHM_TransporterConfiguration
conf
;
conf
.
localNodeId
=
nodeId
;
conf
.
localNodeId
=
nodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
0
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -396,45 +385,60 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -396,45 +385,60 @@ IPCConfig::configureTransporters(Uint32 nodeId,
conf
.
port
=
server_port
;
conf
.
port
=
server_port
;
if
(
!
tr
.
createTransporter
(
&
conf
)){
if
(
!
tr
.
createTransporter
(
&
conf
)){
DBUG_PRINT
(
"error"
,
(
"Failed to create SCI Transporter from %d to %d"
,
conf
.
localNodeId
,
conf
.
remoteNodeId
));
ndbout
<<
"Failed to create SHM Transporter from: "
ndbout
<<
"Failed to create SHM Transporter from: "
<<
conf
.
localNodeId
<<
" to: "
<<
conf
.
remoteNodeId
<<
endl
;
<<
conf
.
localNodeId
<<
" to: "
<<
conf
.
remoteNodeId
<<
endl
;
}
else
{
}
else
{
noOfTransportersCreated
++
;
noOfTransportersCreated
++
;
}
}
DBUG_PRINT
(
"info"
,
(
"Created SHM Transporter using shmkey %d, buf size = %d"
,
conf
.
shmKey
,
conf
.
shmSize
));
break
;
break
;
}
}
case
CONNECTION_TYPE_SCI
:{
case
CONNECTION_TYPE_SCI
:{
SCI_TransporterConfiguration
conf
;
SCI_TransporterConfiguration
conf
;
const
char
*
host1
,
*
host2
;
conf
.
localNodeId
=
nodeId
;
conf
.
localNodeId
=
nodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
0
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
conf
.
port
=
tmp_server_port
;
if
(
iter
.
get
(
CFG_SCI_HOSTNAME_1
,
&
host1
))
break
;
if
(
iter
.
get
(
CFG_SCI_HOSTNAME_2
,
&
host2
))
break
;
conf
.
localHostName
=
(
nodeId
==
nodeId1
?
host1
:
host2
);
conf
.
remoteHostName
=
(
nodeId
==
nodeId1
?
host2
:
host1
);
if
(
iter
.
get
(
CFG_SCI_SEND_LIMIT
,
&
conf
.
sendLimit
))
break
;
if
(
iter
.
get
(
CFG_SCI_SEND_LIMIT
,
&
conf
.
sendLimit
))
break
;
if
(
iter
.
get
(
CFG_SCI_BUFFER_MEM
,
&
conf
.
bufferSize
))
break
;
if
(
iter
.
get
(
CFG_SCI_BUFFER_MEM
,
&
conf
.
bufferSize
))
break
;
if
(
nodeId
==
nodeId1
)
{
if
(
nodeId
==
nodeId1
){
if
(
iter
.
get
(
CFG_SCI_HOST2_ID_0
,
&
conf
.
remoteSciNodeId0
))
break
;
if
(
iter
.
get
(
CFG_SCI_NODE1_ADAPTERS
,
&
conf
.
nLocalAdapters
))
break
;
if
(
iter
.
get
(
CFG_SCI_HOST2_ID_1
,
&
conf
.
remoteSciNodeId1
))
break
;
if
(
iter
.
get
(
CFG_SCI_NODE2_ADAPTERS
,
&
conf
.
nRemoteAdapters
))
break
;
if
(
iter
.
get
(
CFG_SCI_NODE2_ADAPTER0
,
&
conf
.
remoteSciNodeId0
))
break
;
if
(
conf
.
nRemoteAdapters
>
1
){
if
(
iter
.
get
(
CFG_SCI_NODE2_ADAPTER1
,
&
conf
.
remoteSciNodeId1
))
break
;
}
}
else
{
}
else
{
if
(
iter
.
get
(
CFG_SCI_NODE2_ADAPTERS
,
&
conf
.
nLocalAdapters
))
break
;
if
(
iter
.
get
(
CFG_SCI_HOST1_ID_0
,
&
conf
.
remoteSciNodeId0
))
break
;
if
(
iter
.
get
(
CFG_SCI_NODE1_ADAPTERS
,
&
conf
.
nRemoteAdapters
))
break
;
if
(
iter
.
get
(
CFG_SCI_HOST1_ID_1
,
&
conf
.
remoteSciNodeId1
))
break
;
if
(
iter
.
get
(
CFG_SCI_NODE1_ADAPTER0
,
&
conf
.
remoteSciNodeId0
))
break
;
if
(
conf
.
nRemoteAdapters
>
1
){
if
(
iter
.
get
(
CFG_SCI_NODE1_ADAPTER1
,
&
conf
.
remoteSciNodeId1
))
break
;
}
}
if
(
conf
.
remoteSciNodeId1
==
0
)
{
conf
.
nLocalAdapters
=
1
;
}
else
{
conf
.
nLocalAdapters
=
2
;
}
}
if
(
!
tr
.
createTransporter
(
&
conf
)){
if
(
!
tr
.
createTransporter
(
&
conf
)){
DBUG_PRINT
(
"error"
,
(
"Failed to create SCI Transporter from %d to %d"
,
conf
.
localNodeId
,
conf
.
remoteNodeId
));
ndbout
<<
"Failed to create SCI Transporter from: "
ndbout
<<
"Failed to create SCI Transporter from: "
<<
conf
.
localNodeId
<<
" to: "
<<
conf
.
remoteNodeId
<<
endl
;
<<
conf
.
localNodeId
<<
" to: "
<<
conf
.
remoteNodeId
<<
endl
;
}
else
{
}
else
{
DBUG_PRINT
(
"info"
,
(
"Created SCI Transporter: Adapters = %d, remote SCI node id %d"
,
conf
.
nLocalAdapters
,
conf
.
remoteSciNodeId0
));
DBUG_PRINT
(
"info"
,
(
"Host 1 = %s, Host 2 = %s, sendLimit = %d, buf size = %d"
,
conf
.
localHostName
,
conf
.
remoteHostName
,
conf
.
sendLimit
,
conf
.
bufferSize
));
if
(
conf
.
nLocalAdapters
>
1
)
{
DBUG_PRINT
(
"info"
,
(
"Fault-tolerant with 2 Remote Adapters, second remote SCI node id = %d"
,
conf
.
remoteSciNodeId1
));
}
noOfTransportersCreated
++
;
noOfTransportersCreated
++
;
continue
;
continue
;
}
}
...
@@ -458,8 +462,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -458,8 +462,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
localHostName
=
localHostName
;
conf
.
localHostName
=
localHostName
;
conf
.
remoteHostName
=
remoteHostName
;
conf
.
remoteHostName
=
remoteHostName
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
0
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -469,6 +471,9 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -469,6 +471,9 @@ IPCConfig::configureTransporters(Uint32 nodeId,
}
else
{
}
else
{
noOfTransportersCreated
++
;
noOfTransportersCreated
++
;
}
}
DBUG_PRINT
(
"info"
,
(
"Created TCP Transporter: sendBufferSize = %d, maxReceiveSize = %d"
,
conf
.
sendBufferSize
,
conf
.
maxReceiveSize
));
break
;
case
CONNECTION_TYPE_OSE
:{
case
CONNECTION_TYPE_OSE
:{
OSE_TransporterConfiguration
conf
;
OSE_TransporterConfiguration
conf
;
...
@@ -480,8 +485,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -480,8 +485,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
remoteNodeId
=
remoteNodeId
;
conf
.
localHostName
=
localHostName
;
conf
.
localHostName
=
localHostName
;
conf
.
remoteHostName
=
remoteHostName
;
conf
.
remoteHostName
=
remoteHostName
;
conf
.
byteOrder
=
0
;
conf
.
compression
=
0
;
conf
.
checksum
=
checksum
;
conf
.
checksum
=
checksum
;
conf
.
signalId
=
sendSignalId
;
conf
.
signalId
=
sendSignalId
;
...
@@ -499,6 +502,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -499,6 +502,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
}
}
}
}
}
}
return
noOfTransportersCreated
;
DBUG_RETURN
(
noOfTransportersCreated
)
;
}
}
ndb/src/common/transporter/Makefile.am
View file @
f4721210
...
@@ -13,7 +13,7 @@ EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp S
...
@@ -13,7 +13,7 @@ EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp S
libtransporter_la_LIBADD
=
@ndb_transporter_opt_objs@
libtransporter_la_LIBADD
=
@ndb_transporter_opt_objs@
libtransporter_la_DEPENDENCIES
=
@ndb_transporter_opt_objs@
libtransporter_la_DEPENDENCIES
=
@ndb_transporter_opt_objs@
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/include/kernel
-I
$(top_srcdir)
/ndb/include/transporter
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/include/kernel
-I
$(top_srcdir)
/ndb/include/transporter
@NDB_SCI_INCLUDES@
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_util.mk.am
include
$(top_srcdir)/ndb/config/type_util.mk.am
...
...
ndb/src/common/transporter/Packer.cpp
View file @
f4721210
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <TransporterCallback.hpp>
#include <TransporterCallback.hpp>
#include <RefConvert.hpp>
#include <RefConvert.hpp>
#define MAX_RECEIVED_SIGNALS 1024
Uint32
Uint32
TransporterRegistry
::
unpack
(
Uint32
*
readPtr
,
TransporterRegistry
::
unpack
(
Uint32
*
readPtr
,
Uint32
sizeOfData
,
Uint32
sizeOfData
,
...
@@ -30,12 +31,15 @@ TransporterRegistry::unpack(Uint32 * readPtr,
...
@@ -30,12 +31,15 @@ TransporterRegistry::unpack(Uint32 * readPtr,
LinearSectionPtr
ptr
[
3
];
LinearSectionPtr
ptr
[
3
];
Uint32
usedData
=
0
;
Uint32
usedData
=
0
;
Uint32
loop_count
=
0
;
if
(
state
==
NoHalt
||
state
==
HaltOutput
){
if
(
state
==
NoHalt
||
state
==
HaltOutput
){
while
(
sizeOfData
>=
4
+
sizeof
(
Protocol6
)){
while
((
sizeOfData
>=
4
+
sizeof
(
Protocol6
))
&&
(
loop_count
<
MAX_RECEIVED_SIGNALS
))
{
Uint32
word1
=
readPtr
[
0
];
Uint32
word1
=
readPtr
[
0
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word3
=
readPtr
[
2
];
Uint32
word3
=
readPtr
[
2
];
loop_count
++
;
#if 0
#if 0
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
...
@@ -112,10 +116,12 @@ TransporterRegistry::unpack(Uint32 * readPtr,
...
@@ -112,10 +116,12 @@ TransporterRegistry::unpack(Uint32 * readPtr,
}
else
{
}
else
{
/** state = HaltIO || state == HaltInput */
/** state = HaltIO || state == HaltInput */
while
(
sizeOfData
>=
4
+
sizeof
(
Protocol6
)){
while
((
sizeOfData
>=
4
+
sizeof
(
Protocol6
))
&&
(
loop_count
<
MAX_RECEIVED_SIGNALS
))
{
Uint32
word1
=
readPtr
[
0
];
Uint32
word1
=
readPtr
[
0
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word3
=
readPtr
[
2
];
Uint32
word3
=
readPtr
[
2
];
loop_count
++
;
#if 0
#if 0
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
...
@@ -208,12 +214,13 @@ TransporterRegistry::unpack(Uint32 * readPtr,
...
@@ -208,12 +214,13 @@ TransporterRegistry::unpack(Uint32 * readPtr,
IOState
state
)
{
IOState
state
)
{
static
SignalHeader
signalHeader
;
static
SignalHeader
signalHeader
;
static
LinearSectionPtr
ptr
[
3
];
static
LinearSectionPtr
ptr
[
3
];
Uint32
loop_count
=
0
;
if
(
state
==
NoHalt
||
state
==
HaltOutput
){
if
(
state
==
NoHalt
||
state
==
HaltOutput
){
while
(
readPtr
<
eodPtr
)
{
while
((
readPtr
<
eodPtr
)
&&
(
loop_count
<
MAX_RECEIVED_SIGNALS
))
{
Uint32
word1
=
readPtr
[
0
];
Uint32
word1
=
readPtr
[
0
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word3
=
readPtr
[
2
];
Uint32
word3
=
readPtr
[
2
];
loop_count
++
;
#if 0
#if 0
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
//Do funky stuff
//Do funky stuff
...
@@ -280,11 +287,11 @@ TransporterRegistry::unpack(Uint32 * readPtr,
...
@@ -280,11 +287,11 @@ TransporterRegistry::unpack(Uint32 * readPtr,
}
else
{
}
else
{
/** state = HaltIO || state == HaltInput */
/** state = HaltIO || state == HaltInput */
while
(
readPtr
<
eodPtr
)
{
while
((
readPtr
<
eodPtr
)
&&
(
loop_count
<
MAX_RECEIVED_SIGNALS
))
{
Uint32
word1
=
readPtr
[
0
];
Uint32
word1
=
readPtr
[
0
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word2
=
readPtr
[
1
];
Uint32
word3
=
readPtr
[
2
];
Uint32
word3
=
readPtr
[
2
];
loop_count
++
;
#if 0
#if 0
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
if(Protocol6::getByteOrder(word1) != MY_OWN_BYTE_ORDER){
//Do funky stuff
//Do funky stuff
...
...
ndb/src/common/transporter/SCI_Transporter.cpp
View file @
f4721210
...
@@ -25,22 +25,29 @@
...
@@ -25,22 +25,29 @@
#include "TransporterInternalDefinitions.hpp"
#include "TransporterInternalDefinitions.hpp"
#include <TransporterCallback.hpp>
#include <TransporterCallback.hpp>
#define FLAGS 0
#include <InputStream.hpp>
#include <OutputStream.hpp>
SCI_Transporter
::
SCI_Transporter
(
Uint32
packetSize
,
#define FLAGS 0
#define DEBUG_TRANSPORTER
SCI_Transporter
::
SCI_Transporter
(
TransporterRegistry
&
t_reg
,
const
char
*
lHostName
,
const
char
*
rHostName
,
int
r_port
,
Uint32
packetSize
,
Uint32
bufferSize
,
Uint32
bufferSize
,
Uint32
nAdapters
,
Uint32
nAdapters
,
Uint16
remoteSciNodeId0
,
Uint16
remoteSciNodeId0
,
Uint16
remoteSciNodeId1
,
Uint16
remoteSciNodeId1
,
NodeId
_localNodeId
,
NodeId
_localNodeId
,
NodeId
_remoteNodeId
,
NodeId
_remoteNodeId
,
int
byte_order
,
bool
compr
,
bool
chksm
,
bool
chksm
,
bool
signalId
,
bool
signalId
,
Uint32
reportFreq
)
:
Uint32
reportFreq
)
:
Transporter
(
_localNodeId
,
_remoteNodeId
,
byte_order
,
compr
,
chksm
,
signalId
)
Transporter
(
t_reg
,
lHostName
,
rHostName
,
r_port
,
_localNodeId
,
_remoteNodeId
,
0
,
false
,
chksm
,
signalId
)
{
{
DBUG_ENTER
(
"SCI_Transporter::SCI_Transporter"
);
m_PacketSize
=
(
packetSize
+
3
)
/
4
;
m_PacketSize
=
(
packetSize
+
3
)
/
4
;
m_BufferSize
=
bufferSize
;
m_BufferSize
=
bufferSize
;
m_sendBuffer
.
m_buffer
=
NULL
;
m_sendBuffer
.
m_buffer
=
NULL
;
...
@@ -56,10 +63,6 @@ SCI_Transporter::SCI_Transporter(Uint32 packetSize,
...
@@ -56,10 +63,6 @@ SCI_Transporter::SCI_Transporter(Uint32 packetSize,
m_initLocal
=
false
;
m_initLocal
=
false
;
m_remoteNodes
=
new
Uint16
[
m_numberOfRemoteNodes
];
if
(
m_remoteNodes
==
NULL
)
{
//DO WHAT??
}
m_swapCounter
=
0
;
m_swapCounter
=
0
;
m_failCounter
=
0
;
m_failCounter
=
0
;
m_remoteNodes
[
0
]
=
remoteSciNodeId0
;
m_remoteNodes
[
0
]
=
remoteSciNodeId0
;
...
@@ -94,20 +97,19 @@ SCI_Transporter::SCI_Transporter(Uint32 packetSize,
...
@@ -94,20 +97,19 @@ SCI_Transporter::SCI_Transporter(Uint32 packetSize,
i4096
=
0
;
i4096
=
0
;
i4097
=
0
;
i4097
=
0
;
#endif
#endif
DBUG_VOID_RETURN
;
}
}
void
SCI_Transporter
::
disconnectImpl
()
void
SCI_Transporter
::
disconnectImpl
()
{
{
DBUG_ENTER
(
"SCI_Transporter::disconnectImpl"
);
sci_error_t
err
;
sci_error_t
err
;
if
(
m_mapped
){
if
(
m_mapped
){
setDisconnect
();
setDisconnect
();
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"connect status = %d, remote node = %d"
,
ndbout
<<
"DisconnectImpl "
<<
getConnectionStatus
()
<<
endl
;
(
int
)
getConnectionStatus
(),
remoteNodeId
));
ndbout
<<
"remote node "
<<
remoteNodeId
<<
endl
;
#endif
disconnectRemote
();
disconnectRemote
();
disconnectLocal
();
disconnectLocal
();
}
}
...
@@ -124,12 +126,9 @@ void SCI_Transporter::disconnectImpl()
...
@@ -124,12 +126,9 @@ void SCI_Transporter::disconnectImpl()
SCIClose
(
sciAdapters
[
i
].
scidesc
,
FLAGS
,
&
err
);
SCIClose
(
sciAdapters
[
i
].
scidesc
,
FLAGS
,
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
localNodeId
,
TE_SCI_UNABLE_TO_CLOSE_CHANNEL
);
report_error
(
TE_SCI_UNABLE_TO_CLOSE_CHANNEL
);
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Cannot close channel to the driver. Error code 0x%x"
,
fprintf
(
stderr
,
err
));
"
\n
Cannot close channel to the driver. Error code 0x%x"
,
err
);
#endif
}
}
}
}
}
}
...
@@ -143,46 +142,40 @@ void SCI_Transporter::disconnectImpl()
...
@@ -143,46 +142,40 @@ void SCI_Transporter::disconnectImpl()
ndbout
<<
"2049-4096: "
<<
i20484096
<<
endl
;
ndbout
<<
"2049-4096: "
<<
i20484096
<<
endl
;
ndbout
<<
"==4096: "
<<
i4096
<<
endl
;
ndbout
<<
"==4096: "
<<
i4096
<<
endl
;
ndbout
<<
">4096: "
<<
i4097
<<
endl
;
ndbout
<<
">4096: "
<<
i4097
<<
endl
;
#endif
#endif
DBUG_VOID_RETURN
;
}
}
bool
SCI_Transporter
::
initTransporter
()
{
bool
SCI_Transporter
::
initTransporter
()
{
if
(
m_BufferSize
<
(
2
*
MAX_MESSAGE_SIZE
)){
DBUG_ENTER
(
"SCI_Transporter::initTransporter"
);
m_BufferSize
=
2
*
MAX_MESSAGE_SIZE
;
if
(
m_BufferSize
<
(
2
*
MAX_MESSAGE_SIZE
+
4096
)){
m_BufferSize
=
2
*
MAX_MESSAGE_SIZE
+
4096
;
}
}
// Allocate buffers for sending
// Allocate buffers for sending, send buffer size plus 2048 bytes for avoiding
Uint32
sz
=
0
;
// the need to send twice when a large message comes around. Send buffer size is
if
(
m_BufferSize
<
(
m_PacketSize
*
4
)){
// measured in words.
sz
=
m_BufferSize
+
MAX_MESSAGE_SIZE
;
Uint32
sz
=
4
*
m_PacketSize
+
MAX_MESSAGE_SIZE
;;
}
else
{
/**
* 3 packages
*/
sz
=
(
m_PacketSize
*
4
)
*
3
+
MAX_MESSAGE_SIZE
;
}
m_sendBuffer
.
m_
b
ufferSize
=
4
*
((
sz
+
3
)
/
4
);
m_sendBuffer
.
m_
sendB
ufferSize
=
4
*
((
sz
+
3
)
/
4
);
m_sendBuffer
.
m_buffer
=
new
Uint32
[
m_sendBuffer
.
m_
b
ufferSize
/
4
];
m_sendBuffer
.
m_buffer
=
new
Uint32
[
m_sendBuffer
.
m_
sendB
ufferSize
/
4
];
m_sendBuffer
.
m_dataSize
=
0
;
m_sendBuffer
.
m_dataSize
=
0
;
DBUG_PRINT
(
"info"
,
(
"Created SCI Send Buffer with buffer size %d and packet size %d"
,
m_sendBuffer
.
m_sendBufferSize
,
m_PacketSize
*
4
));
if
(
!
getLinkStatus
(
m_ActiveAdapterId
)
||
if
(
!
getLinkStatus
(
m_ActiveAdapterId
)
||
!
getLinkStatus
(
m_StandbyAdapterId
))
{
(
m_adapters
>
1
&&
#ifdef DEBUG_TRANSPORTER
!
getLinkStatus
(
m_StandbyAdapterId
)))
{
ndbout
<<
"The link is not fully operational. "
<<
endl
;
DBUG_PRINT
(
"error"
,
(
"The link is not fully operational. Check the cables and the switches"
));
ndbout
<<
"Check the cables and the switches"
<<
endl
;
#endif
//reportDisconnect(remoteNodeId, 0);
//reportDisconnect(remoteNodeId, 0);
//doDisconnect();
//doDisconnect();
//NDB should terminate
//NDB should terminate
report
Error
(
callbackObj
,
localNodeId
,
TE_SCI_LINK_ERROR
);
report
_error
(
TE_SCI_LINK_ERROR
);
return
false
;
DBUG_RETURN
(
false
)
;
}
}
return
true
;
DBUG_RETURN
(
true
)
;
}
// initTransporter()
}
// initTransporter()
...
@@ -218,9 +211,7 @@ bool SCI_Transporter::getLinkStatus(Uint32 adapterNo)
...
@@ -218,9 +211,7 @@ bool SCI_Transporter::getLinkStatus(Uint32 adapterNo)
SCIQuery
(
SCI_Q_ADAPTER
,(
void
*
)(
&
queryAdapter
),(
Uint32
)
NULL
,
&
error
);
SCIQuery
(
SCI_Q_ADAPTER
,(
void
*
)(
&
queryAdapter
),(
Uint32
)
NULL
,
&
error
);
if
(
error
!=
SCI_ERR_OK
)
{
if
(
error
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"error %d querying adapter"
,
error
));
ndbout
<<
"error querying adapter "
<<
endl
;
#endif
return
false
;
return
false
;
}
}
if
(
linkstatus
<=
0
)
if
(
linkstatus
<=
0
)
...
@@ -231,6 +222,7 @@ bool SCI_Transporter::getLinkStatus(Uint32 adapterNo)
...
@@ -231,6 +222,7 @@ bool SCI_Transporter::getLinkStatus(Uint32 adapterNo)
sci_error_t
SCI_Transporter
::
initLocalSegment
()
{
sci_error_t
SCI_Transporter
::
initLocalSegment
()
{
DBUG_ENTER
(
"SCI_Transporter::initLocalSegment"
);
Uint32
segmentSize
=
m_BufferSize
;
Uint32
segmentSize
=
m_BufferSize
;
Uint32
offset
=
0
;
Uint32
offset
=
0
;
sci_error_t
err
;
sci_error_t
err
;
...
@@ -238,16 +230,12 @@ sci_error_t SCI_Transporter::initLocalSegment() {
...
@@ -238,16 +230,12 @@ sci_error_t SCI_Transporter::initLocalSegment() {
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
SCIOpen
(
&
(
sciAdapters
[
i
].
scidesc
),
FLAGS
,
&
err
);
SCIOpen
(
&
(
sciAdapters
[
i
].
scidesc
),
FLAGS
,
&
err
);
sciAdapters
[
i
].
localSciNodeId
=
getLocalNodeId
(
i
);
sciAdapters
[
i
].
localSciNodeId
=
getLocalNodeId
(
i
);
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"SCInode iD %d adapter %d
\n
"
,
ndbout_c
(
"SCInode iD %d adapter %d
\n
"
,
sciAdapters
[
i
].
localSciNodeId
,
i
));
sciAdapters
[
i
].
localSciNodeId
,
i
);
#endif
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Cannot open an SCI virtual device. Error code 0x%x"
,
ndbout_c
(
"
\n
Cannot open an SCI virtual device. Error code 0x%x"
,
err
));
err
);
DBUG_RETURN
(
err
);
#endif
return
err
;
}
}
}
}
}
}
...
@@ -264,12 +252,11 @@ sci_error_t SCI_Transporter::initLocalSegment() {
...
@@ -264,12 +252,11 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
return
err
;
DBUG_PRINT
(
"error"
,
(
"Error creating segment, err = 0x%x"
,
err
));
DBUG_RETURN
(
err
);
}
else
{
}
else
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"created segment id : %d"
,
ndbout
<<
"created segment id : "
hostSegmentId
(
localNodeId
,
remoteNodeId
)));
<<
hostSegmentId
(
localNodeId
,
remoteNodeId
)
<<
endl
;
#endif
}
}
/** Prepare the segment*/
/** Prepare the segment*/
...
@@ -280,11 +267,9 @@ sci_error_t SCI_Transporter::initLocalSegment() {
...
@@ -280,11 +267,9 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Local Segment is not accessible by an SCI adapter. Error code 0x%x
\n
"
,
ndbout_c
(
"Local Segment is not accessible by an SCI adapter."
);
err
));
ndbout_c
(
"Error code 0x%x
\n
"
,
err
);
DBUG_RETURN
(
err
);
#endif
return
err
;
}
}
}
}
...
@@ -301,14 +286,10 @@ sci_error_t SCI_Transporter::initLocalSegment() {
...
@@ -301,14 +286,10 @@ sci_error_t SCI_Transporter::initLocalSegment() {
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
DBUG_PRINT
(
"error"
,
(
"Cannot map area of size %d. Error code 0x%x"
,
#ifdef DEBUG_TRANSPORTER
segmentSize
,
err
));
fprintf
(
stderr
,
"
\n
Cannot map area of size %d. Error code 0x%x"
,
segmentSize
,
err
);
ndbout
<<
"initLocalSegment does a disConnect"
<<
endl
;
#endif
doDisconnect
();
doDisconnect
();
return
err
;
DBUG_RETURN
(
err
)
;
}
}
...
@@ -320,18 +301,16 @@ sci_error_t SCI_Transporter::initLocalSegment() {
...
@@ -320,18 +301,16 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Local Segment is not available for remote connections. Error code 0x%x
\n
"
,
ndbout_c
(
"
\n
Local Segment is not available for remote connections."
);
err
));
ndbout_c
(
"Error code 0x%x
\n
"
,
err
);
DBUG_RETURN
(
err
);
#endif
return
err
;
}
}
}
}
setupLocalSegment
();
setupLocalSegment
();
return
err
;
DBUG_RETURN
(
err
)
;
}
// initLocalSegment()
}
// initLocalSegment()
...
@@ -345,7 +324,7 @@ bool SCI_Transporter::doSend() {
...
@@ -345,7 +324,7 @@ bool SCI_Transporter::doSend() {
Uint32
retry
=
0
;
Uint32
retry
=
0
;
const
char
*
const
sendPtr
=
(
char
*
)
m_sendBuffer
.
m_buffer
;
const
char
*
const
sendPtr
=
(
char
*
)
m_sendBuffer
.
m_buffer
;
const
Uint32
sizeToSend
=
m_sendBuffer
.
m_dataSize
;
const
Uint32
sizeToSend
=
4
*
m_sendBuffer
.
m_dataSize
;
//Convert to number of bytes
if
(
sizeToSend
>
0
){
if
(
sizeToSend
>
0
){
#ifdef DEBUG_TRANSPORTER
#ifdef DEBUG_TRANSPORTER
...
@@ -363,15 +342,19 @@ bool SCI_Transporter::doSend() {
...
@@ -363,15 +342,19 @@ bool SCI_Transporter::doSend() {
i4097
++
;
i4097
++
;
#endif
#endif
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Start sequence failed"
));
ndbout
<<
"Start sequence failed"
<<
endl
;
report_error
(
TE_SCI_UNABLE_TO_START_SEQUENCE
);
#endif
reportError
(
callbackObj
,
remoteNodeId
,
TE_SCI_UNABLE_TO_START_SEQUENCE
);
return
false
;
return
false
;
}
}
tryagain:
tryagain:
retry
++
;
if
(
retry
>
3
)
{
DBUG_PRINT
(
"error"
,
(
"SCI Transfer failed"
));
report_error
(
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
return
false
;
}
Uint32
*
insertPtr
=
(
Uint32
*
)
Uint32
*
insertPtr
=
(
Uint32
*
)
(
m_TargetSegm
[
m_ActiveAdapterId
].
writer
)
->
getWritePtr
(
sizeToSend
);
(
m_TargetSegm
[
m_ActiveAdapterId
].
writer
)
->
getWritePtr
(
sizeToSend
);
...
@@ -390,44 +373,37 @@ bool SCI_Transporter::doSend() {
...
@@ -390,44 +373,37 @@ bool SCI_Transporter::doSend() {
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
==
SCI_ERR_OUT_OF_RANGE
)
{
if
(
err
==
SCI_ERR_OUT_OF_RANGE
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Data transfer : out of range error"
));
ndbout
<<
"Data transfer : out of range error
\n
"
<<
endl
;
#endif
goto
tryagain
;
goto
tryagain
;
}
}
if
(
err
==
SCI_ERR_SIZE_ALIGNMENT
)
{
if
(
err
==
SCI_ERR_SIZE_ALIGNMENT
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Data transfer : alignment error"
));
ndbout
<<
"Data transfer : aligne
\n
"
<<
endl
;
DBUG_PRINT
(
"info"
,
(
"sendPtr 0x%x, sizeToSend = %d"
,
sendPtr
,
sizeToSend
));
#endif
goto
tryagain
;
goto
tryagain
;
}
}
if
(
err
==
SCI_ERR_OFFSET_ALIGNMENT
)
{
if
(
err
==
SCI_ERR_OFFSET_ALIGNMENT
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Data transfer : offset alignment"
));
ndbout
<<
"Data transfer : offset alignment
\n
"
<<
endl
;
#endif
goto
tryagain
;
goto
tryagain
;
}
}
if
(
err
==
SCI_ERR_TRANSFER_FAILED
)
{
if
(
err
==
SCI_ERR_TRANSFER_FAILED
)
{
//(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock();
//(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock();
if
(
getLinkStatus
(
m_ActiveAdapterId
))
{
if
(
getLinkStatus
(
m_ActiveAdapterId
))
{
retry
++
;
if
(
retry
>
3
)
{
reportError
(
callbackObj
,
remoteNodeId
,
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
return
false
;
}
goto
tryagain
;
goto
tryagain
;
}
}
if
(
m_adapters
==
1
)
{
DBUG_PRINT
(
"error"
,
(
"SCI Transfer failed"
));
report_error
(
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
return
false
;
}
m_failCounter
++
;
m_failCounter
++
;
Uint32
temp
=
m_ActiveAdapterId
;
Uint32
temp
=
m_ActiveAdapterId
;
switch
(
m_swapCounter
)
{
switch
(
m_swapCounter
)
{
case
0
:
case
0
:
/**swap from active (0) to standby (1)*/
/**swap from active (0) to standby (1)*/
if
(
getLinkStatus
(
m_StandbyAdapterId
))
{
if
(
getLinkStatus
(
m_StandbyAdapterId
))
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Swapping from adapter 0 to 1"
));
ndbout
<<
"Swapping from 0 to 1 "
<<
endl
;
#endif
failoverShmWriter
();
failoverShmWriter
();
SCIStoreBarrier
(
m_TargetSegm
[
m_StandbyAdapterId
].
sequence
,
0
);
SCIStoreBarrier
(
m_TargetSegm
[
m_StandbyAdapterId
].
sequence
,
0
);
m_ActiveAdapterId
=
m_StandbyAdapterId
;
m_ActiveAdapterId
=
m_StandbyAdapterId
;
...
@@ -436,26 +412,21 @@ bool SCI_Transporter::doSend() {
...
@@ -436,26 +412,21 @@ bool SCI_Transporter::doSend() {
FLAGS
,
FLAGS
,
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
report
Error
(
callbackObj
,
report
_error
(
TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
);
remoteNodeId
,
TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
);
DBUG_PRINT
(
"error"
,
(
"Unable to remove sequence"
));
return
false
;
return
false
;
}
}
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Start sequence failed"
));
ndbout
<<
"Start sequence failed"
<<
endl
;
report_error
(
TE_SCI_UNABLE_TO_START_SEQUENCE
);
#endif
reportError
(
callbackObj
,
remoteNodeId
,
TE_SCI_UNABLE_TO_START_SEQUENCE
);
return
false
;
return
false
;
}
}
m_swapCounter
++
;
m_swapCounter
++
;
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"failover complete"
));
ndbout
<<
"failover complete.."
<<
endl
;
#endif
goto
tryagain
;
goto
tryagain
;
}
else
{
}
else
{
report
Error
(
callbackObj
,
report
_error
(
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
remoteNodeId
,
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
DBUG_PRINT
(
"error"
,
(
"SCI Transfer failed"
));
return
false
;
return
false
;
}
}
return
false
;
return
false
;
...
@@ -468,20 +439,15 @@ bool SCI_Transporter::doSend() {
...
@@ -468,20 +439,15 @@ bool SCI_Transporter::doSend() {
failoverShmWriter
();
failoverShmWriter
();
m_ActiveAdapterId
=
m_StandbyAdapterId
;
m_ActiveAdapterId
=
m_StandbyAdapterId
;
m_StandbyAdapterId
=
temp
;
m_StandbyAdapterId
=
temp
;
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"Swapping from 1 to 0"
));
ndbout
<<
"Swapping from 1 to 0 "
<<
endl
;
#endif
if
(
createSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
createSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
DBUG_PRINT
(
"error"
,
(
"Unable to create sequence"
));
remoteNodeId
,
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
report_error
(
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
return
false
;
return
false
;
}
}
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
startSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"startSequence failed... disconnecting"
));
ndbout
<<
"startSequence failed... disconnecting"
<<
endl
;
report_error
(
TE_SCI_UNABLE_TO_START_SEQUENCE
);
#endif
reportError
(
callbackObj
,
remoteNodeId
,
TE_SCI_UNABLE_TO_START_SEQUENCE
);
return
false
;
return
false
;
}
}
...
@@ -489,37 +455,36 @@ bool SCI_Transporter::doSend() {
...
@@ -489,37 +455,36 @@ bool SCI_Transporter::doSend() {
,
FLAGS
,
,
FLAGS
,
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
DBUG_PRINT
(
"error"
,
(
"Unable to remove sequence"
));
remoteNodeId
,
TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
);
report_error
(
TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
);
return
false
;
return
false
;
}
}
if
(
createSequence
(
m_StandbyAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
createSequence
(
m_StandbyAdapterId
)
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
DBUG_PRINT
(
"error"
,
(
"Unable to create sequence on standby"
));
remoteNodeId
,
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
report_error
(
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
return
false
;
return
false
;
}
}
m_swapCounter
=
0
;
m_swapCounter
=
0
;
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"failover complete.."
));
ndbout
<<
"failover complete.."
<<
endl
;
#endif
goto
tryagain
;
goto
tryagain
;
}
else
{
}
else
{
reportError
(
callbackObj
,
DBUG_PRINT
(
"error"
,
(
"Unrecoverable data transfer error"
));
remoteNodeId
,
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
report_error
(
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
return
false
;
return
false
;
}
}
break
;
break
;
default:
default:
reportError
(
callbackObj
,
DBUG_PRINT
(
"error"
,
(
"Unrecoverable data transfer error"
));
remoteNodeId
,
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
report_error
(
TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
);
return
false
;
return
false
;
break
;
break
;
}
}
}
}
else
{
}
else
{
SHM_Writer
*
writer
=
(
m_TargetSegm
[
m_ActiveAdapterId
].
writer
);
SHM_Writer
*
writer
=
(
m_TargetSegm
[
m_ActiveAdapterId
].
writer
);
writer
->
updateWritePtr
(
sizeToSend
);
writer
->
updateWritePtr
(
sizeToSend
);
...
@@ -535,13 +500,10 @@ bool SCI_Transporter::doSend() {
...
@@ -535,13 +500,10 @@ bool SCI_Transporter::doSend() {
/**
/**
* If we end up here, the SCI segment is full.
* If we end up here, the SCI segment is full.
*/
*/
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"the segment is full for some reason"
));
ndbout
<<
"the segment is full for some reason"
<<
endl
;
#endif
return
false
;
return
false
;
}
//if
}
//if
}
}
return
true
;
return
true
;
}
// doSend()
}
// doSend()
...
@@ -557,11 +519,8 @@ void SCI_Transporter::failoverShmWriter() {
...
@@ -557,11 +519,8 @@ void SCI_Transporter::failoverShmWriter() {
void
SCI_Transporter
::
setupLocalSegment
()
void
SCI_Transporter
::
setupLocalSegment
()
{
{
DBUG_ENTER
(
"SCI_Transporter::setupLocalSegment"
);
Uint32
sharedSize
=
0
;
Uint32
sharedSize
=
0
;
sharedSize
+=
16
;
//SHM_Reader::getSharedSize();
sharedSize
+=
16
;
//SHM_Writer::getSharedSize();
sharedSize
+=
32
;
//SHM_Writer::getSharedSize();
sharedSize
=
4096
;
//start of the buffer is page aligend
sharedSize
=
4096
;
//start of the buffer is page aligend
Uint32
sizeOfBuffer
=
m_BufferSize
;
Uint32
sizeOfBuffer
=
m_BufferSize
;
...
@@ -570,26 +529,14 @@ void SCI_Transporter::setupLocalSegment()
...
@@ -570,26 +529,14 @@ void SCI_Transporter::setupLocalSegment()
Uint32
*
localReadIndex
=
Uint32
*
localReadIndex
=
(
Uint32
*
)
m_SourceSegm
[
m_ActiveAdapterId
].
mappedMemory
;
(
Uint32
*
)
m_SourceSegm
[
m_ActiveAdapterId
].
mappedMemory
;
Uint32
*
localWriteIndex
=
Uint32
*
localWriteIndex
=
(
Uint32
*
)(
localReadIndex
+
1
);
(
Uint32
*
)(
localReadIndex
+
1
);
Uint32
*
localEndOfDataIndex
=
(
Uint32
*
)
(
localReadIndex
+
2
);
m_localStatusFlag
=
(
Uint32
*
)(
localReadIndex
+
3
);
m_localStatusFlag
=
(
Uint32
*
)(
localReadIndex
+
3
);
Uint32
*
sharedLockIndex
=
(
Uint32
*
)
(
localReadIndex
+
4
);
Uint32
*
sharedHeavyLock
=
(
Uint32
*
)
(
localReadIndex
+
5
);
char
*
localStartOfBuf
=
(
char
*
)
char
*
localStartOfBuf
=
(
char
*
)
((
char
*
)
m_SourceSegm
[
m_ActiveAdapterId
].
mappedMemory
+
sharedSize
);
((
char
*
)
m_SourceSegm
[
m_ActiveAdapterId
].
mappedMemory
+
sharedSize
);
*
localReadIndex
=
0
;
*
localReadIndex
=
*
localWriteIndex
=
0
;
*
localWriteIndex
=
0
;
*
localEndOfDataIndex
=
sizeOfBuffer
-
1
;
const
Uint32
slack
=
MAX_MESSAGE_SIZE
;
const
Uint32
slack
=
MAX_MESSAGE_SIZE
;
...
@@ -599,67 +546,63 @@ void SCI_Transporter::setupLocalSegment()
...
@@ -599,67 +546,63 @@ void SCI_Transporter::setupLocalSegment()
localReadIndex
,
localReadIndex
,
localWriteIndex
);
localWriteIndex
);
*
localReadIndex
=
0
;
*
localWriteIndex
=
0
;
reader
->
clear
();
reader
->
clear
();
DBUG_VOID_RETURN
;
}
//setupLocalSegment
}
//setupLocalSegment
void
SCI_Transporter
::
setupRemoteSegment
()
void
SCI_Transporter
::
setupRemoteSegment
()
{
{
DBUG_ENTER
(
"SCI_Transporter::setupRemoteSegment"
);
Uint32
sharedSize
=
0
;
Uint32
sharedSize
=
0
;
sharedSize
+=
16
;
//SHM_Reader::getSharedSize();
sharedSize
=
4096
;
//start of the buffer is page aligned
sharedSize
+=
16
;
//SHM_Writer::getSharedSize();
sharedSize
+=
32
;
sharedSize
=
4096
;
//start of the buffer is page aligend
Uint32
sizeOfBuffer
=
m_BufferSize
;
Uint32
sizeOfBuffer
=
m_BufferSize
;
const
Uint32
slack
=
MAX_MESSAGE_SIZE
;
sizeOfBuffer
-=
sharedSize
;
sizeOfBuffer
-=
sharedSize
;
Uint32
*
segPtr
=
(
Uint32
*
)
m_TargetSegm
[
m_StandbyAdapterId
].
mappedMemory
;
Uint32
*
remoteReadIndex2
=
(
Uint32
*
)
segPtr
;
Uint32
*
segPtr
=
(
Uint32
*
)
m_TargetSegm
[
m_ActiveAdapterId
].
mappedMemory
;
Uint32
*
remoteWriteIndex2
=
(
Uint32
*
)
(
segPtr
+
1
);
Uint32
*
remoteEndOfDataIndex2
=
(
Uint32
*
)
(
segPtr
+
2
);
Uint32
*
sharedLockIndex2
=
(
Uint32
*
)
(
segPtr
+
3
);
m_remoteStatusFlag2
=
(
Uint32
*
)(
segPtr
+
4
);
Uint32
*
sharedHeavyLock2
=
(
Uint32
*
)
(
segPtr
+
5
);
Uint32
*
remoteReadIndex
=
(
Uint32
*
)
segPtr
;
Uint32
*
remoteWriteIndex
=
(
Uint32
*
)(
segPtr
+
1
);
m_remoteStatusFlag
=
(
Uint32
*
)(
segPtr
+
3
);
char
*
remoteStartOfBuf
2
=
(
char
*
)((
char
*
)
segPtr
+
sharedSize
);
char
*
remoteStartOfBuf
=
(
char
*
)((
char
*
)
segPtr
+
(
sharedSize
)
);
segPtr
=
(
Uint32
*
)
m_TargetSegm
[
m_ActiveAdapterId
].
mappedMemory
;
writer
=
new
SHM_Writer
(
remoteStartOfBuf
,
sizeOfBuffer
,
slack
,
remoteReadIndex
,
remoteWriteIndex
);
Uint32
*
remoteReadIndex
=
(
Uint32
*
)
segPtr
;
writer
->
clear
();
Uint32
*
remoteWriteIndex
=
(
Uint32
*
)
(
segPtr
+
1
);
Uint32
*
remoteEndOfDataIndex
=
(
Uint32
*
)
(
segPtr
+
2
);
Uint32
*
sharedLockIndex
=
(
Uint32
*
)
(
segPtr
+
3
);
m_remoteStatusFlag
=
(
Uint32
*
)(
segPtr
+
4
);
Uint32
*
sharedHeavyLock
=
(
Uint32
*
)
(
segPtr
+
5
);
char
*
remoteStartOfBuf
=
(
char
*
)((
char
*
)
segPtr
+
(
sharedSize
));
m_TargetSegm
[
0
].
writer
=
writer
;
m_sendBuffer
.
m_forceSendLimit
=
writer
->
getBufferSize
();
if
(
createSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
report_error
(
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
DBUG_PRINT
(
"error"
,
(
"Unable to create sequence on active"
));
doDisconnect
();
}
if
(
m_adapters
>
1
)
{
segPtr
=
(
Uint32
*
)
m_TargetSegm
[
m_StandbyAdapterId
].
mappedMemory
;
*
remoteReadIndex
=
*
remoteWriteIndex
=
0
;
Uint32
*
remoteReadIndex2
=
(
Uint32
*
)
segPtr
;
*
remoteReadIndex2
=
*
remoteWriteIndex2
=
0
;
Uint32
*
remoteWriteIndex2
=
(
Uint32
*
)
(
segPtr
+
1
);
*
remoteEndOfDataIndex
=
sizeOfBuffer
-
1
;
m_remoteStatusFlag2
=
(
Uint32
*
)(
segPtr
+
3
);
*
remoteEndOfDataIndex2
=
sizeOfBuffer
-
1
;
char
*
remoteStartOfBuf2
=
(
char
*
)((
char
*
)
segPtr
+
sharedSize
);
/**
/**
* setup two writers
. writer2 is used to mirror the changes of
* setup a writer
. writer2 is used to mirror the changes of
* writer on the standby
* writer on the standby
* segment, so that in the case of a failover, we can switch
* segment, so that in the case of a failover, we can switch
* to the stdby seg. quickly.*
* to the stdby seg. quickly.*
*/
*/
const
Uint32
slack
=
MAX_MESSAGE_SIZE
;
writer
=
new
SHM_Writer
(
remoteStartOfBuf
,
sizeOfBuffer
,
slack
,
remoteReadIndex
,
remoteWriteIndex
);
writer2
=
new
SHM_Writer
(
remoteStartOfBuf2
,
writer2
=
new
SHM_Writer
(
remoteStartOfBuf2
,
sizeOfBuffer
,
sizeOfBuffer
,
slack
,
slack
,
...
@@ -668,45 +611,41 @@ void SCI_Transporter::setupRemoteSegment()
...
@@ -668,45 +611,41 @@ void SCI_Transporter::setupRemoteSegment()
*
remoteReadIndex
=
0
;
*
remoteReadIndex
=
0
;
*
remoteWriteIndex
=
0
;
*
remoteWriteIndex
=
0
;
writer
->
clear
();
writer2
->
clear
();
writer2
->
clear
();
m_TargetSegm
[
0
].
writer
=
writer
;
m_TargetSegm
[
1
].
writer
=
writer2
;
m_TargetSegm
[
1
].
writer
=
writer2
;
m_sendBuffer
.
m_forceSendLimit
=
writer
->
getBufferSize
();
if
(
createSequence
(
m_ActiveAdapterId
)
!=
SCI_ERR_OK
)
{
reportThreadError
(
remoteNodeId
,
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
doDisconnect
();
}
if
(
createSequence
(
m_StandbyAdapterId
)
!=
SCI_ERR_OK
)
{
if
(
createSequence
(
m_StandbyAdapterId
)
!=
SCI_ERR_OK
)
{
reportThreadError
(
remoteNodeId
,
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
report_error
(
TE_SCI_UNABLE_TO_CREATE_SEQUENCE
);
DBUG_PRINT
(
"error"
,
(
"Unable to create sequence on standby"
));
doDisconnect
();
doDisconnect
();
}
}
}
DBUG_VOID_RETURN
;
}
//setupRemoteSegment
}
//setupRemoteSegment
bool
bool
SCI_Transporter
::
connectImpl
(
Uint32
timeout
)
{
SCI_Transporter
::
init_local
()
{
sci_error_t
err
;
DBUG_ENTER
(
"SCI_Transporter::init_local"
);
Uint32
offset
=
0
;
if
(
!
m_initLocal
)
{
if
(
!
m_initLocal
)
{
if
(
initLocalSegment
()
!=
SCI_ERR_OK
){
if
(
initLocalSegment
()
!=
SCI_ERR_OK
){
NdbSleep_MilliSleep
(
timeout
);
NdbSleep_MilliSleep
(
10
);
//NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
//NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
report
ThreadError
(
localNodeId
,
TE_SCI_CANNOT_INIT_LOCALSEGMENT
);
report
_error
(
TE_SCI_CANNOT_INIT_LOCALSEGMENT
);
return
false
;
DBUG_RETURN
(
false
);
}
}
m_initLocal
=
true
;
m_initLocal
=
true
;
}
}
DBUG_RETURN
(
true
);
}
bool
SCI_Transporter
::
init_remote
()
{
DBUG_ENTER
(
"SCI_Transporter::init_remote"
);
sci_error_t
err
;
Uint32
offset
=
0
;
if
(
!
m_mapped
)
{
if
(
!
m_mapped
)
{
DBUG_PRINT
(
"info"
,
(
"Map remote segments"
));
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
m_TargetSegm
[
i
].
rhm
[
i
].
remoteHandle
=
0
;
m_TargetSegm
[
i
].
rhm
[
i
].
remoteHandle
=
0
;
SCIConnectSegment
(
sciAdapters
[
i
].
scidesc
,
SCIConnectSegment
(
sciAdapters
[
i
].
scidesc
,
...
@@ -721,13 +660,12 @@ bool SCI_Transporter::connectImpl(Uint32 timeout) {
...
@@ -721,13 +660,12 @@ bool SCI_Transporter::connectImpl(Uint32 timeout) {
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
NdbSleep_MilliSleep
(
timeout
);
NdbSleep_MilliSleep
(
10
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"Error connecting segment, err 0x%x"
,
err
));
DBUG_RETURN
(
false
);
}
}
}
}
// Map the remote memory segment into program space
// Map the remote memory segment into program space
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
m_TargetSegm
[
i
].
mappedMemory
=
m_TargetSegm
[
i
].
mappedMemory
=
...
@@ -741,35 +679,106 @@ bool SCI_Transporter::connectImpl(Uint32 timeout) {
...
@@ -741,35 +679,106 @@ bool SCI_Transporter::connectImpl(Uint32 timeout) {
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Cannot map a segment to the remote node %d. Error code 0x%x"
,
m_RemoteSciNodeId
,
err
));
ndbout_c
(
"
\n
Cannot map a segment to the remote node %d."
);
ndbout_c
(
"Error code 0x%x"
,
m_RemoteSciNodeId
,
err
);
#endif
//NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
//NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
reportThreadError
(
remoteNodeId
,
TE_SCI_CANNOT_MAP_REMOTESEGMENT
);
report_error
(
TE_SCI_CANNOT_MAP_REMOTESEGMENT
);
return
false
;
DBUG_RETURN
(
false
);
}
}
}
}
m_mapped
=
true
;
m_mapped
=
true
;
setupRemoteSegment
();
setupRemoteSegment
();
setConnected
();
setConnected
();
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"connected and mapped to segment, remoteNode: %d"
,
ndbout
<<
"connected and mapped to segment : "
<<
endl
;
remoteNodeId
));
ndbout
<<
"remoteNode: "
<<
m_remoteNodes
[
0
]
<<
endl
;
DBUG_PRINT
(
"info"
,
(
"remoteSegId: %d"
,
ndbout
<<
"remoteNode: "
<<
m_remotenodes
[
1
]
<<
endl
;
remoteSegmentId
(
localNodeId
,
remoteNodeId
)));
ndbout
<<
"remoteSegId: "
DBUG_RETURN
(
true
);
<<
remoteSegmentId
(
localNodeId
,
remoteNodeId
)
}
else
{
<<
endl
;
DBUG_RETURN
(
getConnectionStatus
());
#endif
return
true
;
}
}
else
{
}
return
getConnectionStatus
();
bool
SCI_Transporter
::
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
SocketInputStream
s_input
(
sockfd
);
SocketOutputStream
s_output
(
sockfd
);
char
buf
[
256
];
DBUG_ENTER
(
"SCI_Transporter::connect_client_impl"
);
// Wait for server to create and attach
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
DBUG_PRINT
(
"error"
,
(
"No initial response from server in SCI"
));
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
if
(
!
init_local
())
{
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
// Send ok to server
s_output
.
println
(
"sci client 1 ok"
);
if
(
!
init_remote
())
{
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
// Wait for ok from server
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
DBUG_PRINT
(
"error"
,
(
"No second response from server in SCI"
));
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
// Send ok to server
s_output
.
println
(
"sci client 2 ok"
);
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_PRINT
(
"info"
,
(
"Successfully connected client to node %d"
,
remoteNodeId
));
DBUG_RETURN
(
true
);
}
bool
SCI_Transporter
::
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
SocketOutputStream
s_output
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
char
buf
[
256
];
DBUG_ENTER
(
"SCI_Transporter::connect_server_impl"
);
if
(
!
init_local
())
{
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
// Send ok to client
s_output
.
println
(
"sci server 1 ok"
);
// Wait for ok from client
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
DBUG_PRINT
(
"error"
,
(
"No response from client in SCI"
));
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
}
}
// connectImpl()
if
(
!
init_remote
())
{
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
// Send ok to client
s_output
.
println
(
"sci server 2 ok"
);
// Wait for ok from client
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
DBUG_PRINT
(
"error"
,
(
"No second response from client in SCI"
));
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_RETURN
(
false
);
}
NDB_CLOSE_SOCKET
(
sockfd
);
DBUG_PRINT
(
"info"
,
(
"Successfully connected server to node %d"
,
remoteNodeId
));
DBUG_RETURN
(
true
);
}
sci_error_t
SCI_Transporter
::
createSequence
(
Uint32
adapterid
)
{
sci_error_t
SCI_Transporter
::
createSequence
(
Uint32
adapterid
)
{
sci_error_t
err
;
sci_error_t
err
;
...
@@ -802,6 +811,7 @@ sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) {
...
@@ -802,6 +811,7 @@ sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) {
bool
SCI_Transporter
::
disconnectLocal
()
bool
SCI_Transporter
::
disconnectLocal
()
{
{
DBUG_ENTER
(
"SCI_Transporter::disconnectLocal"
);
sci_error_t
err
;
sci_error_t
err
;
m_ActiveAdapterId
=
0
;
m_ActiveAdapterId
=
0
;
...
@@ -810,9 +820,9 @@ bool SCI_Transporter::disconnectLocal()
...
@@ -810,9 +820,9 @@ bool SCI_Transporter::disconnectLocal()
SCIUnmapSegment
(
m_SourceSegm
[
0
].
lhm
[
0
].
map
,
0
,
&
err
);
SCIUnmapSegment
(
m_SourceSegm
[
0
].
lhm
[
0
].
map
,
0
,
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
report_error
(
TE_SCI_UNABLE_TO_UNMAP_SEGMENT
);
remoteNodeId
,
TE_SCI_UNABLE_TO_UNMAP_SEGMENT
);
DBUG_PRINT
(
"error"
,
(
"Unable to unmap segment"
));
return
false
;
DBUG_RETURN
(
false
)
;
}
}
SCIRemoveSegment
((
m_SourceSegm
[
m_ActiveAdapterId
].
localHandle
),
SCIRemoveSegment
((
m_SourceSegm
[
m_ActiveAdapterId
].
localHandle
),
...
@@ -820,20 +830,17 @@ bool SCI_Transporter::disconnectLocal()
...
@@ -820,20 +830,17 @@ bool SCI_Transporter::disconnectLocal()
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
remoteNodeId
,
TE_SCI_UNABLE_TO_REMOVE_SEGMENT
);
report_error
(
TE_SCI_UNABLE_TO_REMOVE_SEGMENT
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"Unable to remove segment"
));
DBUG_RETURN
(
false
);
}
}
DBUG_PRINT
(
"info"
,
(
"Local memory segment is unmapped and removed"
));
if
(
err
==
SCI_ERR_OK
)
{
DBUG_RETURN
(
true
);
#ifdef DEBUG_TRANSPORTER
printf
(
"Local memory segment is unmapped and removed
\n
"
);
#endif
}
return
true
;
}
// disconnectLocal()
}
// disconnectLocal()
bool
SCI_Transporter
::
disconnectRemote
()
{
bool
SCI_Transporter
::
disconnectRemote
()
{
DBUG_ENTER
(
"SCI_Transporter::disconnectRemote"
);
sci_error_t
err
;
sci_error_t
err
;
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
for
(
Uint32
i
=
0
;
i
<
m_adapters
;
i
++
)
{
/**
/**
...
@@ -841,35 +848,32 @@ bool SCI_Transporter::disconnectRemote() {
...
@@ -841,35 +848,32 @@ bool SCI_Transporter::disconnectRemote() {
*/
*/
SCIUnmapSegment
(
m_TargetSegm
[
i
].
rhm
[
i
].
map
,
0
,
&
err
);
SCIUnmapSegment
(
m_TargetSegm
[
i
].
rhm
[
i
].
map
,
0
,
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
reportError
(
callbackObj
,
report_error
(
TE_SCI_UNABLE_TO_UNMAP_SEGMENT
);
remoteNodeId
,
TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT
);
DBUG_PRINT
(
"error"
,
(
"Unable to unmap segment"
));
return
false
;
DBUG_RETURN
(
false
)
;
}
}
SCIDisconnectSegment
(
m_TargetSegm
[
i
].
rhm
[
i
].
remoteHandle
,
SCIDisconnectSegment
(
m_TargetSegm
[
i
].
rhm
[
i
].
remoteHandle
,
FLAGS
,
FLAGS
,
&
err
);
&
err
);
if
(
err
!=
SCI_ERR_OK
)
{
if
(
err
!=
SCI_ERR_OK
)
{
report
Error
(
callbackObj
,
report
_error
(
TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT
);
remoteNodeId
,
TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT
);
DBUG_PRINT
(
"error"
,
(
"Unable to disconnect segment"
));
return
false
;
DBUG_RETURN
(
false
)
;
}
}
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"info"
,
(
"Remote memory segment is unmapped and disconnected"
));
ndbout_c
(
"Remote memory segment is unmapped and disconnected
\n
"
);
#endif
}
}
return
true
;
DBUG_RETURN
(
true
)
;
}
// disconnectRemote()
}
// disconnectRemote()
SCI_Transporter
::~
SCI_Transporter
()
{
SCI_Transporter
::~
SCI_Transporter
()
{
DBUG_ENTER
(
"SCI_Transporter::~SCI_Transporter"
);
// Close channel to the driver
// Close channel to the driver
#ifdef DEBUG_TRANSPORTER
ndbout
<<
"~SCITransporter does a disConnect"
<<
endl
;
#endif
doDisconnect
();
doDisconnect
();
if
(
m_sendBuffer
.
m_buffer
!=
NULL
)
if
(
m_sendBuffer
.
m_buffer
!=
NULL
)
delete
[]
m_sendBuffer
.
m_buffer
;
delete
[]
m_sendBuffer
.
m_buffer
;
DBUG_VOID_RETURN
;
}
// ~SCI_Transporter()
}
// ~SCI_Transporter()
...
@@ -878,7 +882,7 @@ SCI_Transporter::~SCI_Transporter() {
...
@@ -878,7 +882,7 @@ SCI_Transporter::~SCI_Transporter() {
void
SCI_Transporter
::
closeSCI
()
{
void
SCI_Transporter
::
closeSCI
()
{
// Termination of SCI
// Termination of SCI
sci_error_t
err
;
sci_error_t
err
;
printf
(
"
\n
Closing SCI Transporter...
\n
"
);
DBUG_ENTER
(
"SCI_Transporter::closeSCI"
);
// Disconnect and remove remote segment
// Disconnect and remove remote segment
disconnectRemote
();
disconnectRemote
();
...
@@ -890,26 +894,41 @@ void SCI_Transporter::closeSCI() {
...
@@ -890,26 +894,41 @@ void SCI_Transporter::closeSCI() {
// Closes an SCI virtual device
// Closes an SCI virtual device
SCIClose
(
activeSCIDescriptor
,
FLAGS
,
&
err
);
SCIClose
(
activeSCIDescriptor
,
FLAGS
,
&
err
);
if
(
err
!=
SCI_ERR_OK
)
if
(
err
!=
SCI_ERR_OK
)
{
fprintf
(
stderr
,
DBUG_PRINT
(
"error"
,
(
"Cannot close SCI channel to the driver. Error code 0x%x"
,
"
\n
Cannot close SCI channel to the driver. Error code 0x%x"
,
err
));
err
);
}
SCITerminate
();
SCITerminate
();
DBUG_VOID_RETURN
;
}
// closeSCI()
}
// closeSCI()
Uint32
*
Uint32
*
SCI_Transporter
::
getWritePtr
(
Uint32
lenBytes
,
Uint32
prio
){
SCI_Transporter
::
getWritePtr
(
Uint32
lenBytes
,
Uint32
prio
)
{
if
(
m_sendBuffer
.
full
()){
Uint32
sci_buffer_remaining
=
m_sendBuffer
.
m_forceSendLimit
;
/**-------------------------------------------------
Uint32
send_buf_size
=
m_sendBuffer
.
m_sendBufferSize
;
* Buffer was completely full. We have severe problems.
Uint32
curr_data_size
=
m_sendBuffer
.
m_dataSize
<<
2
;
* -------------------------------------------------
Uint32
new_curr_data_size
=
curr_data_size
+
lenBytes
;
if
((
curr_data_size
>=
send_buf_size
)
||
(
curr_data_size
>=
sci_buffer_remaining
))
{
/**
* The new message will not fit in the send buffer. We need to
* send the send buffer before filling it up with the new
* signal data. If current data size will spill over buffer edge
* we will also send to ensure correct operation.
*/
if
(
!
doSend
())
{
/**
* We were not successfull sending, report 0 as meaning buffer full and
* upper levels handle retries and other recovery matters.
*/
*/
if
(
!
doSend
()){
return
0
;
return
0
;
}
}
}
}
/**
* New signal fits, simply fill it up with more data.
*/
Uint32
sz
=
m_sendBuffer
.
m_dataSize
;
Uint32
sz
=
m_sendBuffer
.
m_dataSize
;
return
&
m_sendBuffer
.
m_buffer
[
sz
];
return
&
m_sendBuffer
.
m_buffer
[
sz
];
}
}
...
@@ -918,10 +937,11 @@ void
...
@@ -918,10 +937,11 @@ void
SCI_Transporter
::
updateWritePtr
(
Uint32
lenBytes
,
Uint32
prio
){
SCI_Transporter
::
updateWritePtr
(
Uint32
lenBytes
,
Uint32
prio
){
Uint32
sz
=
m_sendBuffer
.
m_dataSize
;
Uint32
sz
=
m_sendBuffer
.
m_dataSize
;
sz
+=
(
lenBytes
/
4
);
Uint32
packet_size
=
m_PacketSize
;
sz
+=
((
lenBytes
+
3
)
>>
2
);
m_sendBuffer
.
m_dataSize
=
sz
;
m_sendBuffer
.
m_dataSize
=
sz
;
if
(
sz
>
m_PacketS
ize
)
{
if
(
sz
>
packet_s
ize
)
{
/**-------------------------------------------------
/**-------------------------------------------------
* Buffer is full and we are ready to send. We will
* Buffer is full and we are ready to send. We will
* not wait since the signal is already in the buffer.
* not wait since the signal is already in the buffer.
...
@@ -944,7 +964,8 @@ bool
...
@@ -944,7 +964,8 @@ bool
SCI_Transporter
::
getConnectionStatus
()
{
SCI_Transporter
::
getConnectionStatus
()
{
if
(
*
m_localStatusFlag
==
SCICONNECTED
&&
if
(
*
m_localStatusFlag
==
SCICONNECTED
&&
(
*
m_remoteStatusFlag
==
SCICONNECTED
||
(
*
m_remoteStatusFlag
==
SCICONNECTED
||
*
m_remoteStatusFlag2
==
SCICONNECTED
))
((
m_adapters
>
1
)
&&
*
m_remoteStatusFlag2
==
SCICONNECTED
)))
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
@@ -954,7 +975,9 @@ SCI_Transporter::getConnectionStatus() {
...
@@ -954,7 +975,9 @@ SCI_Transporter::getConnectionStatus() {
void
void
SCI_Transporter
::
setConnected
()
{
SCI_Transporter
::
setConnected
()
{
*
m_remoteStatusFlag
=
SCICONNECTED
;
*
m_remoteStatusFlag
=
SCICONNECTED
;
if
(
m_adapters
>
1
)
{
*
m_remoteStatusFlag2
=
SCICONNECTED
;
*
m_remoteStatusFlag2
=
SCICONNECTED
;
}
*
m_localStatusFlag
=
SCICONNECTED
;
*
m_localStatusFlag
=
SCICONNECTED
;
}
}
...
@@ -963,8 +986,10 @@ void
...
@@ -963,8 +986,10 @@ void
SCI_Transporter
::
setDisconnect
()
{
SCI_Transporter
::
setDisconnect
()
{
if
(
getLinkStatus
(
m_ActiveAdapterId
))
if
(
getLinkStatus
(
m_ActiveAdapterId
))
*
m_remoteStatusFlag
=
SCIDISCONNECT
;
*
m_remoteStatusFlag
=
SCIDISCONNECT
;
if
(
m_adapters
>
1
)
{
if
(
getLinkStatus
(
m_StandbyAdapterId
))
if
(
getLinkStatus
(
m_StandbyAdapterId
))
*
m_remoteStatusFlag2
=
SCIDISCONNECT
;
*
m_remoteStatusFlag2
=
SCIDISCONNECT
;
}
}
}
...
@@ -981,20 +1006,20 @@ static bool init = false;
...
@@ -981,20 +1006,20 @@ static bool init = false;
bool
bool
SCI_Transporter
::
initSCI
()
{
SCI_Transporter
::
initSCI
()
{
DBUG_ENTER
(
"SCI_Transporter::initSCI"
);
if
(
!
init
){
if
(
!
init
){
sci_error_t
error
;
sci_error_t
error
;
// Initialize SISCI library
// Initialize SISCI library
SCIInitialize
(
0
,
&
error
);
SCIInitialize
(
0
,
&
error
);
if
(
error
!=
SCI_ERR_OK
)
{
if
(
error
!=
SCI_ERR_OK
)
{
#ifdef DEBUG_TRANSPORTER
DBUG_PRINT
(
"error"
,
(
"Cannot initialize SISCI library."
));
ndbout_c
(
"
\n
Cannot initialize SISCI library."
);
DBUG_PRINT
(
"error"
,
(
"Inconsistency between SISCI library and SISCI driver. Error code 0x%x"
,
ndbout_c
(
"
\n
Inconsistency between SISCI library and SISCI driver.Error code 0x%x"
,
error
);
error
));
#endif
DBUG_RETURN
(
false
);
return
false
;
}
}
init
=
true
;
init
=
true
;
}
}
return
true
;
DBUG_RETURN
(
true
);
}
}
...
...
ndb/src/common/transporter/SCI_Transporter.hpp
View file @
f4721210
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <ndb_types.h>
#include <ndb_types.h>
/**
/**
* The SCI Transporter
* The SCI Transporter
*
*
* The design goal of the SCI transporter is to deliver high performance
* The design goal of the SCI transporter is to deliver high performance
...
@@ -135,15 +135,17 @@ public:
...
@@ -135,15 +135,17 @@ public:
bool
getConnectionStatus
();
bool
getConnectionStatus
();
private:
private:
SCI_Transporter
(
Uint32
packetSize
,
SCI_Transporter
(
TransporterRegistry
&
t_reg
,
const
char
*
local_host
,
const
char
*
remote_host
,
int
port
,
Uint32
packetSize
,
Uint32
bufferSize
,
Uint32
bufferSize
,
Uint32
nAdapters
,
Uint32
nAdapters
,
Uint16
remoteSciNodeId0
,
Uint16
remoteSciNodeId0
,
Uint16
remoteSciNodeId1
,
Uint16
remoteSciNodeId1
,
NodeId
localNodeID
,
NodeId
localNodeID
,
NodeId
remoteNodeID
,
NodeId
remoteNodeID
,
int
byteorder
,
bool
compression
,
bool
checksum
,
bool
checksum
,
bool
signalId
,
bool
signalId
,
Uint32
reportFreq
=
4096
);
Uint32
reportFreq
=
4096
);
...
@@ -160,7 +162,8 @@ private:
...
@@ -160,7 +162,8 @@ private:
/**
/**
* For statistics on transfered packets
* For statistics on transfered packets
*/
*/
#ifdef DEBUG_TRANSPORTER
//#ifdef DEBUG_TRANSPORTER
#if 1
Uint32
i1024
;
Uint32
i1024
;
Uint32
i2048
;
Uint32
i2048
;
Uint32
i2049
;
Uint32
i2049
;
...
@@ -177,10 +180,8 @@ private:
...
@@ -177,10 +180,8 @@ private:
struct
{
struct
{
Uint32
*
m_buffer
;
// The buffer
Uint32
*
m_buffer
;
// The buffer
Uint32
m_dataSize
;
// No of words in buffer
Uint32
m_dataSize
;
// No of words in buffer
Uint32
m_
bufferSize
;
// Buffer size
Uint32
m_
sendBufferSize
;
// Buffer size
Uint32
m_forceSendLimit
;
// Send when buffer is this full
Uint32
m_forceSendLimit
;
// Send when buffer is this full
bool
full
()
const
{
return
(
m_dataSize
*
4
)
>
m_forceSendLimit
;}
}
m_sendBuffer
;
}
m_sendBuffer
;
SHM_Reader
*
reader
;
SHM_Reader
*
reader
;
...
@@ -196,7 +197,7 @@ private:
...
@@ -196,7 +197,7 @@ private:
Uint32
m_adapters
;
Uint32
m_adapters
;
Uint32
m_numberOfRemoteNodes
;
Uint32
m_numberOfRemoteNodes
;
Uint16
*
m_remoteNodes
;
Uint16
m_remoteNodes
[
2
]
;
typedef
struct
SciAdapter
{
typedef
struct
SciAdapter
{
sci_desc_t
scidesc
;
sci_desc_t
scidesc
;
...
@@ -296,12 +297,11 @@ private:
...
@@ -296,12 +297,11 @@ private:
*/
*/
bool
sendIsPossible
(
struct
timeval
*
timeout
);
bool
sendIsPossible
(
struct
timeval
*
timeout
);
void
getReceivePtr
(
Uint32
**
ptr
,
Uint32
**
eod
){
void
getReceivePtr
(
Uint32
**
ptr
,
Uint32
**
eod
){
reader
->
getReadPtr
(
*
ptr
,
*
eod
);
reader
->
getReadPtr
(
*
ptr
,
*
eod
);
}
}
void
updateReceivePtr
(
Uint32
*
ptr
){
void
updateReceivePtr
(
Uint32
*
ptr
){
reader
->
updateReadPtr
(
ptr
);
reader
->
updateReadPtr
(
ptr
);
}
}
...
@@ -341,6 +341,8 @@ private:
...
@@ -341,6 +341,8 @@ private:
*/
*/
void
failoverShmWriter
();
void
failoverShmWriter
();
bool
init_local
();
bool
init_remote
();
protected
:
protected
:
...
@@ -350,7 +352,8 @@ protected:
...
@@ -350,7 +352,8 @@ protected:
* retrying.
* retrying.
* @return Returns true on success, otherwize falser
* @return Returns true on success, otherwize falser
*/
*/
bool
connectImpl
(
Uint32
timeOutMillis
);
bool
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
);
bool
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
);
/**
/**
* We will disconnect if:
* We will disconnect if:
...
...
ndb/src/common/transporter/SHM_Buffer.hpp
View file @
f4721210
...
@@ -52,7 +52,7 @@ public:
...
@@ -52,7 +52,7 @@ public:
}
}
void
clear
()
{
void
clear
()
{
m_readIndex
=
*
m_sharedReadIndex
;
m_readIndex
=
0
;
}
}
/**
/**
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
/**
/**
* Update read ptr
* Update read ptr
*/
*/
inline
void
updateReadPtr
(
Uint32
*
readP
tr
);
inline
void
updateReadPtr
(
Uint32
*
p
tr
);
private:
private:
char
*
const
m_startOfBuffer
;
char
*
const
m_startOfBuffer
;
...
@@ -98,8 +98,8 @@ SHM_Reader::empty() const{
...
@@ -98,8 +98,8 @@ SHM_Reader::empty() const{
*/
*/
inline
inline
void
void
SHM_Reader
::
getReadPtr
(
Uint32
*
&
ptr
,
Uint32
*
&
eod
)
{
SHM_Reader
::
getReadPtr
(
Uint32
*
&
ptr
,
Uint32
*
&
eod
)
{
Uint32
tReadIndex
=
m_readIndex
;
Uint32
tReadIndex
=
m_readIndex
;
Uint32
tWriteIndex
=
*
m_sharedWriteIndex
;
Uint32
tWriteIndex
=
*
m_sharedWriteIndex
;
...
@@ -117,14 +117,14 @@ SHM_Reader::getReadPtr(Uint32 * & ptr, Uint32 * & eod){
...
@@ -117,14 +117,14 @@ SHM_Reader::getReadPtr(Uint32 * & ptr, Uint32 * & eod){
*/
*/
inline
inline
void
void
SHM_Reader
::
updateReadPtr
(
Uint32
*
ptr
){
SHM_Reader
::
updateReadPtr
(
Uint32
*
ptr
)
{
Uint32
tReadIndex
=
((
char
*
)
ptr
)
-
m_startOfBuffer
;
Uint32
tReadIndex
=
((
char
*
)
ptr
)
-
m_startOfBuffer
;
assert
(
tReadIndex
<
m_totalBufferSize
);
assert
(
tReadIndex
<
m_totalBufferSize
);
if
(
tReadIndex
>=
m_bufferSize
){
if
(
tReadIndex
>=
m_bufferSize
){
tReadIndex
=
0
;
//-= m_bufferSize;
tReadIndex
=
0
;
}
}
m_readIndex
=
tReadIndex
;
m_readIndex
=
tReadIndex
;
...
@@ -149,7 +149,7 @@ public:
...
@@ -149,7 +149,7 @@ public:
}
}
void
clear
()
{
void
clear
()
{
m_writeIndex
=
*
m_sharedWriteIndex
;
m_writeIndex
=
0
;
}
}
inline
char
*
getWritePtr
(
Uint32
sz
);
inline
char
*
getWritePtr
(
Uint32
sz
);
...
@@ -206,7 +206,7 @@ SHM_Writer::updateWritePtr(Uint32 sz){
...
@@ -206,7 +206,7 @@ SHM_Writer::updateWritePtr(Uint32 sz){
assert
(
tWriteIndex
<
m_totalBufferSize
);
assert
(
tWriteIndex
<
m_totalBufferSize
);
if
(
tWriteIndex
>=
m_bufferSize
){
if
(
tWriteIndex
>=
m_bufferSize
){
tWriteIndex
=
0
;
//-= m_bufferSize;
tWriteIndex
=
0
;
}
}
m_writeIndex
=
tWriteIndex
;
m_writeIndex
=
tWriteIndex
;
...
...
ndb/src/common/transporter/SHM_Transporter.cpp
View file @
f4721210
...
@@ -32,13 +32,12 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
...
@@ -32,13 +32,12 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
int
r_port
,
int
r_port
,
NodeId
lNodeId
,
NodeId
lNodeId
,
NodeId
rNodeId
,
NodeId
rNodeId
,
bool
compression
,
bool
checksum
,
bool
checksum
,
bool
signalId
,
bool
signalId
,
key_t
_shmKey
,
key_t
_shmKey
,
Uint32
_shmSize
)
:
Uint32
_shmSize
)
:
Transporter
(
t_reg
,
lHostName
,
rHostName
,
r_port
,
lNodeId
,
rNodeId
,
Transporter
(
t_reg
,
lHostName
,
rHostName
,
r_port
,
lNodeId
,
rNodeId
,
0
,
compression
,
checksum
,
signalId
),
0
,
false
,
checksum
,
signalId
),
shmKey
(
_shmKey
),
shmKey
(
_shmKey
),
shmSize
(
_shmSize
)
shmSize
(
_shmSize
)
{
{
...
@@ -92,8 +91,6 @@ SHM_Transporter::setupBuffers(){
...
@@ -92,8 +91,6 @@ SHM_Transporter::setupBuffers(){
clientStatusFlag
=
base2
+
4
;
clientStatusFlag
=
base2
+
4
;
char
*
startOfBuf2
=
((
char
*
)
base2
)
+
sharedSize
;
char
*
startOfBuf2
=
((
char
*
)
base2
)
+
sharedSize
;
*
sharedReadIndex2
=
*
sharedWriteIndex2
=
0
;
if
(
isServer
){
if
(
isServer
){
*
serverStatusFlag
=
0
;
*
serverStatusFlag
=
0
;
reader
=
new
SHM_Reader
(
startOfBuf1
,
reader
=
new
SHM_Reader
(
startOfBuf1
,
...
@@ -109,10 +106,10 @@ SHM_Transporter::setupBuffers(){
...
@@ -109,10 +106,10 @@ SHM_Transporter::setupBuffers(){
sharedWriteIndex2
);
sharedWriteIndex2
);
*
sharedReadIndex1
=
0
;
*
sharedReadIndex1
=
0
;
*
sharedWriteIndex
2
=
0
;
*
sharedWriteIndex
1
=
0
;
*
sharedReadIndex2
=
0
;
*
sharedReadIndex2
=
0
;
*
sharedWriteIndex
1
=
0
;
*
sharedWriteIndex
2
=
0
;
reader
->
clear
();
reader
->
clear
();
writer
->
clear
();
writer
->
clear
();
...
@@ -224,6 +221,7 @@ SHM_Transporter::prepareSend(const SignalHeader * const signalHeader,
...
@@ -224,6 +221,7 @@ SHM_Transporter::prepareSend(const SignalHeader * const signalHeader,
bool
bool
SHM_Transporter
::
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
)
SHM_Transporter
::
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
{
DBUG_ENTER
(
"SHM_Transporter::connect_server_impl"
);
SocketOutputStream
s_output
(
sockfd
);
SocketOutputStream
s_output
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
char
buf
[
256
];
char
buf
[
256
];
...
@@ -233,7 +231,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -233,7 +231,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
if
(
!
ndb_shm_create
())
{
if
(
!
ndb_shm_create
())
{
report_error
(
TE_SHM_UNABLE_TO_CREATE_SEGMENT
);
report_error
(
TE_SHM_UNABLE_TO_CREATE_SEGMENT
);
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_RETURN
(
false
)
;
}
}
_shmSegCreated
=
true
;
_shmSegCreated
=
true
;
}
}
...
@@ -243,7 +241,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -243,7 +241,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
if
(
!
ndb_shm_attach
())
{
if
(
!
ndb_shm_attach
())
{
report_error
(
TE_SHM_UNABLE_TO_ATTACH_SEGMENT
);
report_error
(
TE_SHM_UNABLE_TO_ATTACH_SEGMENT
);
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_RETURN
(
false
)
;
}
}
_attached
=
true
;
_attached
=
true
;
}
}
...
@@ -254,7 +252,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -254,7 +252,7 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
// Wait for ok from client
// Wait for ok from client
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_RETURN
(
false
)
;
}
}
int
r
=
connect_common
(
sockfd
);
int
r
=
connect_common
(
sockfd
);
...
@@ -265,17 +263,20 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -265,17 +263,20 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
// Wait for ok from client
// Wait for ok from client
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_RETURN
(
false
)
;
}
}
DBUG_PRINT
(
"info"
,
(
"Successfully connected server to node %d"
,
remoteNodeId
));
}
}
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
r
;
DBUG_RETURN
(
r
)
;
}
}
bool
bool
SHM_Transporter
::
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
)
SHM_Transporter
::
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
{
DBUG_ENTER
(
"SHM_Transporter::connect_client_impl"
);
SocketInputStream
s_input
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
SocketOutputStream
s_output
(
sockfd
);
SocketOutputStream
s_output
(
sockfd
);
char
buf
[
256
];
char
buf
[
256
];
...
@@ -283,14 +284,18 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -283,14 +284,18 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
// Wait for server to create and attach
// Wait for server to create and attach
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"Server id %d did not attach"
,
remoteNodeId
));
DBUG_RETURN
(
false
);
}
}
// Create
// Create
if
(
!
_shmSegCreated
){
if
(
!
_shmSegCreated
){
if
(
!
ndb_shm_get
())
{
if
(
!
ndb_shm_get
())
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"Failed create of shm seg to node %d"
,
remoteNodeId
));
DBUG_RETURN
(
false
);
}
}
_shmSegCreated
=
true
;
_shmSegCreated
=
true
;
}
}
...
@@ -300,7 +305,9 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -300,7 +305,9 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
if
(
!
ndb_shm_attach
())
{
if
(
!
ndb_shm_attach
())
{
report_error
(
TE_SHM_UNABLE_TO_ATTACH_SEGMENT
);
report_error
(
TE_SHM_UNABLE_TO_ATTACH_SEGMENT
);
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"Failed attach of shm seg to node %d"
,
remoteNodeId
));
DBUG_RETURN
(
false
);
}
}
_attached
=
true
;
_attached
=
true
;
}
}
...
@@ -314,21 +321,28 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
...
@@ -314,21 +321,28 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
// Wait for ok from server
// Wait for ok from server
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
false
;
DBUG_PRINT
(
"error"
,
(
"No ok from server node %d"
,
remoteNodeId
));
DBUG_RETURN
(
false
);
}
}
// Send ok to server
// Send ok to server
s_output
.
println
(
"shm client 2 ok"
);
s_output
.
println
(
"shm client 2 ok"
);
DBUG_PRINT
(
"info"
,
(
"Successfully connected client to node %d"
,
remoteNodeId
));
}
}
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
r
;
DBUG_RETURN
(
r
)
;
}
}
bool
bool
SHM_Transporter
::
connect_common
(
NDB_SOCKET_TYPE
sockfd
)
SHM_Transporter
::
connect_common
(
NDB_SOCKET_TYPE
sockfd
)
{
{
if
(
!
checkConnected
())
if
(
!
checkConnected
())
{
DBUG_PRINT
(
"error"
,
(
"Already connected to node %d"
,
remoteNodeId
));
return
false
;
return
false
;
}
if
(
!
setupBuffersDone
)
{
if
(
!
setupBuffersDone
)
{
setupBuffers
();
setupBuffers
();
...
@@ -341,5 +355,7 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
...
@@ -341,5 +355,7 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
return
true
;
return
true
;
}
}
DBUG_PRINT
(
"error"
,
(
"Failed to set up buffers to node %d"
,
remoteNodeId
));
return
false
;
return
false
;
}
}
ndb/src/common/transporter/SHM_Transporter.hpp
View file @
f4721210
...
@@ -38,7 +38,6 @@ public:
...
@@ -38,7 +38,6 @@ public:
int
r_port
,
int
r_port
,
NodeId
lNodeId
,
NodeId
lNodeId
,
NodeId
rNodeId
,
NodeId
rNodeId
,
bool
compression
,
bool
checksum
,
bool
checksum
,
bool
signalId
,
bool
signalId
,
key_t
shmKey
,
key_t
shmKey
,
...
@@ -127,6 +126,7 @@ protected:
...
@@ -127,6 +126,7 @@ protected:
private:
private:
bool
_shmSegCreated
;
bool
_shmSegCreated
;
bool
_attached
;
bool
_attached
;
bool
m_connected
;
key_t
shmKey
;
key_t
shmKey
;
volatile
Uint32
*
serverStatusFlag
;
volatile
Uint32
*
serverStatusFlag
;
...
...
ndb/src/common/transporter/TCP_Transporter.cpp
View file @
f4721210
...
@@ -70,11 +70,10 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg,
...
@@ -70,11 +70,10 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg,
int
r_port
,
int
r_port
,
NodeId
lNodeId
,
NodeId
lNodeId
,
NodeId
rNodeId
,
NodeId
rNodeId
,
int
byte_order
,
bool
chksm
,
bool
signalId
,
bool
compr
,
bool
chksm
,
bool
signalId
,
Uint32
_reportFreq
)
:
Uint32
_reportFreq
)
:
Transporter
(
t_reg
,
lHostName
,
rHostName
,
r_port
,
lNodeId
,
rNodeId
,
Transporter
(
t_reg
,
lHostName
,
rHostName
,
r_port
,
lNodeId
,
rNodeId
,
byte_order
,
compr
,
chksm
,
signalId
),
0
,
false
,
chksm
,
signalId
),
m_sendBuffer
(
sendBufSize
)
m_sendBuffer
(
sendBufSize
)
{
{
maxReceiveSize
=
maxRecvSize
;
maxReceiveSize
=
maxRecvSize
;
...
@@ -106,12 +105,14 @@ TCP_Transporter::~TCP_Transporter() {
...
@@ -106,12 +105,14 @@ TCP_Transporter::~TCP_Transporter() {
bool
TCP_Transporter
::
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
)
bool
TCP_Transporter
::
connect_server_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
{
return
connect_common
(
sockfd
);
DBUG_ENTER
(
"TCP_Transpporter::connect_server_impl"
);
DBUG_RETURN
(
connect_common
(
sockfd
));
}
}
bool
TCP_Transporter
::
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
)
bool
TCP_Transporter
::
connect_client_impl
(
NDB_SOCKET_TYPE
sockfd
)
{
{
return
connect_common
(
sockfd
);
DBUG_ENTER
(
"TCP_Transpporter::connect_client_impl"
);
DBUG_RETURN
(
connect_common
(
sockfd
));
}
}
bool
TCP_Transporter
::
connect_common
(
NDB_SOCKET_TYPE
sockfd
)
bool
TCP_Transporter
::
connect_common
(
NDB_SOCKET_TYPE
sockfd
)
...
@@ -119,6 +120,8 @@ bool TCP_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
...
@@ -119,6 +120,8 @@ bool TCP_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
theSocket
=
sockfd
;
theSocket
=
sockfd
;
setSocketOptions
();
setSocketOptions
();
setSocketNonBlocking
(
theSocket
);
setSocketNonBlocking
(
theSocket
);
DBUG_PRINT
(
"info"
,
(
"Successfully set-up TCP transporter to node %d"
,
remoteNodeId
));
return
true
;
return
true
;
}
}
...
...
ndb/src/common/transporter/TCP_Transporter.hpp
View file @
f4721210
...
@@ -52,8 +52,7 @@ private:
...
@@ -52,8 +52,7 @@ private:
int
r_port
,
int
r_port
,
NodeId
lHostId
,
NodeId
lHostId
,
NodeId
rHostId
,
NodeId
rHostId
,
int
byteorder
,
bool
checksum
,
bool
signalId
,
bool
compression
,
bool
checksum
,
bool
signalId
,
Uint32
reportFreq
=
4096
);
Uint32
reportFreq
=
4096
);
// Disconnect, delete send buffers and receive buffer
// Disconnect, delete send buffers and receive buffer
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
f4721210
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <ndb_global.h>
#include <my_pthread.h>
#include <TransporterRegistry.hpp>
#include <TransporterRegistry.hpp>
#include "TransporterInternalDefinitions.hpp"
#include "TransporterInternalDefinitions.hpp"
...
@@ -48,9 +49,10 @@
...
@@ -48,9 +49,10 @@
SocketServer
::
Session
*
TransporterService
::
newSession
(
NDB_SOCKET_TYPE
sockfd
)
SocketServer
::
Session
*
TransporterService
::
newSession
(
NDB_SOCKET_TYPE
sockfd
)
{
{
DBUG_ENTER
(
"SocketServer::Session * TransporterService::newSession"
);
if
(
m_auth
&&
!
m_auth
->
server_authenticate
(
sockfd
)){
if
(
m_auth
&&
!
m_auth
->
server_authenticate
(
sockfd
)){
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_RETURN
(
0
)
;
}
}
{
{
...
@@ -60,27 +62,32 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
...
@@ -60,27 +62,32 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
char
buf
[
256
];
char
buf
[
256
];
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
if
(
s_input
.
gets
(
buf
,
256
)
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_PRINT
(
"error"
,
(
"Could not get node id from client"
));
DBUG_RETURN
(
0
);
}
}
if
(
sscanf
(
buf
,
"%d"
,
&
nodeId
)
!=
1
)
{
if
(
sscanf
(
buf
,
"%d"
,
&
nodeId
)
!=
1
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_PRINT
(
"error"
,
(
"Error in node id from client"
));
DBUG_RETURN
(
0
);
}
}
//check that nodeid is valid and that there is an allocated transporter
//check that nodeid is valid and that there is an allocated transporter
if
(
nodeId
<
0
||
nodeId
>=
(
int
)
m_transporter_registry
->
maxTransporters
)
{
if
(
nodeId
<
0
||
nodeId
>=
(
int
)
m_transporter_registry
->
maxTransporters
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_PRINT
(
"error"
,
(
"Node id out of range from client"
));
DBUG_RETURN
(
0
);
}
}
if
(
m_transporter_registry
->
theTransporters
[
nodeId
]
==
0
)
{
if
(
m_transporter_registry
->
theTransporters
[
nodeId
]
==
0
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_PRINT
(
"error"
,
(
"No transporter for this node id from client"
));
DBUG_RETURN
(
0
);
}
}
//check that the transporter should be connected
//check that the transporter should be connected
if
(
m_transporter_registry
->
performStates
[
nodeId
]
!=
TransporterRegistry
::
CONNECTING
)
{
if
(
m_transporter_registry
->
performStates
[
nodeId
]
!=
TransporterRegistry
::
CONNECTING
)
{
NDB_CLOSE_SOCKET
(
sockfd
);
NDB_CLOSE_SOCKET
(
sockfd
);
return
0
;
DBUG_PRINT
(
"error"
,
(
"Transporter in wrong state for this node id from client"
));
DBUG_RETURN
(
0
);
}
}
Transporter
*
t
=
m_transporter_registry
->
theTransporters
[
nodeId
];
Transporter
*
t
=
m_transporter_registry
->
theTransporters
[
nodeId
];
...
@@ -93,13 +100,14 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
...
@@ -93,13 +100,14 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
t
->
connect_server
(
sockfd
);
t
->
connect_server
(
sockfd
);
}
}
return
0
;
DBUG_RETURN
(
0
)
;
}
}
TransporterRegistry
::
TransporterRegistry
(
void
*
callback
,
TransporterRegistry
::
TransporterRegistry
(
void
*
callback
,
unsigned
_maxTransporters
,
unsigned
_maxTransporters
,
unsigned
sizeOfLongSignalMemory
)
unsigned
sizeOfLongSignalMemory
)
{
{
m_transporter_service
=
0
;
nodeIdSpecified
=
false
;
nodeIdSpecified
=
false
;
maxTransporters
=
_maxTransporters
;
maxTransporters
=
_maxTransporters
;
sendCounter
=
1
;
sendCounter
=
1
;
...
@@ -149,6 +157,7 @@ TransporterRegistry::~TransporterRegistry() {
...
@@ -149,6 +157,7 @@ TransporterRegistry::~TransporterRegistry() {
delete
[]
theTransporters
;
delete
[]
theTransporters
;
delete
[]
performStates
;
delete
[]
performStates
;
delete
[]
ioStates
;
delete
[]
ioStates
;
#ifdef NDB_OSE_TRANSPORTER
#ifdef NDB_OSE_TRANSPORTER
if
(
theOSEReceiver
!=
NULL
){
if
(
theOSEReceiver
!=
NULL
){
theOSEReceiver
->
destroyPhantom
();
theOSEReceiver
->
destroyPhantom
();
...
@@ -207,8 +216,6 @@ TransporterRegistry::createTransporter(TCP_TransporterConfiguration *config) {
...
@@ -207,8 +216,6 @@ TransporterRegistry::createTransporter(TCP_TransporterConfiguration *config) {
config
->
port
,
config
->
port
,
localNodeId
,
localNodeId
,
config
->
remoteNodeId
,
config
->
remoteNodeId
,
config
->
byteOrder
,
config
->
compression
,
config
->
checksum
,
config
->
checksum
,
config
->
signalId
);
config
->
signalId
);
if
(
t
==
NULL
)
if
(
t
==
NULL
)
...
@@ -262,8 +269,6 @@ TransporterRegistry::createTransporter(OSE_TransporterConfiguration *conf) {
...
@@ -262,8 +269,6 @@ TransporterRegistry::createTransporter(OSE_TransporterConfiguration *conf) {
conf
->
localHostName
,
conf
->
localHostName
,
conf
->
remoteNodeId
,
conf
->
remoteNodeId
,
conf
->
remoteHostName
,
conf
->
remoteHostName
,
conf
->
byteOrder
,
conf
->
compression
,
conf
->
checksum
,
conf
->
checksum
,
conf
->
signalId
);
conf
->
signalId
);
if
(
t
==
NULL
)
if
(
t
==
NULL
)
...
@@ -304,15 +309,17 @@ TransporterRegistry::createTransporter(SCI_TransporterConfiguration *config) {
...
@@ -304,15 +309,17 @@ TransporterRegistry::createTransporter(SCI_TransporterConfiguration *config) {
if
(
theTransporters
[
config
->
remoteNodeId
]
!=
NULL
)
if
(
theTransporters
[
config
->
remoteNodeId
]
!=
NULL
)
return
false
;
return
false
;
SCI_Transporter
*
t
=
new
SCI_Transporter
(
config
->
sendLimit
,
SCI_Transporter
*
t
=
new
SCI_Transporter
(
*
this
,
config
->
localHostName
,
config
->
remoteHostName
,
config
->
port
,
config
->
sendLimit
,
config
->
bufferSize
,
config
->
bufferSize
,
config
->
nLocalAdapters
,
config
->
nLocalAdapters
,
config
->
remoteSciNodeId0
,
config
->
remoteSciNodeId0
,
config
->
remoteSciNodeId1
,
config
->
remoteSciNodeId1
,
localNodeId
,
localNodeId
,
config
->
remoteNodeId
,
config
->
remoteNodeId
,
config
->
byteOrder
,
config
->
compression
,
config
->
checksum
,
config
->
checksum
,
config
->
signalId
);
config
->
signalId
);
...
@@ -355,7 +362,6 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) {
...
@@ -355,7 +362,6 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) {
config
->
port
,
config
->
port
,
localNodeId
,
localNodeId
,
config
->
remoteNodeId
,
config
->
remoteNodeId
,
config
->
compression
,
config
->
checksum
,
config
->
checksum
,
config
->
signalId
,
config
->
signalId
,
config
->
shmKey
,
config
->
shmKey
,
...
@@ -853,8 +859,8 @@ TransporterRegistry::performReceive(){
...
@@ -853,8 +859,8 @@ TransporterRegistry::performReceive(){
if
(
t
->
isConnected
()
&&
t
->
checkConnected
()){
if
(
t
->
isConnected
()
&&
t
->
checkConnected
()){
Uint32
*
readPtr
,
*
eodPtr
;
Uint32
*
readPtr
,
*
eodPtr
;
t
->
getReceivePtr
(
&
readPtr
,
&
eodPtr
);
t
->
getReceivePtr
(
&
readPtr
,
&
eodPtr
);
read
Ptr
=
unpack
(
readPtr
,
eodPtr
,
nodeId
,
ioStates
[
nodeId
]);
Uint32
*
new
Ptr
=
unpack
(
readPtr
,
eodPtr
,
nodeId
,
ioStates
[
nodeId
]);
t
->
updateReceivePtr
(
read
Ptr
);
t
->
updateReceivePtr
(
new
Ptr
);
}
}
}
}
}
}
...
@@ -868,8 +874,8 @@ TransporterRegistry::performReceive(){
...
@@ -868,8 +874,8 @@ TransporterRegistry::performReceive(){
if
(
t
->
isConnected
()
&&
t
->
checkConnected
()){
if
(
t
->
isConnected
()
&&
t
->
checkConnected
()){
Uint32
*
readPtr
,
*
eodPtr
;
Uint32
*
readPtr
,
*
eodPtr
;
t
->
getReceivePtr
(
&
readPtr
,
&
eodPtr
);
t
->
getReceivePtr
(
&
readPtr
,
&
eodPtr
);
read
Ptr
=
unpack
(
readPtr
,
eodPtr
,
nodeId
,
ioStates
[
nodeId
]);
Uint32
*
new
Ptr
=
unpack
(
readPtr
,
eodPtr
,
nodeId
,
ioStates
[
nodeId
]);
t
->
updateReceivePtr
(
read
Ptr
);
t
->
updateReceivePtr
(
new
Ptr
);
}
}
}
}
}
}
...
@@ -1021,7 +1027,9 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) {
...
@@ -1021,7 +1027,9 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) {
static
void
*
static
void
*
run_start_clients_C
(
void
*
me
)
run_start_clients_C
(
void
*
me
)
{
{
my_thread_init
();
((
TransporterRegistry
*
)
me
)
->
start_clients_thread
();
((
TransporterRegistry
*
)
me
)
->
start_clients_thread
();
my_thread_end
();
NdbThread_Exit
(
0
);
NdbThread_Exit
(
0
);
return
me
;
return
me
;
}
}
...
@@ -1104,6 +1112,7 @@ TransporterRegistry::update_connections()
...
@@ -1104,6 +1112,7 @@ TransporterRegistry::update_connections()
void
void
TransporterRegistry
::
start_clients_thread
()
TransporterRegistry
::
start_clients_thread
()
{
{
DBUG_ENTER
(
"TransporterRegistry::start_clients_thread"
);
while
(
m_run_start_clients_thread
)
{
while
(
m_run_start_clients_thread
)
{
NdbSleep_MilliSleep
(
100
);
NdbSleep_MilliSleep
(
100
);
for
(
int
i
=
0
,
n
=
0
;
n
<
nTransporters
&&
m_run_start_clients_thread
;
i
++
){
for
(
int
i
=
0
,
n
=
0
;
n
<
nTransporters
&&
m_run_start_clients_thread
;
i
++
){
...
@@ -1127,6 +1136,7 @@ TransporterRegistry::start_clients_thread()
...
@@ -1127,6 +1136,7 @@ TransporterRegistry::start_clients_thread()
}
}
}
}
}
}
DBUG_VOID_RETURN
;
}
}
bool
bool
...
...
ndb/src/cw/cpcd/Makefile.am
View file @
f4721210
...
@@ -7,7 +7,7 @@ LDADD_LOC = \
...
@@ -7,7 +7,7 @@ LDADD_LOC = \
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
$(top_builddir)
/strings/libmystrings.a
@NDB_SCI_LIBS@
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_util.mk.am
include
$(top_srcdir)/ndb/config/type_util.mk.am
...
...
ndb/src/kernel/Makefile.am
View file @
f4721210
...
@@ -55,7 +55,7 @@ LDADD += \
...
@@ -55,7 +55,7 @@ LDADD += \
$(top_builddir)
/ndb/src/common/util/libgeneral.la
\
$(top_builddir)
/ndb/src/common/util/libgeneral.la
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
$(top_builddir)
/strings/libmystrings.a
@NDB_SCI_LIBS@
# Don't update the files from bitkeeper
# Don't update the files from bitkeeper
%
::
SCCS/s.%
%
::
SCCS/s.%
ndb/src/kernel/blocks/backup/restore/Makefile.am
View file @
f4721210
...
@@ -7,7 +7,7 @@ LDADD_LOC = \
...
@@ -7,7 +7,7 @@ LDADD_LOC = \
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
$(top_builddir)
/strings/libmystrings.a
@NDB_SCI_LIBS@
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/common.mk.am
...
...
ndb/src/kernel/vm/FastScheduler.hpp
View file @
f4721210
...
@@ -141,7 +141,7 @@ int
...
@@ -141,7 +141,7 @@ int
FastScheduler
::
checkDoJob
()
FastScheduler
::
checkDoJob
()
{
{
/*
/*
* Jo
o
b buffer overload protetction
* Job buffer overload protetction
* If the job buffer B is filled over a certain limit start
* If the job buffer B is filled over a certain limit start
* to execute the signals in the job buffer's
* to execute the signals in the job buffer's
*/
*/
...
...
ndb/src/mgmclient/Makefile.am
View file @
f4721210
...
@@ -16,7 +16,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
...
@@ -16,7 +16,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
\
$(top_builddir)
/strings/libmystrings.a
\
@TERMCAP_LIB@
@TERMCAP_LIB@
@NDB_SCI_LIBS@
ndb_mgm_LDFLAGS
=
@ndb_bin_am_ldflags@
ndb_mgm_LDFLAGS
=
@ndb_bin_am_ldflags@
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
f4721210
...
@@ -129,11 +129,14 @@ ConfigInfo::m_SectionRules[] = {
...
@@ -129,11 +129,14 @@ ConfigInfo::m_SectionRules[] = {
{
"TCP"
,
fixHostname
,
"HostName1"
},
{
"TCP"
,
fixHostname
,
"HostName1"
},
{
"TCP"
,
fixHostname
,
"HostName2"
},
{
"TCP"
,
fixHostname
,
"HostName2"
},
{
"SCI"
,
fixHostname
,
"HostName1"
},
{
"SCI"
,
fixHostname
,
"HostName2"
},
{
"OSE"
,
fixHostname
,
"HostName1"
},
{
"OSE"
,
fixHostname
,
"HostName1"
},
{
"OSE"
,
fixHostname
,
"HostName2"
},
{
"OSE"
,
fixHostname
,
"HostName2"
},
{
"TCP"
,
fixPortNumber
,
0
},
// has to come after fixHostName
{
"TCP"
,
fixPortNumber
,
0
},
// has to come after fixHostName
{
"SHM"
,
fixPortNumber
,
0
},
// has to come after fixHostName
{
"SHM"
,
fixPortNumber
,
0
},
// has to come after fixHostName
{
"SCI"
,
fixPortNumber
,
0
},
// has to come after fixHostName
//{ "SHM", fixShmKey, 0 },
//{ "SHM", fixShmKey, 0 },
/**
/**
...
@@ -163,6 +166,8 @@ ConfigInfo::m_SectionRules[] = {
...
@@ -163,6 +166,8 @@ ConfigInfo::m_SectionRules[] = {
{
"TCP"
,
checkTCPConstraints
,
"HostName1"
},
{
"TCP"
,
checkTCPConstraints
,
"HostName1"
},
{
"TCP"
,
checkTCPConstraints
,
"HostName2"
},
{
"TCP"
,
checkTCPConstraints
,
"HostName2"
},
{
"SCI"
,
checkTCPConstraints
,
"HostName1"
},
{
"SCI"
,
checkTCPConstraints
,
"HostName2"
},
{
"*"
,
checkMandatory
,
0
},
{
"*"
,
checkMandatory
,
0
},
...
@@ -1808,7 +1813,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1808,7 +1813,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id of node ("
DB_TOKEN_PRINT
", "
API_TOKEN_PRINT
" or "
MGM_TOKEN_PRINT
") on one side of the connection"
,
"Id of node ("
DB_TOKEN_PRINT
", "
API_TOKEN_PRINT
" or "
MGM_TOKEN_PRINT
") on one side of the connection"
,
ConfigInfo
::
USED
,
ConfigInfo
::
USED
,
false
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
STRING
,
MANDATORY
,
MANDATORY
,
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
...
@@ -1820,16 +1825,50 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1820,16 +1825,50 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"Id of node ("
DB_TOKEN_PRINT
", "
API_TOKEN_PRINT
" or "
MGM_TOKEN_PRINT
") on one side of the connection"
,
"Id of node ("
DB_TOKEN_PRINT
", "
API_TOKEN_PRINT
" or "
MGM_TOKEN_PRINT
") on one side of the connection"
,
ConfigInfo
::
USED
,
ConfigInfo
::
USED
,
false
,
false
,
ConfigInfo
::
STRING
,
MANDATORY
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
CFG_SCI_HOSTNAME_1
,
"HostName1"
,
"SCI"
,
"Name/IP of computer on one side of the connection"
,
ConfigInfo
::
INTERNAL
,
false
,
ConfigInfo
::
STRING
,
UNDEFINED
,
0
,
0
},
{
CFG_SCI_HOSTNAME_2
,
"HostName2"
,
"SCI"
,
"Name/IP of computer on one side of the connection"
,
ConfigInfo
::
INTERNAL
,
false
,
ConfigInfo
::
STRING
,
UNDEFINED
,
0
,
0
},
{
CFG_CONNECTION_SERVER_PORT
,
"PortNumber"
,
"SCI"
,
"Port used for this transporter"
,
ConfigInfo
::
USED
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
INT
,
MANDATORY
,
MANDATORY
,
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
{
{
CFG_SCI_ID_0
,
CFG_SCI_
HOST1_
ID_0
,
"SciId0"
,
"
Host1
SciId0"
,
"SCI"
,
"SCI"
,
"
Local SCI-node id for adapter 0
(a computer can have two adapters)"
,
"
SCI-node id for adapter 0 on Host1
(a computer can have two adapters)"
,
ConfigInfo
::
USED
,
ConfigInfo
::
USED
,
false
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
INT
,
...
@@ -1838,10 +1877,22 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1838,10 +1877,22 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
{
{
CFG_SCI_ID_1
,
CFG_SCI_HOST1_ID_1
,
"SciId1"
,
"Host1SciId1"
,
"SCI"
,
"SCI-node id for adapter 1 on Host1 (a computer can have two adapters)"
,
ConfigInfo
::
USED
,
false
,
ConfigInfo
::
INT
,
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
CFG_SCI_HOST2_ID_0
,
"Host2SciId0"
,
"SCI"
,
"SCI"
,
"
Local SCI-node id for adapter 1
(a computer can have two adapters)"
,
"
SCI-node id for adapter 0 on Host2
(a computer can have two adapters)"
,
ConfigInfo
::
USED
,
ConfigInfo
::
USED
,
false
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
INT
,
...
@@ -1849,6 +1900,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1849,6 +1900,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
{
CFG_SCI_HOST2_ID_1
,
"Host2SciId1"
,
"SCI"
,
"SCI-node id for adapter 1 on Host2 (a computer can have two adapters)"
,
ConfigInfo
::
USED
,
false
,
ConfigInfo
::
INT
,
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
{
CFG_CONNECTION_SEND_SIGNAL_ID
,
CFG_CONNECTION_SEND_SIGNAL_ID
,
"SendSignalId"
,
"SendSignalId"
,
...
@@ -1881,9 +1944,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1881,9 +1944,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo
::
USED
,
ConfigInfo
::
USED
,
false
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
INT
,
"
2
K"
,
"
8
K"
,
"
512
"
,
"
128
"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
"32K"
},
{
{
CFG_SCI_BUFFER_MEM
,
CFG_SCI_BUFFER_MEM
,
...
@@ -1894,7 +1957,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
...
@@ -1894,7 +1957,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
false
,
ConfigInfo
::
INT
,
ConfigInfo
::
INT
,
"1M"
,
"1M"
,
"
256
K"
,
"
64
K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
STR_VALUE
(
MAX_INT_RNIL
)
},
{
{
...
...
ndb/src/mgmsrv/Makefile.am
View file @
f4721210
...
@@ -27,7 +27,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
...
@@ -27,7 +27,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)
/ndb/src/common/editline/libeditline.a
\
$(top_builddir)
/ndb/src/common/editline/libeditline.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
$(top_builddir)
/strings/libmystrings.a
@NDB_SCI_LIBS@
@TERMCAP_LIB@
@TERMCAP_LIB@
DEFS_LOC
=
-DDEFAULT_MYSQL_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
DEFS_LOC
=
-DDEFAULT_MYSQL_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
...
...
ndb/test/run-test/Makefile.am
View file @
f4721210
...
@@ -16,7 +16,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \
...
@@ -16,7 +16,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/ndb/src/libndbclient.la
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/strings/libmystrings.a
$(top_builddir)
/strings/libmystrings.a
@NDB_SCI_LIBS@
wrappersdir
=
$(prefix)
/bin
wrappersdir
=
$(prefix)
/bin
wrappers_SCRIPTS
=
atrt-testBackup atrt-mysql-test-run
wrappers_SCRIPTS
=
atrt-testBackup atrt-mysql-test-run
...
...
sql/Makefile.am
View file @
f4721210
...
@@ -37,7 +37,7 @@ LDADD = @isam_libs@ \
...
@@ -37,7 +37,7 @@ LDADD = @isam_libs@ \
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/regex/libregex.a
\
$(top_builddir)
/regex/libregex.a
\
$(top_builddir)
/strings/libmystrings.a @ZLIB_LIBS@
$(top_builddir)
/strings/libmystrings.a @ZLIB_LIBS@
@NDB_SCI_LIBS@
mysqld_LDADD
=
@MYSQLD_EXTRA_LDFLAGS@
\
mysqld_LDADD
=
@MYSQLD_EXTRA_LDFLAGS@
\
@bdb_libs@ @innodb_libs@ @pstack_libs@
\
@bdb_libs@ @innodb_libs@ @pstack_libs@
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment