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
9f053d64
Commit
9f053d64
authored
Aug 15, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#4970
parent
39d07e4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
ndb/src/common/mgmcommon/ConfigInfo.cpp
ndb/src/common/mgmcommon/ConfigInfo.cpp
+30
-0
No files found.
ndb/src/common/mgmcommon/ConfigInfo.cpp
View file @
9f053d64
...
...
@@ -154,11 +154,15 @@ bool add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
bool
add_server_ports
(
Vector
<
ConfigInfo
::
ConfigRuleSection
>&
sections
,
struct
InitConfigFileParser
::
Context
&
ctx
,
const
char
*
rule_data
);
bool
check_node_vs_replicas
(
Vector
<
ConfigInfo
::
ConfigRuleSection
>&
sections
,
struct
InitConfigFileParser
::
Context
&
ctx
,
const
char
*
rule_data
);
const
ConfigInfo
::
ConfigRule
ConfigInfo
::
m_ConfigRules
[]
=
{
{
add_node_connections
,
0
},
{
add_server_ports
,
0
},
{
check_node_vs_replicas
,
0
},
{
0
,
0
}
};
...
...
@@ -2197,6 +2201,13 @@ transformNode(InitConfigFileParser::Context & ctx, const char * data){
ctx
.
m_userProperties
.
get
(
"NoOfNodes"
,
&
nodes
);
ctx
.
m_userProperties
.
put
(
"NoOfNodes"
,
++
nodes
,
true
);
/**
* Update count (per type)
*/
nodes
=
0
;
ctx
.
m_userProperties
.
get
(
ctx
.
fname
,
&
nodes
);
ctx
.
m_userProperties
.
put
(
ctx
.
fname
,
++
nodes
,
true
);
return
true
;
}
...
...
@@ -2991,6 +3002,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
return
true
;
}
bool
add_server_ports
(
Vector
<
ConfigInfo
::
ConfigRuleSection
>&
sections
,
struct
InitConfigFileParser
::
Context
&
ctx
,
const
char
*
rule_data
)
...
...
@@ -3030,4 +3042,22 @@ bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>§ions,
return
true
;
}
bool
check_node_vs_replicas
(
Vector
<
ConfigInfo
::
ConfigRuleSection
>&
sections
,
struct
InitConfigFileParser
::
Context
&
ctx
,
const
char
*
rule_data
)
{
Uint32
db_nodes
=
0
;
Uint32
replicas
=
0
;
ctx
.
m_userProperties
.
get
(
"DB"
,
&
db_nodes
);
ctx
.
m_userProperties
.
get
(
"NoOfReplicas"
,
&
replicas
);
if
((
db_nodes
%
replicas
)
!=
0
){
ctx
.
reportError
(
"Invalid no of db nodes wrt no of replicas.
\n
"
"No of nodes must be dividable with no or replicas"
);
return
false
;
}
return
true
;
}
template
class
Vector
<
ConfigInfo
::
ConfigRuleSection
>;
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