diff options
author | unknown <jmiller@mysql.com> | 2006-02-10 20:58:42 +0100 |
---|---|---|
committer | unknown <jmiller@mysql.com> | 2006-02-10 20:58:42 +0100 |
commit | ed68cec78f5bc8b36e04d62a119fd1e406e757f0 (patch) | |
tree | c2105f0022b1751b1c6fdb73e82cfd25e2fbb6e8 | |
parent | 46e4eabf80ea950643c369b3582b8a2585d42c30 (diff) | |
parent | 2449ef8fec5537187a593492fef8e065032e5bdf (diff) | |
download | mariadb-git-ed68cec78f5bc8b36e04d62a119fd1e406e757f0.tar.gz |
Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new
25 files changed, 233 insertions, 57 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 3607a2e3ab5..d72f5771f15 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -702,11 +702,11 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1 drop table t1; CREATE TABLE t1 (a int, key(a)) engine=heap; -insert delayed into t1 values (0); +insert into t1 values (0); delete from t1; select * from t1; a -insert delayed into t1 values (0), (1); +insert into t1 values (0), (1); select * from t1 where a = 0; a 0 diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result index ca9ad7ce31c..70aef9c40d5 100644 --- a/mysql-test/r/im_life_cycle.result +++ b/mysql-test/r/im_life_cycle.result @@ -62,3 +62,5 @@ SHOW INSTANCES; instance_name status mysqld1 online mysqld2 offline +SHOW INSTANCE STATUS; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 2cb90679aed..e9d41c104dd 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -25,7 +25,7 @@ select ((@id := kill_id) - kill_id) from t3; ((@id := kill_id) - kill_id) 0 kill @id; -ERROR 08S01: Server shutdown in progress +Got one of the listed errors drop table t1, t2, t3; select get_lock("a", 10); get_lock("a", 10) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 1e863c9012f..462d738a8bb 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -678,6 +678,61 @@ CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb; select * from t1; b drop table t1; +create table t1 (a int) engine=ndb; +create table t2 (a int) engine=ndb; +insert into t1 values (1); +insert into t2 values (1); +delete t1.* from t1, t2 where t1.a = t2.a; +select * from t1; +a +select * from t2; +a +1 +drop table t1; +drop table t2; +CREATE TABLE t1 ( +i INT, +j INT, +x INT, +y INT, +z INT +) engine=ndb; +CREATE TABLE t2 ( +i INT, +k INT, +x INT, +y INT, +z INT +) engine=ndb; +CREATE TABLE t3 ( +j INT, +k INT, +x INT, +y INT, +z INT +) engine=ndb; +INSERT INTO t1 VALUES ( 1, 2,13,14,15); +INSERT INTO t2 VALUES ( 1, 3,23,24,25); +INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36); +UPDATE t1 AS a +INNER JOIN t2 AS b +ON a.i = b.i +INNER JOIN t3 AS c +ON a.j = c.j AND b.k = c.k +SET a.x = b.x, +a.y = b.y, +a.z = ( +SELECT sum(z) +FROM t3 +WHERE y = 34 +) +WHERE b.x = 23; +select * from t1; +i j x y z +1 2 23 24 71 +drop table t1; +drop table t2; +drop table t3; create table atablewithareallylongandirritatingname (a int); insert into atablewithareallylongandirritatingname values (2); select * from atablewithareallylongandirritatingname; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 6a8abdeea26..82294db336d 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -440,10 +440,10 @@ drop table t1; # Bug 12796: Record doesn't show when selecting through index # CREATE TABLE t1 (a int, key(a)) engine=heap; -insert delayed into t1 values (0); +insert into t1 values (0); delete from t1; select * from t1; -insert delayed into t1 values (0), (1); +insert into t1 values (0), (1); select * from t1 where a = 0; drop table t1; diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest index 70851137f6d..2ea0c151d5a 100644 --- a/mysql-test/t/im_life_cycle.imtest +++ b/mysql-test/t/im_life_cycle.imtest @@ -140,3 +140,12 @@ SHOW INSTANCES; --exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed SHOW INSTANCES; + +########################################################################### +# +# 1.1.8. Check that Instance Manager returns an error on +# incomplete SHOW INSTANCE STATUS command. +# +########################################################################### +--error 1149 +SHOW INSTANCE STATUS; diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 9a8f61b1052..8302c767985 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -84,7 +84,7 @@ select ((@id := kill_id) - kill_id) from t3; kill @id; connection conn1; --- error 1053 +-- error 1053,2013 reap; connection default; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index e99503843bd..93bcc9b9050 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -625,6 +625,72 @@ CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb; select * from t1; drop table t1; +# +# Bug #17249 delete statement with join where clause fails +# when table do not have pk +# + +create table t1 (a int) engine=ndb; +create table t2 (a int) engine=ndb; +insert into t1 values (1); +insert into t2 values (1); +delete t1.* from t1, t2 where t1.a = t2.a; +select * from t1; +select * from t2; +drop table t1; +drop table t2; + +# +# Bug #17257 update fails for inner joins if tables +# do not have Primary Key +# + +CREATE TABLE t1 ( + i INT, + j INT, + x INT, + y INT, + z INT +) engine=ndb; + +CREATE TABLE t2 ( + i INT, + k INT, + x INT, + y INT, + z INT +) engine=ndb; + +CREATE TABLE t3 ( + j INT, + k INT, + x INT, + y INT, + z INT +) engine=ndb; + +INSERT INTO t1 VALUES ( 1, 2,13,14,15); +INSERT INTO t2 VALUES ( 1, 3,23,24,25); +INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36); + +UPDATE t1 AS a +INNER JOIN t2 AS b + ON a.i = b.i +INNER JOIN t3 AS c + ON a.j = c.j AND b.k = c.k +SET a.x = b.x, + a.y = b.y, + a.z = ( + SELECT sum(z) + FROM t3 + WHERE y = 34 + ) +WHERE b.x = 23; +select * from t1; +drop table t1; +drop table t2; +drop table t3; + # End of 4.1 tests # diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am index 7449735f0bf..5b9690322aa 100644 --- a/server-tools/instance-manager/Makefile.am +++ b/server-tools/instance-manager/Makefile.am @@ -30,11 +30,9 @@ liboptions_a_CXXFLAGS= $(CXXFLAGS) \ -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \ -DDEFAULT_LOG_FILE_NAME="$(localstatedir)/mysqlmanager.log" \ -DDEFAULT_SOCKET_FILE_NAME="/tmp/mysqlmanager.sock" \ - -DDEFAULT_PASSWORD_FILE_NAME="$(sysconfdir)/mysqlmanager.passwd" \ + -DDEFAULT_PASSWORD_FILE_NAME="/etc/mysqlmanager.passwd" \ -DDEFAULT_MYSQLD_PATH="$(libexecdir)/mysqld$(EXEEXT)" \ - -DDEFAULT_MONITORING_INTERVAL="20" \ - -DDEFAULT_PORT="2273" \ - -DDEFAULT_CONFIG_FILE="/etc/my.cnf" \ + -DDEFAULT_CONFIG_FILE="/etc/my.cnf" \ -DPROTOCOL_VERSION=@PROTOCOL_VERSION@ liboptions_a_SOURCES= options.h options.cc priv.h priv.cc diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc index cde0f784f39..7b999f61503 100644 --- a/server-tools/instance-manager/commands.cc +++ b/server-tools/instance-manager/commands.cc @@ -525,7 +525,7 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) read_buff.reserve(0, buff_size); /* read in one chunk */ - read_len= my_seek(fd, file_stat.st_size - size, MY_SEEK_SET, MYF(0)); + read_len= (int)my_seek(fd, file_stat.st_size - size, MY_SEEK_SET, MYF(0)); if ((read_len= my_read(fd, (byte*) read_buff.buffer, buff_size, MYF(0))) < 0) diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 3d04403f830..39381b457ab 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -418,6 +418,10 @@ bool Instance::is_running() if (options.mysqld_socket) socket= strchr(options.mysqld_socket, '=') + 1; + /* no port was specified => instance falled back to default value */ + if (!options.mysqld_port && !options.mysqld_socket) + port= SERVER_DEFAULT_PORT; + pthread_mutex_lock(&LOCK_instance); mysql_init(&mysql); diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index 611eda457f2..7dfe0ae688b 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -229,11 +229,33 @@ int Instance_map::load() uint args_used= 0; const char *argv_options[3]; char **argv= (char **) &argv_options; - + char defaults_file_arg[FN_REFLEN]; /* the name of the program may be orbitrary here in fact */ argv_options[0]= "mysqlmanager"; - argv_options[1]= '\0'; + + /* + If the option file was forced by the user when starting + the IM with --defaults-file=xxxx, make sure it is also + passed as --defaults-file, not only as Options::config_file. + This is important for option files given with relative path: + e.g. --defaults-file=my.cnf. + Otherwise my_search_option_files will treat "my.cnf" as a group + name and start looking for files named "my.cnf.cnf" in all + default dirs. Which is not what we want. + */ + if (Options::is_forced_default_file) + { + snprintf(defaults_file_arg, FN_REFLEN, "--defaults-file=%s", + Options::config_file); + + argv_options[1]= defaults_file_arg; + argv_options[2]= '\0'; + + argc= 2; + } + else + argv_options[1]= '\0'; /* If the routine failed, we'll simply fallback to defaults in diff --git a/server-tools/instance-manager/mysqlmanager.cc b/server-tools/instance-manager/mysqlmanager.cc index 3d2907f4776..d0b2cf2666c 100644 --- a/server-tools/instance-manager/mysqlmanager.cc +++ b/server-tools/instance-manager/mysqlmanager.cc @@ -82,12 +82,13 @@ int main(int argc, char *argv[]) int return_value= 1; init_environment(argv[0]); Options options; - struct passwd *user_info; if (options.load(argc, argv)) goto err; #ifndef __WIN__ + struct passwd *user_info; + if ((user_info= check_user(options.user))) { if (set_user(options.user, user_info)) diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index b16fcabae01..8119e8fc0ea 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -55,6 +55,8 @@ uint Options::monitoring_interval= DEFAULT_MONITORING_INTERVAL; uint Options::port_number= DEFAULT_PORT; /* just to declare */ char **Options::saved_argv= NULL; +/* Remember if the config file was forced */ +bool Options::is_forced_default_file= 0; /* List of options, accepted by the instance manager. @@ -118,7 +120,7 @@ static struct my_option my_long_options[] = " Server binary.", (gptr *) &Options::default_mysqld_path, (gptr *) &Options::default_mysqld_path, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor" " instances in seconds.", @@ -254,6 +256,7 @@ int Options::load(int argc, char **argv) if (is_prefix(argv[1], "--defaults-file=")) { Options::config_file= strchr(argv[1], '=') + 1; + Options::is_forced_default_file= 1; } if (is_prefix(argv[1], "--defaults-extra-file=") || is_prefix(argv[1], "--no-defaults")) diff --git a/server-tools/instance-manager/options.h b/server-tools/instance-manager/options.h index 6d719c69629..abb094eac93 100644 --- a/server-tools/instance-manager/options.h +++ b/server-tools/instance-manager/options.h @@ -36,6 +36,7 @@ struct Options static char run_as_service; /* handle_options doesn't support bool */ static const char *user; #endif + static bool is_forced_default_file; static const char *log_file_name; static const char *pid_file_name; static const char *socket_file_name; diff --git a/server-tools/instance-manager/parse.cc b/server-tools/instance-manager/parse.cc index a79a6ad6742..9d9064240d4 100644 --- a/server-tools/instance-manager/parse.cc +++ b/server-tools/instance-manager/parse.cc @@ -166,7 +166,8 @@ Command *parse_command(Instance_map *map, const char *text) skip= true; case TOK_SET: - get_text_id(&text, &instance_name_len, &instance_name); + if (get_text_id(&text, &instance_name_len, &instance_name)) + goto syntax_error; text+= instance_name_len; /* the next token should be a dot */ @@ -221,7 +222,8 @@ Command *parse_command(Instance_map *map, const char *text) switch (Token tok2= shift_token(&text, &word_len)) { case TOK_OPTIONS: case TOK_STATUS: - get_text_id(&text, &instance_name_len, &instance_name); + if (get_text_id(&text, &instance_name_len, &instance_name)) + goto syntax_error; text+= instance_name_len; /* check that this is the end of the command */ get_word(&text, &word_len); @@ -273,7 +275,8 @@ Command *parse_command(Instance_map *map, const char *text) goto syntax_error; } /* get the size of the log we want to retrieve */ - get_text_id(&text, &word_len, &log_size); + if (get_text_id(&text, &word_len, &log_size)) + goto syntax_error; text+= word_len; /* this parameter is required */ if (!word_len) @@ -291,7 +294,6 @@ Command *parse_command(Instance_map *map, const char *text) instance_name_len, log_type, log_size, text); - //get_text_id(&text, &log_size_len, &log_size); break; case '\0': command= new Show_instance_log(map, instance_name, diff --git a/server-tools/instance-manager/portability.h b/server-tools/instance-manager/portability.h index 2bdeff71a72..1a3be5705e3 100644 --- a/server-tools/instance-manager/portability.h +++ b/server-tools/instance-manager/portability.h @@ -8,13 +8,12 @@ #ifdef __WIN__ #define vsnprintf _vsnprintf +#define snprintf _snprintf #define SIGKILL 9 #define SHUT_RDWR 0x2 /*TODO: fix this */ -#define DEFAULT_MONITORING_INTERVAL 20 -#define DEFAULT_PORT 2273 #define PROTOCOL_VERSION 10 typedef int pid_t; diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc index e39c12f4ebb..d2d6a3f636c 100644 --- a/server-tools/instance-manager/priv.cc +++ b/server-tools/instance-manager/priv.cc @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <my_global.h> +#include <mysql_com.h> #include "priv.h" #include "portability.h" @@ -52,7 +53,7 @@ unsigned long net_buffer_length= 16384; unsigned long max_allowed_packet= 16384; -unsigned long net_read_timeout= 30; // same as in mysqld +unsigned long net_read_timeout= NET_WAIT_TIMEOUT; // same as in mysqld unsigned long net_write_timeout= 60; // same as in mysqld diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h index 4739bca68eb..af6d2837933 100644 --- a/server-tools/instance-manager/priv.h +++ b/server-tools/instance-manager/priv.h @@ -24,6 +24,11 @@ #endif #include "my_pthread.h" +/* IM-wide platform-independent defines */ +#define SERVER_DEFAULT_PORT 3306 +#define DEFAULT_MONITORING_INTERVAL 20 +#define DEFAULT_PORT 2273 + /* the pid of the manager process (of the signal thread on the LinuxThreads) */ extern pid_t manager_pid; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 22a3ca0e302..bd11b72dd64 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -97,8 +97,6 @@ static uint ndbcluster_alter_table_flags(uint flags) } -#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 - #define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0 #define NDB_AUTO_INCREMENT_RETRIES 10 @@ -952,7 +950,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field, } // Used for hidden key only - m_value[fieldnr].rec= ndb_op->getValue(fieldnr, NULL); + m_value[fieldnr].rec= ndb_op->getValue(fieldnr, m_ref); DBUG_RETURN(m_value[fieldnr].rec == NULL); } @@ -2551,13 +2549,10 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) DBUG_PRINT("info", ("Using hidden key")); // Require that the PK for this record has previously been - // read into m_value - uint no_fields= table_share->fields; - const NdbRecAttr* rec= m_value[no_fields].rec; - DBUG_ASSERT(rec); - DBUG_DUMP("key", (char*)rec->aRef(), NDB_HIDDEN_PRIMARY_KEY_LENGTH); + // read into m_ref + DBUG_DUMP("key", m_ref, NDB_HIDDEN_PRIMARY_KEY_LENGTH); - if (set_hidden_key(op, no_fields, rec->aRef())) + if (set_hidden_key(op, table->s->fields, m_ref)) ERR_RETURN(op->getNdbError()); } else @@ -2664,11 +2659,8 @@ int ha_ndbcluster::delete_row(const byte *record) { // This table has no primary key, use "hidden" primary key DBUG_PRINT("info", ("Using hidden key")); - uint no_fields= table_share->fields; - const NdbRecAttr* rec= m_value[no_fields].rec; - DBUG_ASSERT(rec != NULL); - if (set_hidden_key(op, no_fields, rec->aRef())) + if (set_hidden_key(op, table->s->fields, m_ref)) ERR_RETURN(op->getNdbError()); } else @@ -3242,17 +3234,15 @@ void ha_ndbcluster::position(const byte *record) { // No primary key, get hidden key DBUG_PRINT("info", ("Getting hidden key")); - int hidden_no= table_share->fields; - const NdbRecAttr* rec= m_value[hidden_no].rec; - memcpy(ref, (const void*)rec->aRef(), ref_length); #ifndef DBUG_OFF + int hidden_no= table->s->fields; const NDBTAB *tab= (const NDBTAB *) m_table; const NDBCOL *hidden_col= tab->getColumn(hidden_no); DBUG_ASSERT(hidden_col->getPrimaryKey() && hidden_col->getAutoIncrement() && - rec != NULL && ref_length == NDB_HIDDEN_PRIMARY_KEY_LENGTH); #endif + memcpy(ref, m_ref, ref_length); } DBUG_DUMP("ref", (char*)ref, ref_length); diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 65ec5956b27..12a5be32881 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -31,6 +31,8 @@ #include <NdbApi.hpp> #include <ndbapi_limits.h> +#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 + class Ndb; // Forward declaration class NdbOperation; // Forward declaration class NdbTransaction; // Forward declaration @@ -818,6 +820,7 @@ private: NDB_INDEX_DATA m_index[MAX_KEY]; // NdbRecAttr has no reference to blob NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE]; + byte m_ref[NDB_HIDDEN_PRIMARY_KEY_LENGTH]; partition_info *m_part_info; byte *m_rec0; Field **m_part_field_array; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 010c1250756..1b9cca9d84f 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -411,7 +411,7 @@ static void set_param_decimal(Item_param *param, uchar **pos, ulong len) { ulong length= get_param_length(pos, len); param->set_decimal((char*)*pos, length); - *pos+= len; + *pos+= length; } #ifndef EMBEDDED_LIBRARY diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 166917b00d2..31d877917e7 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -775,7 +775,7 @@ private: //------------------------------------ // Methods for LCP functionality //------------------------------------ - void checkKeepGci(Uint32 replicaStartIndex); + void checkKeepGci(TabRecordPtr, Uint32, Fragmentstore*, Uint32); void checkLcpStart(Signal *, Uint32 lineNo); void checkStartMoreLcp(Signal *, Uint32 nodeId); bool reportLcpCompletion(const class LcpFragRep *); @@ -1300,7 +1300,7 @@ private: } Uint32 lcpStart; - Uint32 lcpStartGcp; + Uint32 lcpStopGcp; Uint32 keepGci; /* USED TO CALCULATE THE GCI TO KEEP AFTER A LCP */ Uint32 oldestRestorableGci; @@ -1369,7 +1369,8 @@ private: Uint32 cstarttype; Uint32 csystemnodes; Uint32 currentgcp; - + Uint32 c_newest_restorable_gci; + enum GcpMasterTakeOverState { GMTOS_IDLE = 0, GMTOS_INITIAL = 1, diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index b0fcfc342da..2c854da9609 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -685,6 +685,7 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal) jam(); coldgcp = SYSFILE->newestRestorableGCI; crestartGci = SYSFILE->newestRestorableGCI; + c_newest_restorable_gci = SYSFILE->newestRestorableGCI; Sysfile::setRestartOngoing(SYSFILE->systemRestartBits); currentgcp = coldgcp + 1; cnewgcp = coldgcp + 1; @@ -703,6 +704,7 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal) ok = true; jam(); cgcpParticipantState = GCP_PARTICIPANT_COPY_GCI_RECEIVED; + c_newest_restorable_gci = SYSFILE->newestRestorableGCI; setNodeInfo(signal); break; }//if @@ -8039,6 +8041,8 @@ void Dbdih::execCOPY_GCICONF(Signal* signal) signal->theData[1] = coldgcp; sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); + c_newest_restorable_gci = coldgcp; + CRASH_INSERTION(7004); emptyWaitGCPMasterQueue(signal); cgcpStatus = GCP_READY; @@ -9522,7 +9526,7 @@ void Dbdih::checkTcCounterLab(Signal* signal) }//if c_lcpState.ctimer += 32; if ((c_nodeStartMaster.blockLcp == true) || - ((c_lcpState.lcpStartGcp + 1) > currentgcp)) { + (c_lcpState.lcpStopGcp >= c_newest_restorable_gci)) { jam(); /* --------------------------------------------------------------------- */ // No reason to start juggling the states and checking for start of LCP if @@ -9605,7 +9609,6 @@ void Dbdih::execTCGETOPSIZECONF(Signal* signal) /* ----------------------------------------------------------------------- */ c_lcpState.ctimer = 0; c_lcpState.keepGci = coldgcp; - c_lcpState.lcpStartGcp = currentgcp; /* ----------------------------------------------------------------------- */ /* UPDATE THE NEW LATEST LOCAL CHECKPOINT ID. */ /* ----------------------------------------------------------------------- */ @@ -9677,7 +9680,7 @@ void Dbdih::calculateKeepGciLab(Signal* signal, Uint32 tableId, Uint32 fragId) cnoOfActiveTables++; FragmentstorePtr fragPtr; getFragstore(tabPtr.p, fragId, fragPtr); - checkKeepGci(fragPtr.p->storedReplicas); + checkKeepGci(tabPtr, fragId, fragPtr.p, fragPtr.p->storedReplicas); fragId++; if (fragId >= tabPtr.p->totalfragments) { jam(); @@ -10537,6 +10540,7 @@ void Dbdih::allNodesLcpCompletedLab(Signal* signal) signal->theData[0] = NDB_LE_LocalCheckpointCompleted; //Event type signal->theData[1] = SYSFILE->latestLCP_ID; sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); + c_lcpState.lcpStopGcp = c_newest_restorable_gci; /** * Start checking for next LCP @@ -10971,7 +10975,8 @@ void Dbdih::checkEscalation() /* DESCRIPTION: CHECK FOR MINIMUM GCI RESTORABLE WITH NEW LOCAL */ /* CHECKPOINT. */ /*************************************************************************/ -void Dbdih::checkKeepGci(Uint32 replicaStartIndex) +void Dbdih::checkKeepGci(TabRecordPtr tabPtr, Uint32 fragId, Fragmentstore*, + Uint32 replicaStartIndex) { ReplicaRecordPtr ckgReplicaPtr; ckgReplicaPtr.i = replicaStartIndex; @@ -10993,7 +10998,6 @@ void Dbdih::checkKeepGci(Uint32 replicaStartIndex) if (oldestRestorableGci > c_lcpState.oldestRestorableGci) { jam(); c_lcpState.oldestRestorableGci = oldestRestorableGci; - ndbrequire(((int)c_lcpState.oldestRestorableGci) >= 0); }//if ckgReplicaPtr.i = ckgReplicaPtr.p->nextReplica; }//while @@ -11287,7 +11291,7 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr, do { ndbrequire(lcpNo < MAX_LCP_STORED); if (fmgReplicaPtr.p->lcpStatus[lcpNo] == ZVALID && - fmgReplicaPtr.p->maxGciStarted[lcpNo] <= coldgcp) + fmgReplicaPtr.p->maxGciStarted[lcpNo] < c_newest_restorable_gci) { jam(); keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo]; @@ -11409,7 +11413,7 @@ void Dbdih::initCommonData() c_lcpState.clcpDelay = 0; c_lcpState.lcpStart = ZIDLE; - c_lcpState.lcpStartGcp = 0; + c_lcpState.lcpStopGcp = 0; c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__); c_lcpState.currentFragment.tableId = 0; c_lcpState.currentFragment.fragmentId = 0; @@ -11446,6 +11450,7 @@ void Dbdih::initCommonData() csystemnodes = 0; c_updateToLock = RNIL; currentgcp = 0; + c_newest_restorable_gci = 0; cverifyQueueCounter = 0; cwaitLcpSr = false; c_nextLogPart = 0; @@ -11522,6 +11527,7 @@ void Dbdih::initRestartInfo() currentgcp = 2; cnewgcp = 2; crestartGci = 1; + c_newest_restorable_gci = 1; SYSFILE->keepGCI = 1; SYSFILE->oldestRestorableGCI = 1; @@ -13494,9 +13500,9 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) if (signal->theData[0] == 7001) { infoEvent("c_lcpState.keepGci = %d", c_lcpState.keepGci); - infoEvent("c_lcpState.lcpStatus = %d, clcpStartGcp = %d", + infoEvent("c_lcpState.lcpStatus = %d, clcpStopGcp = %d", c_lcpState.lcpStatus, - c_lcpState.lcpStartGcp); + c_lcpState.lcpStopGcp); infoEvent("cgcpStartCounter = %d, cimmediateLcpStart = %d", cgcpStartCounter, c_lcpState.immediateLcpStart); }//if @@ -13677,8 +13683,8 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) infoEvent("lcpStatus = %d (update place = %d) ", c_lcpState.lcpStatus, c_lcpState.lcpStatusUpdatedPlace); infoEvent - ("lcpStart = %d lcpStartGcp = %d keepGci = %d oldestRestorable = %d", - c_lcpState.lcpStart, c_lcpState.lcpStartGcp, + ("lcpStart = %d lcpStopGcp = %d keepGci = %d oldestRestorable = %d", + c_lcpState.lcpStart, c_lcpState.lcpStopGcp, c_lcpState.keepGci, c_lcpState.oldestRestorableGci); infoEvent diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index eaf935da2c5..a6e731a64d1 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -14738,7 +14738,9 @@ void Dblqh::execSr(Signal* signal) signal->theData[4] = logFilePtr.p->currentFilepage; signal->theData[5] = logFilePtr.p->currentMbyte; signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]; - sendSignal(cownref, GSN_DEBUG_SIG, signal, 7, JBA); + signal->theData[7] = ~0; + signal->theData[8] = __LINE__; + sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA); return; }//if }//if @@ -14804,7 +14806,8 @@ void Dblqh::execSr(Signal* signal) signal->theData[5] = logFilePtr.p->currentFilepage; signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]; signal->theData[7] = logWord; - sendSignal(cownref, GSN_DEBUG_SIG, signal, 8, JBA); + signal->theData[8] = __LINE__; + sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA); return; break; }//switch @@ -14833,8 +14836,9 @@ void Dblqh::execDEBUG_SIG(Signal* signal) char buf[100]; BaseString::snprintf(buf, 100, - "Error while reading REDO log.\n" + "Error while reading REDO log. from %d\n" "D=%d, F=%d Mb=%d FP=%d W1=%d W2=%d", + signal->theData[8], signal->theData[2], signal->theData[3], signal->theData[4], signal->theData[5], signal->theData[6], signal->theData[7]); @@ -15417,6 +15421,10 @@ void Dblqh::readSrFourthZeroLab(Signal* signal) // to read a page from file. lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES; + /** + * Make sure we dont release zero page + */ + seizeLogpage(signal); invalidateLogAfterLastGCI(signal); return; }//Dblqh::readSrFourthZeroLab() |