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
c62cf518
Commit
c62cf518
authored
May 16, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
parents
ce7a7b20
976deafb
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
218 additions
and
16 deletions
+218
-16
mysql-test/r/ndb_autodiscover3.result
mysql-test/r/ndb_autodiscover3.result
+45
-0
mysql-test/t/ndb_autodiscover3.test
mysql-test/t/ndb_autodiscover3.test
+65
-0
ndb/include/mgmapi/mgmapi_config_parameters.h
ndb/include/mgmapi/mgmapi_config_parameters.h
+1
-0
ndb/include/ndbapi/ndb_cluster_connection.hpp
ndb/include/ndbapi/ndb_cluster_connection.hpp
+1
-0
ndb/include/util/SocketServer.hpp
ndb/include/util/SocketServer.hpp
+1
-1
ndb/src/common/transporter/Transporter.cpp
ndb/src/common/transporter/Transporter.cpp
+6
-6
ndb/src/common/util/SocketServer.cpp
ndb/src/common/util/SocketServer.cpp
+2
-2
ndb/src/kernel/blocks/backup/BackupInit.cpp
ndb/src/kernel/blocks/backup/BackupInit.cpp
+3
-2
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+13
-1
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+1
-0
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+3
-3
ndb/src/ndbapi/ClusterMgr.cpp
ndb/src/ndbapi/ClusterMgr.cpp
+5
-0
ndb/src/ndbapi/ClusterMgr.hpp
ndb/src/ndbapi/ClusterMgr.hpp
+1
-0
ndb/src/ndbapi/DictCache.cpp
ndb/src/ndbapi/DictCache.cpp
+36
-0
ndb/src/ndbapi/DictCache.hpp
ndb/src/ndbapi/DictCache.hpp
+3
-0
ndb/src/ndbapi/SignalSender.cpp
ndb/src/ndbapi/SignalSender.cpp
+2
-0
ndb/src/ndbapi/TransporterFacade.hpp
ndb/src/ndbapi/TransporterFacade.hpp
+6
-0
ndb/src/ndbapi/ndb_cluster_connection.cpp
ndb/src/ndbapi/ndb_cluster_connection.cpp
+6
-0
ndb/src/ndbapi/ndb_cluster_connection_impl.hpp
ndb/src/ndbapi/ndb_cluster_connection_impl.hpp
+1
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+16
-1
support-files/mysql.spec.sh
support-files/mysql.spec.sh
+1
-0
No files found.
mysql-test/r/ndb_autodiscover3.result
0 → 100644
View file @
c62cf518
drop table if exists t1, t2;
create table t1 (a int key) engine=ndbcluster;
begin;
insert into t1 values (1);
insert into t1 values (2);
ERROR HY000: Got temporary error 4025 'Node failure caused abort of transaction' from ndbcluster
commit;
ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster
drop table t1;
create table t2 (a int, b int, primary key(a,b)) engine=ndbcluster;
insert into t2 values (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1);
select * from t2 order by a limit 3;
a b
1 1
2 1
3 1
create table t2 (a int key) engine=ndbcluster;
insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
select * from t2 order by a limit 3;
a
1
2
3
select * from t2 order by a limit 3;
ERROR HY000: Can't lock file (errno: 241)
select * from t2 order by a limit 3;
a
1
2
3
show tables;
Tables_in_test
create table t2 (a int key) engine=ndbcluster;
insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
select * from t2 order by a limit 3;
a
1
2
3
select * from t2 order by a limit 3;
a
1
2
3
drop table t2;
mysql-test/t/ndb_autodiscover3.test
0 → 100644
View file @
c62cf518
--
source
include
/
have_ndb
.
inc
--
source
include
/
have_multi_ndb
.
inc
--
source
include
/
not_embedded
.
inc
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
#
# Transaction ongoing while cluster is restarted
#
--
connection
server1
create
table
t1
(
a
int
key
)
engine
=
ndbcluster
;
begin
;
insert
into
t1
values
(
1
);
--
exec
$NDB_MGM
--
no
-
defaults
-
e
"all restart"
>>
$NDB_TOOLS_OUTPUT
--
exec
$NDB_TOOLS_DIR
/
ndb_waiter
--
no
-
defaults
>>
$NDB_TOOLS_OUTPUT
--
error
1297
insert
into
t1
values
(
2
);
--
error
1296
commit
;
drop
table
t1
;
#
# Stale cache after restart -i
#
--
connection
server1
create
table
t2
(
a
int
,
b
int
,
primary
key
(
a
,
b
))
engine
=
ndbcluster
;
insert
into
t2
values
(
1
,
1
),(
2
,
1
),(
3
,
1
),(
4
,
1
),(
5
,
1
),(
6
,
1
),(
7
,
1
),(
8
,
1
),(
9
,
1
),(
10
,
1
);
select
*
from
t2
order
by
a
limit
3
;
--
exec
$NDB_MGM
--
no
-
defaults
-
e
"all restart -i"
>>
$NDB_TOOLS_OUTPUT
--
exec
$NDB_TOOLS_DIR
/
ndb_waiter
--
no
-
defaults
>>
$NDB_TOOLS_OUTPUT
--
connection
server2
create
table
t2
(
a
int
key
)
engine
=
ndbcluster
;
insert
into
t2
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
),(
10
);
select
*
from
t2
order
by
a
limit
3
;
# server 1 should have a stale cache, and in this case wrong frm, transaction must be retried
--
connection
server1
--
error
1015
select
*
from
t2
order
by
a
limit
3
;
select
*
from
t2
order
by
a
limit
3
;
--
exec
$NDB_MGM
--
no
-
defaults
-
e
"all restart -i"
>>
$NDB_TOOLS_OUTPUT
--
exec
$NDB_TOOLS_DIR
/
ndb_waiter
--
no
-
defaults
>>
$NDB_TOOLS_OUTPUT
--
connection
server1
show
tables
;
create
table
t2
(
a
int
key
)
engine
=
ndbcluster
;
insert
into
t2
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
),(
10
);
select
*
from
t2
order
by
a
limit
3
;
# server 2 should have a stale cache, but with right frm, transaction need not be retried
--
connection
server2
select
*
from
t2
order
by
a
limit
3
;
drop
table
t2
;
# End of 4.1 tests
ndb/include/mgmapi/mgmapi_config_parameters.h
View file @
c62cf518
...
...
@@ -65,6 +65,7 @@
#define CFG_DB_BACKUP_DATA_BUFFER_MEM 134
#define CFG_DB_BACKUP_LOG_BUFFER_MEM 135
#define CFG_DB_BACKUP_WRITE_SIZE 136
#define CFG_DB_BACKUP_MAX_WRITE_SIZE 139
#define CFG_LOG_DESTINATION 147
...
...
ndb/include/ndbapi/ndb_cluster_connection.hpp
View file @
c62cf518
...
...
@@ -83,6 +83,7 @@ public:
void
set_optimized_node_selection
(
int
val
);
unsigned
no_db_nodes
();
unsigned
get_connect_count
()
const
;
#endif
private:
...
...
ndb/include/util/SocketServer.hpp
View file @
c62cf518
...
...
@@ -74,7 +74,7 @@ public:
/**
* Constructor / Destructor
*/
SocketServer
(
int
maxSessions
=
32
);
SocketServer
(
unsigned
maxSessions
=
~
(
unsigned
)
0
);
~
SocketServer
();
/**
...
...
ndb/src/common/transporter/Transporter.cpp
View file @
c62cf518
...
...
@@ -100,10 +100,10 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) {
}
{
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
sockfd
,
&
addr
,
&
addrlen
);
m_connect_address
=
(
(
struct
sockaddr_in
*
)
&
addr
)
->
sin_addr
;
int
r
=
getpeername
(
sockfd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
m_connect_address
=
(
&
addr
)
->
sin_addr
;
}
bool
res
=
connect_server_impl
(
sockfd
);
...
...
@@ -173,10 +173,10 @@ Transporter::connect_client() {
}
{
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
sockfd
,
&
addr
,
&
addrlen
);
m_connect_address
=
(
(
struct
sockaddr_in
*
)
&
addr
)
->
sin_addr
;
int
r
=
getpeername
(
sockfd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
m_connect_address
=
(
&
addr
)
->
sin_addr
;
}
bool
res
=
connect_client_impl
(
sockfd
);
...
...
ndb/src/common/util/SocketServer.cpp
View file @
c62cf518
...
...
@@ -27,7 +27,7 @@
#define DEBUG(x) ndbout << x << endl;
SocketServer
::
SocketServer
(
int
maxSessions
)
:
SocketServer
::
SocketServer
(
unsigned
maxSessions
)
:
m_sessions
(
10
),
m_services
(
5
)
{
...
...
@@ -124,7 +124,7 @@ SocketServer::setup(SocketServer::Service * service,
DBUG_RETURN
(
false
);
}
if
(
listen
(
sock
,
m_maxSessions
)
==
-
1
){
if
(
listen
(
sock
,
m_maxSessions
>
32
?
32
:
m_maxSessions
)
==
-
1
){
DBUG_PRINT
(
"error"
,(
"listen() - %d - %s"
,
errno
,
strerror
(
errno
)));
NDB_CLOSE_SOCKET
(
sock
);
...
...
ndb/src/kernel/blocks/backup/BackupInit.cpp
View file @
c62cf518
...
...
@@ -66,15 +66,16 @@ Backup::Backup(const Configuration & conf) :
Uint32
szDataBuf
=
(
2
*
1024
*
1024
);
Uint32
szLogBuf
=
(
2
*
1024
*
1024
);
Uint32
szWrite
=
32768
;
Uint32
szWrite
=
32768
,
maxWriteSize
=
(
256
*
1024
)
;
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_BACKUP_DATA_BUFFER_MEM
,
&
szDataBuf
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_BACKUP_LOG_BUFFER_MEM
,
&
szLogBuf
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_BACKUP_WRITE_SIZE
,
&
szWrite
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_BACKUP_MAX_WRITE_SIZE
,
&
maxWriteSize
);
c_defaults
.
m_logBufferSize
=
szLogBuf
;
c_defaults
.
m_dataBufferSize
=
szDataBuf
;
c_defaults
.
m_minWriteSize
=
szWrite
;
c_defaults
.
m_maxWriteSize
=
szWrit
e
;
c_defaults
.
m_maxWriteSize
=
maxWriteSiz
e
;
{
// Init all tables
ArrayList
<
Table
>
tables
(
c_tablePool
);
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
c62cf518
...
...
@@ -1191,7 +1191,19 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
ConfigInfo
::
CI_INT
,
"32K"
,
"0"
,
"2K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
CFG_DB_BACKUP_MAX_WRITE_SIZE
,
"BackupMaxWriteSize"
,
DB_TOKEN
,
"Max size of filesystem writes made by backup (in bytes)"
,
ConfigInfo
::
CI_USED
,
false
,
ConfigInfo
::
CI_INT
,
"256K"
,
"2K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
/***************************************************************************
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
c62cf518
...
...
@@ -2107,6 +2107,7 @@ int
MgmtSrvr
::
abortBackup
(
Uint32
backupId
)
{
SignalSender
ss
(
theFacade
);
ss
.
lock
();
// lock will be released on exit
bool
next
;
NodeId
nodeId
=
0
;
...
...
ndb/src/mgmsrv/Services.cpp
View file @
c62cf518
...
...
@@ -427,9 +427,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
return
;
}
struct
sockaddr
addr
;
struct
sockaddr
_in
addr
;
SOCKET_SIZE_TYPE
addrlen
=
sizeof
(
addr
);
int
r
=
getpeername
(
m_socket
,
&
addr
,
&
addrlen
);
int
r
=
getpeername
(
m_socket
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
if
(
r
!=
0
)
{
m_output
->
println
(
cmd
);
m_output
->
println
(
"result: getpeername(%d) failed, err= %d"
,
m_socket
,
r
);
...
...
@@ -441,7 +441,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
if
(
tmp
==
0
||
!
m_allocated_resources
->
is_reserved
(
tmp
)){
BaseString
error_string
;
if
(
!
m_mgmsrv
.
alloc_node_id
(
&
tmp
,
(
enum
ndb_mgm_node_type
)
nodetype
,
&
addr
,
&
addrlen
,
error_string
)){
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
,
error_string
)){
const
char
*
alias
;
const
char
*
str
;
alias
=
ndb_mgm_get_node_type_alias_string
((
enum
ndb_mgm_node_type
)
...
...
ndb/src/ndbapi/ClusterMgr.cpp
View file @
c62cf518
...
...
@@ -70,6 +70,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade):
noOfAliveNodes
=
0
;
noOfConnectedNodes
=
0
;
theClusterMgrThread
=
0
;
m_connect_count
=
0
;
DBUG_VOID_RETURN
;
}
...
...
@@ -456,6 +457,10 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){
theNode
.
nfCompleteRep
=
false
;
if
(
noOfAliveNodes
==
0
){
theFacade
.
m_globalDictCache
.
lock
();
theFacade
.
m_globalDictCache
.
invalidate_all
();
theFacade
.
m_globalDictCache
.
unlock
();
m_connect_count
++
;
NFCompleteRep
rep
;
for
(
Uint32
i
=
1
;
i
<
MAX_NODES
;
i
++
){
if
(
theNodes
[
i
].
defined
&&
theNodes
[
i
].
nfCompleteRep
==
false
){
...
...
ndb/src/ndbapi/ClusterMgr.hpp
View file @
c62cf518
...
...
@@ -78,6 +78,7 @@ public:
const
Node
&
getNodeInfo
(
NodeId
)
const
;
Uint32
getNoOfConnectedNodes
()
const
;
Uint32
m_connect_count
;
private:
Uint32
noOfAliveNodes
;
...
...
ndb/src/ndbapi/DictCache.cpp
View file @
c62cf518
...
...
@@ -255,6 +255,42 @@ GlobalDictCache::drop(NdbTableImpl * tab)
abort
();
}
unsigned
GlobalDictCache
::
get_size
()
{
NdbElement_t
<
Vector
<
TableVersion
>
>
*
curr
=
m_tableHash
.
getNext
(
0
);
int
sz
=
0
;
while
(
curr
!=
0
){
sz
+=
curr
->
theData
->
size
();
curr
=
m_tableHash
.
getNext
(
curr
);
}
return
sz
;
}
void
GlobalDictCache
::
invalidate_all
()
{
DBUG_ENTER
(
"GlobalDictCache::invalidate_all"
);
NdbElement_t
<
Vector
<
TableVersion
>
>
*
curr
=
m_tableHash
.
getNext
(
0
);
while
(
curr
!=
0
){
Vector
<
TableVersion
>
*
vers
=
curr
->
theData
;
if
(
vers
->
size
())
{
TableVersion
*
ver
=
&
vers
->
back
();
ver
->
m_impl
->
m_status
=
NdbDictionary
::
Object
::
Invalid
;
ver
->
m_status
=
DROPPED
;
if
(
ver
->
m_refCount
==
0
)
{
delete
ver
->
m_impl
;
vers
->
erase
(
vers
->
size
()
-
1
);
}
}
curr
=
m_tableHash
.
getNext
(
curr
);
}
DBUG_VOID_RETURN
;
}
void
GlobalDictCache
::
release
(
NdbTableImpl
*
tab
){
unsigned
i
;
...
...
ndb/src/ndbapi/DictCache.hpp
View file @
c62cf518
...
...
@@ -71,6 +71,9 @@ public:
void
alter_table_rep
(
const
char
*
name
,
Uint32
tableId
,
Uint32
tableVersion
,
bool
altered
);
unsigned
get_size
();
void
invalidate_all
();
public:
enum
Status
{
OK
=
0
,
...
...
ndb/src/ndbapi/SignalSender.cpp
View file @
c62cf518
...
...
@@ -75,7 +75,9 @@ SignalSender::SignalSender(TransporterFacade *facade)
{
m_cond
=
NdbCondition_Create
();
theFacade
=
facade
;
lock
();
m_blockNo
=
theFacade
->
open
(
this
,
execSignal
,
execNodeStatus
);
unlock
();
assert
(
m_blockNo
>
0
);
}
...
...
ndb/src/ndbapi/TransporterFacade.hpp
View file @
c62cf518
...
...
@@ -264,6 +264,12 @@ TransporterFacade::unlock_mutex()
#include "ClusterMgr.hpp"
inline
unsigned
Ndb_cluster_connection_impl
::
get_connect_count
()
const
{
return
TransporterFacade
::
instance
()
->
theClusterMgr
->
m_connect_count
;
}
inline
bool
TransporterFacade
::
check_send_size
(
Uint32
node_id
,
Uint32
send_size
)
...
...
ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
c62cf518
...
...
@@ -236,6 +236,12 @@ Ndb_cluster_connection::wait_until_ready(int timeout,
}
while
(
1
);
}
unsigned
Ndb_cluster_connection
::
get_connect_count
()
const
{
return
m_impl
.
get_connect_count
();
}
/*
...
...
ndb/src/ndbapi/ndb_cluster_connection_impl.hpp
View file @
c62cf518
...
...
@@ -49,6 +49,7 @@ class Ndb_cluster_connection_impl : public Ndb_cluster_connection
void
init_get_next_node
(
Ndb_cluster_connection_node_iter
&
iter
);
Uint32
get_next_node
(
Ndb_cluster_connection_node_iter
&
iter
);
inline
unsigned
get_connect_count
()
const
;
private:
friend
class
Ndb
;
friend
class
NdbImpl
;
...
...
sql/ha_ndbcluster.cc
View file @
c62cf518
...
...
@@ -3306,8 +3306,23 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
{
m_table
=
(
void
*
)
tab
;
m_table_version
=
tab
->
getObjectVersion
();
if
(
!
(
my_errno
=
build_index_list
(
ndb
,
table
,
ILBP_OPEN
)))
if
((
my_errno
=
build_index_list
(
ndb
,
table
,
ILBP_OPEN
)))
DBUG_RETURN
(
my_errno
);
const
void
*
data
,
*
pack_data
;
uint
length
,
pack_length
;
if
(
readfrm
(
table
->
path
,
&
data
,
&
length
)
||
packfrm
(
data
,
length
,
&
pack_data
,
&
pack_length
)
||
pack_length
!=
tab
->
getFrmLength
()
||
memcmp
(
pack_data
,
tab
->
getFrmData
(),
pack_length
))
{
my_free
((
char
*
)
data
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
((
char
*
)
pack_data
,
MYF
(
MY_ALLOW_ZERO_PTR
));
NdbError
err
=
ndb
->
getNdbError
(
NDB_INVALID_SCHEMA_OBJECT
);
DBUG_RETURN
(
ndb_to_mysql_error
(
&
err
));
}
my_free
((
char
*
)
data
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
((
char
*
)
pack_data
,
MYF
(
MY_ALLOW_ZERO_PTR
));
}
m_table_info
=
tab_info
;
}
...
...
support-files/mysql.spec.sh
View file @
c62cf518
...
...
@@ -644,6 +644,7 @@ fi
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_desc
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_show_tables
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_test_platform
%attr
(
755, root, root
)
%
{
_bindir
}
/ndb_config
%files ndb-extra
%defattr
(
-,root,root,0755
)
...
...
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