Below is the list of changes that have just been committed into a local
5.1 repository of joerg. When joerg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2204 06/06/22 12:22:52 joerg@trift2. +5 -0
Merge mysql.com:/M50/bug19353-5.0 into mysql.com:/M51/bug19353-5.1
support-files/mysql.spec.sh
1.147 06/06/22 12:22:49 joerg@trift2. +0 -0
Auto merged
support-files/mysql.server.sh
1.52 06/06/22 12:22:48 joerg@trift2. +0 -0
Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
1.101 06/06/22 12:22:48 joerg@trift2. +0 -0
Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp
1.78 06/06/22 12:22:47 joerg@trift2. +0 -0
Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp
1.67 06/06/22 12:22:46 joerg@trift2. +0 -0
Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
1.73.27.2 06/06/22 12:22:46 joerg@trift2. +0 -0
Merge rename: ndb/src/mgmsrv/MgmtSrvr.cpp -> storage/ndb/src/mgmsrv/MgmtSrvr.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
1.60.11.2 06/06/22 12:22:46 joerg@trift2. +0 -0
Merge rename: ndb/src/mgmsrv/ConfigInfo.cpp ->
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmapi/mgmapi.cpp
1.44.22.2 06/06/22 12:22:46 joerg@trift2. +0 -0
Merge rename: ndb/src/mgmapi/mgmapi.cpp -> storage/ndb/src/mgmapi/mgmapi.cpp
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: joerg
# Host: trift2.
# Root: /M51/bug19353-5.1/RESYNC
--- 1.51/support-files/mysql.server.sh 2006-06-14 18:16:33 +02:00
+++ 1.52/support-files/mysql.server.sh 2006-06-22 12:22:48 +02:00
@@ -98,6 +98,11 @@
export PATH
mode=$1 # start or stop
+shift
+other_args="$*" # uncommon, but needed when called from an RPM upgrade action
+ # Expected: "--skip-networking --skip-grant-tables"
+ # They are not checked here, intentionally, as it is the resposibility
+ # of the "spec" file author to give correct arguments only.
case `echo "testing\c"`,`echo -n testing` in
*c*,-n*) echo_n= echo_c= ;;
@@ -264,6 +269,11 @@
echo $echo_n "Starting MySQL"
if test -x $manager -a "$use_mysqld_safe" = "0"
then
+ if test -n "$other_args"
+ then
+ log_failure_msg "MySQL manager does not support options '$other_args'"
+ exit 1
+ fi
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
"$manager" \
@@ -282,7 +292,7 @@
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
pid_file=$server_pid_file
- $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file >/dev/null
2>&1 &
+ $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args
>/dev/null 2>&1 &
wait_for_pid created
# Make lock for RedHat / SuSE
@@ -330,8 +340,8 @@
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
- $0 stop
- $0 start
+ $0 stop $other_args
+ $0 start $other_args
;;
'reload')
@@ -346,7 +356,7 @@
*)
# usage
- echo "Usage: $0 start|stop|restart|reload"
+ echo "Usage: $0 {start|stop|restart|reload} [ MySQL server options ]"
exit 1
;;
esac
--- 1.146/support-files/mysql.spec.sh 2006-06-13 22:09:31 +02:00
+++ 1.147/support-files/mysql.spec.sh 2006-06-22 12:22:49 +02:00
@@ -466,7 +466,16 @@
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
# Upgrade databases if needed
-%{_bindir}/mysql_upgrade --user=%{mysqld_user}
+# This must be done as database user "root", who should be password-protected,
+# but this password is not available here.
+# So ensure the server is isolated as much as possible, and start it so that
+# passwords are not checked.
+# See the related change in the start script "/etc/init.d/mysql".
+chmod 700 $mysql_datadir
+%{_sysconfdir}/init.d/mysql start --skip-networking --skip-grant-tables
+%{_bindir}/mysql_upgrade
+%{_sysconfdir}/init.d/mysql stop --skip-networking --skip-grant-tables
+chmod 755 $mysql_datadir
# Change permissions again to fix any new files.
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
@@ -679,6 +688,11 @@
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Tue Jun 20 2006 Joerg Bruehe <joerg@stripped>
+
+- To run "mysql_upgrade", we need a running server;
+ start it in isolation and skip password checks.
+
* Sat May 20 2006 Kent Boortz <kent@stripped>
- Always compile for PIC, position independent code.
--- 1.60.11.1/ndb/src/mgmsrv/ConfigInfo.cpp 2006-06-20 10:27:46 +02:00
+++ 1.78/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2006-06-22 12:22:47 +02:00
@@ -761,6 +761,30 @@
STR_VALUE(MAX_INT_RNIL)},
{
+ CFG_DB_DISK_PAGE_BUFFER_MEMORY,
+ "DiskPageBufferMemory",
+ DB_TOKEN,
+ "Number bytes on each "DB_TOKEN_PRINT" node allocated for disk page buffer cache",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT64,
+ "64M",
+ "4M",
+ "1024G" },
+
+ {
+ CFG_DB_SGA,
+ "SharedGlobalMemory",
+ DB_TOKEN,
+ "Total number bytes on each "DB_TOKEN_PRINT" node allocated for any use",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT64,
+ "20M",
+ "0",
+ "65536G" }, // 32k pages * 32-bit i value
+
+ {
CFG_DB_START_PARTIAL_TIMEOUT,
"StartPartialTimeout",
DB_TOKEN,
@@ -869,6 +893,18 @@
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_DB_INITIAL_OPEN_FILES,
+ "InitialNoOfOpenFiles",
+ DB_TOKEN,
+ "Initial number of files open per "DB_TOKEN_PRINT" node.(One thread is created per
file)",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "27",
+ "20",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
CFG_DB_TRANSACTION_CHECK_INTERVAL,
"TimeBetweenInactiveTransactionAbortCheck",
DB_TOKEN,
@@ -1214,6 +1250,18 @@
"2K",
STR_VALUE(MAX_INT_RNIL) },
+ {
+ CFG_DB_STRING_MEMORY,
+ "StringMemory",
+ DB_TOKEN,
+ "Default size of string memory (0 -> 5% of max 1-100 -> %of max, >100 ->
actual bytes)",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "0",
+ "0",
+ STR_VALUE(MAX_INT_RNIL) },
+
/***************************************************************************
* API
***************************************************************************/
--- 1.44.22.1/ndb/src/mgmapi/mgmapi.cpp 2006-06-20 10:27:46 +02:00
+++ 1.67/storage/ndb/src/mgmapi/mgmapi.cpp 2006-06-22 12:22:46 +02:00
@@ -142,6 +142,12 @@
return ret; \
}
+#define DBUG_CHECK_REPLY(reply, ret) \
+ if (reply == NULL) { \
+ SET_ERROR(handle, NDB_MGM_ILLEGAL_SERVER_REPLY, ""); \
+ DBUG_RETURN(ret); \
+ }
+
/*****************************************************************************
* Handles
*****************************************************************************/
@@ -202,7 +208,7 @@
handle->cfg.~LocalConfig();
new (&(handle->cfg)) LocalConfig;
handle->cfg.init(0, 0); /* reset the LocalConfig */
- SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, "");
+ SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, mgmsrv ? mgmsrv : "");
DBUG_RETURN(-1);
}
handle->cfg_i= -1;
@@ -1436,33 +1442,6 @@
extern "C"
int
-ndb_mgm_get_stat_port(NdbMgmHandle handle, struct ndb_mgm_reply* /*reply*/)
-{
- SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_stat_port");
- const ParserRow<ParserDummy> stat_reply[] = {
- MGM_CMD("error", NULL, ""),
- MGM_ARG("result", String, Mandatory, "Error message"),
- MGM_CMD("get statport reply", NULL, ""),
- MGM_ARG("tcpport", Int, Mandatory, "TCP port for statistics"),
- MGM_END()
- };
- CHECK_HANDLE(handle, -1);
- CHECK_CONNECTED(handle, -1);
-
- Properties args;
- const Properties *reply;
- reply = ndb_mgm_call(handle, stat_reply, "get statport", &args);
- CHECK_REPLY(reply, -1);
-
- Uint32 port;
- reply->get("tcpport", &port);
-
- delete reply;
- return port;
-}
-
-extern "C"
-int
ndb_mgm_dump_state(NdbMgmHandle handle, int nodeId, int* _args,
int _num_args, struct ndb_mgm_reply* /* reply */)
{
@@ -2313,9 +2292,9 @@
int param,
int value,
struct ndb_mgm_reply* mgmreply){
- DBUG_ENTER("ndb_mgm_set_connection_int_parameter");
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
+ DBUG_ENTER("ndb_mgm_set_connection_int_parameter");
Properties args;
args.put("node1", node1);
@@ -2332,7 +2311,7 @@
const Properties *prop;
prop= ndb_mgm_call(handle, reply, "set connection parameter", &args);
- CHECK_REPLY(prop, -1);
+ DBUG_CHECK_REPLY(prop, -1);
int res= -1;
do {
@@ -2356,9 +2335,9 @@
int param,
int *value,
struct ndb_mgm_reply* mgmreply){
- DBUG_ENTER("ndb_mgm_get_connection_int_parameter");
CHECK_HANDLE(handle, -1);
CHECK_CONNECTED(handle, -2);
+ DBUG_ENTER("ndb_mgm_get_connection_int_parameter");
Properties args;
args.put("node1", node1);
@@ -2374,7 +2353,7 @@
const Properties *prop;
prop = ndb_mgm_call(handle, reply, "get connection parameter", &args);
- CHECK_REPLY(prop, -3);
+ DBUG_CHECK_REPLY(prop, -3);
int res= -1;
do {
@@ -2422,9 +2401,9 @@
{
Uint32 nodeid=0;
- DBUG_ENTER("ndb_mgm_get_mgmd_nodeid");
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
+ DBUG_ENTER("ndb_mgm_get_mgmd_nodeid");
Properties args;
@@ -2436,7 +2415,7 @@
const Properties *prop;
prop = ndb_mgm_call(handle, reply, "get mgmd nodeid", &args);
- CHECK_REPLY(prop, 0);
+ DBUG_CHECK_REPLY(prop, 0);
if(!prop->get("nodeid",&nodeid)){
fprintf(handle->errstream, "Unable to get value\n");
@@ -2450,9 +2429,9 @@
extern "C"
int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length)
{
- DBUG_ENTER("ndb_mgm_report_event");
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
+ DBUG_ENTER("ndb_mgm_report_event");
Properties args;
args.put("length", length);
@@ -2471,7 +2450,7 @@
const Properties *prop;
prop = ndb_mgm_call(handle, reply, "report event", &args);
- CHECK_REPLY(prop, -1);
+ DBUG_CHECK_REPLY(prop, -1);
DBUG_RETURN(0);
}
@@ -2479,9 +2458,9 @@
extern "C"
int ndb_mgm_end_session(NdbMgmHandle handle)
{
- DBUG_ENTER("ndb_mgm_end_session");
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
+ DBUG_ENTER("ndb_mgm_end_session");
SocketOutputStream s_output(handle->socket);
s_output.println("end session");
--- 1.73.27.1/ndb/src/mgmsrv/MgmtSrvr.cpp 2006-06-20 10:27:46 +02:00
+++ 1.101/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2006-06-22 12:22:48 +02:00
@@ -37,10 +37,10 @@
#include <signaldata/EventReport.hpp>
#include <signaldata/DumpStateOrd.hpp>
#include <signaldata/BackupSignalData.hpp>
-#include <signaldata/GrepImpl.hpp>
#include <signaldata/ManagementServer.hpp>
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/NodeFailRep.hpp>
+#include <signaldata/AllocNodeId.hpp>
#include <NdbSleep.h>
#include <EventLogger.hpp>
#include <DebuggerNames.hpp>
@@ -491,10 +491,6 @@
case NODE_TYPE_MGM:
nodeTypes[id] = NDB_MGM_NODE_TYPE_MGM;
break;
- case NODE_TYPE_REP:
- nodeTypes[id] = NDB_MGM_NODE_TYPE_REP;
- break;
- case NODE_TYPE_EXT_REP:
default:
break;
}
@@ -577,8 +573,7 @@
DBUG_RETURN(false);
}
}
- theFacade= TransporterFacade::theFacadeInstance
- = new TransporterFacade();
+ theFacade= new TransporterFacade();
if(theFacade == 0) {
DEBUG("MgmtSrvr.cpp: theFacade is NULL.");
@@ -1863,9 +1858,6 @@
break;
case GSN_EVENT_REP:
{
- EventReport *rep = (EventReport*) signal->getDataPtr();
- if (rep->getNodeId() == 0)
- rep->setNodeId(refToNode(signal->theSendersBlockRef));
eventReport(signal->getDataPtr());
break;
}
@@ -1906,7 +1898,6 @@
DBUG_VOID_RETURN;
}
}
-
rep->setNodeId(_ownNodeId);
eventReport(theData);
DBUG_VOID_RETURN;
@@ -1979,6 +1970,89 @@
}
}
+int
+MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
+{
+ SignalSender ss(theFacade);
+ ss.lock(); // lock will be released on exit
+
+ SimpleSignal ssig;
+ AllocNodeIdReq* req = CAST_PTR(AllocNodeIdReq, ssig.getDataPtrSend());
+ ssig.set(ss, TestOrd::TraceAPI, QMGR, GSN_ALLOC_NODEID_REQ,
+ AllocNodeIdReq::SignalLength);
+
+ req->senderRef = ss.getOwnRef();
+ req->senderData = 19;
+ req->nodeId = free_node_id;
+ req->nodeType = type;
+
+ int do_send = 1;
+ NodeId nodeId = 0;
+ while (1)
+ {
+ if (nodeId == 0)
+ {
+ bool next;
+ while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true &&
+ theFacade->get_node_alive(nodeId) == false);
+ if (!next)
+ return NO_CONTACT_WITH_DB_NODES;
+ do_send = 1;
+ }
+ if (do_send)
+ {
+ if (ss.sendSignal(nodeId, &ssig) != SEND_OK) {
+ return SEND_OR_RECEIVE_FAILED;
+ }
+ do_send = 0;
+ }
+
+ SimpleSignal *signal = ss.waitFor();
+
+ int gsn = signal->readSignalNumber();
+ switch (gsn) {
+ case GSN_ALLOC_NODEID_CONF:
+ {
+ const AllocNodeIdConf * const conf =
+ CAST_CONSTPTR(AllocNodeIdConf, signal->getDataPtr());
+ return 0;
+ }
+ case GSN_ALLOC_NODEID_REF:
+ {
+ const AllocNodeIdRef * const ref =
+ CAST_CONSTPTR(AllocNodeIdRef, signal->getDataPtr());
+ if (ref->errorCode == AllocNodeIdRef::NotMaster ||
+ ref->errorCode == AllocNodeIdRef::Busy)
+ {
+ do_send = 1;
+ nodeId = refToNode(ref->masterRef);
+ continue;
+ }
+ return ref->errorCode;
+ }
+ case GSN_NF_COMPLETEREP:
+ {
+ const NFCompleteRep * const rep =
+ CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr());
+#ifdef VM_TRACE
+ ndbout_c("Node %d fail completed", rep->failedNodeId);
+#endif
+ if (rep->failedNodeId == nodeId)
+ nodeId = 0;
+ continue;
+ }
+ case GSN_NODE_FAILREP:{
+ // ignore NF_COMPLETEREP will come
+ continue;
+ }
+ default:
+ report_unknown_signal(signal);
+ return SEND_OR_RECEIVE_FAILED;
+ }
+ }
+ return 0;
+}
+
bool
MgmtSrvr::alloc_node_id(NodeId * nodeId,
enum ndb_mgm_node_type type,
@@ -2109,6 +2183,39 @@
}
NdbMutex_Unlock(m_configMutex);
+ if (id_found && client_addr != 0)
+ {
+ int res = alloc_node_id_req(id_found, type);
+ unsigned save_id_found = id_found;
+ switch (res)
+ {
+ case 0:
+ // ok continue
+ break;
+ case NO_CONTACT_WITH_DB_NODES:
+ // ok continue
+ break;
+ default:
+ // something wrong
+ id_found = 0;
+ break;
+
+ }
+ if (id_found == 0)
+ {
+ char buf[128];
+ ndb_error_string(res, buf, sizeof(buf));
+ error_string.appfmt("Cluster refused allocation of id %d. Error: %d (%s).",
+ save_id_found, res, buf);
+ g_eventLogger.warning("Cluster refused allocation of id %d. "
+ "Connection from ip %s. "
+ "Returned error string \"%s\"", save_id_found,
+ inet_ntoa(((struct sockaddr_in
*)(client_addr))->sin_addr),
+ error_string.c_str());
+ DBUG_RETURN(false);
+ }
+ }
+
if (id_found)
{
*nodeId= id_found;
@@ -2476,17 +2583,6 @@
return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED;
}
-
-/*****************************************************************************
- * Global Replication
- *****************************************************************************/
-
-int
-MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted)
-{
- require(false);
- return 0;
-}
MgmtSrvr::Allocated_resources::Allocated_resources(MgmtSrvr &m)
: m_mgmsrv(m)
| Thread |
|---|
| • bk commit into 5.1 tree (joerg:1.2204) | Joerg Bruehe | 22 Jun |