3903 Pekka Nousiainen 2012-05-23 [merge]
merge 7.2 into 7.3-fk
modified:
mysql-test/suite/ndb/r/ndb_condition_pushdown.result
mysql-test/suite/ndb/t/ndb_condition_pushdown.test
sql/ha_ndbcluster_cond.cc
storage/ndb/src/common/util/SocketClient.cpp
storage/ndb/src/kernel/vm/mt.cpp
support-files/mysql.spec.sh
3902 Pekka Nousiainen 2012-05-22 [merge]
merge 7.3 into 7.3-fk
removed:
mysql-test/suite/ndb_rpl/t/ndb_rpl_relayrotate-slave.opt
added:
mysql-test/suite/ndb/backups/wl946_pre/
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1-0.1.Data
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1-0.2.Data
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1.1.ctl
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1.1.log
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1.2.ctl
mysql-test/suite/ndb/backups/wl946_pre/BACKUP-1.2.log
mysql-test/suite/ndb/data/wl946_pre.dat
mysql-test/suite/ndb/r/ndb_wl946_pre.result
mysql-test/suite/ndb/t/ndb_wl946_create.inc
mysql-test/suite/ndb/t/ndb_wl946_pre.test
mysql-test/suite/ndb/t/ndb_wl946_pre_query.inc
mysql-test/suite/ndb/t/show_indexes.inc
mysql-test/suite/ndb_memcache/r/math3.result
mysql-test/suite/ndb_memcache/t/math3.test
mysql-test/suite/sys_vars/r/transaction_allow_batching_basic.result
mysql-test/suite/sys_vars/t/transaction_allow_batching_basic.test
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordIndexScanOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordScanOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordScanResultDataImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordTableScanOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordUniqueKeyOperationImpl.java
storage/ndb/clusterj/clusterj-unit/
storage/ndb/clusterj/clusterj-unit/pom.xml
storage/ndb/clusterj/clusterj-unit/src/
storage/ndb/clusterj/clusterj-unit/src/main/
storage/ndb/clusterj/clusterj-unit/src/main/java/
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/AssertionFailedError.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/Test.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/TestCase.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/TestListener.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/TestResult.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/framework/TestSuite.java
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/textui/
storage/ndb/clusterj/clusterj-unit/src/main/java/junit/textui/TestRunner.java
storage/ndb/clusterj/clusterj-unit/src/main/java/org/
storage/ndb/clusterj/clusterj-unit/src/main/java/org/junit/
storage/ndb/clusterj/clusterj-unit/src/main/java/org/junit/Ignore.java
storage/ndb/memcache/unit/sequence.pl
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests_consts.cpp
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests_consts.hpp
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests_lib.cpp
storage/ndb/src/ndbjtie/test/test/NdbJTieConstantsTest.java
storage/ndb/src/ndbjtie/test/test_ndbjtie_constants.cmd.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_constants.sh.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_constants.cmd.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_constants.sh.in
modified:
VERSION
libmysqld/examples/CMakeLists.txt
mysql-test/lib/My/ConfigFactory.pm
mysql-test/lib/My/Memcache.pm
mysql-test/lib/mtr_cases.pm
mysql-test/mysql-test-run.pl
mysql-test/suite/ndb/r/ndb_blob.result
mysql-test/suite/ndb/r/ndb_dbug_tc_select.result
mysql-test/suite/ndb/r/ndb_dd_sql_features.result
mysql-test/suite/ndb/r/ndb_join_pushdown_default.result
mysql-test/suite/ndb/r/ndb_restore_misc.result
mysql-test/suite/ndb/r/ndb_statistics0.result
mysql-test/suite/ndb/r/ndb_statistics1.result
mysql-test/suite/ndb/t/disabled.def
mysql-test/suite/ndb/t/ndb_join_pushdown.inc
mysql-test/suite/ndb/t/ndb_restore_misc.test
mysql-test/suite/ndb_memcache/include/have_memcache.inc
mysql-test/suite/ndb_memcache/include/memcached_wait_for_ready.inc
mysql-test/suite/ndb_memcache/include/wait_for_reconf.inc
mysql-test/suite/ndb_memcache/my.cnf
mysql-test/suite/ndb_memcache/t/basic.test
mysql-test/suite/ndb_memcache/t/external_values.test
mysql-test/suite/ndb_memcache/t/lib_ascii.test
mysql-test/suite/ndb_memcache/t/lib_binary.test
mysql-test/suite/ndb_memcache/t/math1.test
mysql-test/suite/ndb_memcache/t/math2.test
mysql-test/suite/ndb_memcache/t/reconf1.test
mysql-test/suite/ndb_memcache/t/tsv1.test
mysql-test/suite/ndb_memcache/t/tsv2.test
mysql-test/suite/ndb_memcache/t/ttls_flags.test
mysql-test/suite/ndb_memcache/t/type_char.test
mysql-test/suite/ndb_memcache/t/type_numeric.test
mysql-test/suite/ndb_memcache/t/type_signed.test
mysql-test/suite/ndb_memcache/t/type_unsigned.test
mysql-test/suite/ndb_memcache/t/unique_idx.test
mysql-test/suite/ndb_rpl/my.cnf
mysql-test/suite/ndb_rpl/t/ndb_rpl_break_3_chain.cnf
mysql-test/suite/rpl_ndb/my.cnf
sql/abstract_query_plan.cc
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/ha_ndbcluster_push.cc
sql/handler.h
sql/sql_select.cc
sql/sys_vars.cc
storage/ndb/CMakeLists.txt
storage/ndb/VERSION
storage/ndb/clusterj/clusterj-api/pom.xml
storage/ndb/clusterj/clusterj-core/pom.xml
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryDomainTypeImpl.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainTypeHandler.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SessionSPI.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SmartValueHandler.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/ValueHandlerFactory.java
storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/Operation.java
storage/ndb/clusterj/clusterj-jdbc/pom.xml
storage/ndb/clusterj/clusterj-jpatest/pom.xml
storage/ndb/clusterj/clusterj-openjpa/pom.xml
storage/ndb/clusterj/clusterj-openjpa/src/main/java/com/mysql/clusterj/openjpa/NdbOpenJPADomainTypeHandlerImpl.java
storage/ndb/clusterj/clusterj-openjpa/src/test/java/com/mysql/clusterj/openjpatest/OneToManyRelationshipTest.java
storage/ndb/clusterj/clusterj-openjpa/src/test/java/com/mysql/clusterj/openjpatest/TestBadPersistenceUnitNoConnectString.java
storage/ndb/clusterj/clusterj-test/pom.xml
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractClusterJTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractQueryTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/BitTypesTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DbugTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DeleteAllByClassTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/ObjectNotFoundTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryExplainTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryMultiColumnIndexInTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/SchemaChangeTest.java
storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/domaintypehandler/CrazyDomainTypeHandlerFactoryImpl.java
storage/ndb/clusterj/clusterj-tie/logging.properties
storage/ndb/clusterj/clusterj-tie/pom.xml
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordDeleteOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordInsertOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordKeyOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordOperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordResultDataImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerFactoryImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/NdbRecordSmartValueHandlerImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/OperationImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ResultDataImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ScanResultDataImpl.java
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/Utility.java
storage/ndb/clusterj/clusterj-tie/src/test/java/testsuite/clusterj/tie/ConnectionPoolTest.java
storage/ndb/clusterj/clusterj-tie/src/test/java/testsuite/clusterj/tie/StressTest.java
storage/ndb/clusterj/pom.xml
storage/ndb/compile-cluster
storage/ndb/include/kernel/GlobalSignalNumbers.h
storage/ndb/include/kernel/signaldata/DihScanTab.hpp
storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
storage/ndb/include/kernel/signaldata/LCP.hpp
storage/ndb/include/kernel/signaldata/ScanFrag.hpp
storage/ndb/include/kernel/signaldata/SignalData.hpp
storage/ndb/include/ndb_version.h.in
storage/ndb/include/util/SocketAuthenticator.hpp
storage/ndb/include/util/Vector.hpp
storage/ndb/memcache/extra/memcached/CMakeLists.txt
storage/ndb/memcache/extra/memcached/config_tests.in
storage/ndb/memcache/extra/memcached/daemon/memcached.c
storage/ndb/memcache/include/QueryPlan.h
storage/ndb/memcache/include/Scheduler.h
storage/ndb/memcache/include/ndb_engine.h
storage/ndb/memcache/include/ndb_engine_errors.h
storage/ndb/memcache/include/ndb_pipeline.h
storage/ndb/memcache/include/ndbmemcache_config.in
storage/ndb/memcache/src/ExternalValue.cc
storage/ndb/memcache/src/Record.cc
storage/ndb/memcache/src/ndb_engine.c
storage/ndb/memcache/src/ndb_engine_errors.cc
storage/ndb/memcache/src/ndb_engine_private.h
storage/ndb/memcache/src/ndb_error_logger.cc
storage/ndb/memcache/src/ndb_pipeline.cc
storage/ndb/memcache/src/ndb_worker.cc
storage/ndb/memcache/src/schedulers/S_sched.cc
storage/ndb/memcache/src/schedulers/S_sched.h
storage/ndb/memcache/src/schedulers/Stockholm.cc
storage/ndb/memcache/src/schedulers/Stockholm.h
storage/ndb/memcache/unit/alloc.cc
storage/ndb/src/common/debugger/signaldata/LCP.cpp
storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp
storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
storage/ndb/src/common/transporter/Transporter.cpp
storage/ndb/src/common/transporter/Transporter.hpp
storage/ndb/src/common/util/SocketAuthenticator.cpp
storage/ndb/src/common/util/version.cpp
storage/ndb/src/dummy.cpp
storage/ndb/src/kernel/blocks/backup/Backup.cpp
storage/ndb/src/kernel/blocks/backup/Backup.hpp
storage/ndb/src/kernel/blocks/backup/BackupInit.cpp
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/vm/ArrayPool.hpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/ndbapi/NdbQueryBuilder.cpp
storage/ndb/src/ndbapi/NdbQueryBuilder.hpp
storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp
storage/ndb/src/ndbapi/NdbQueryOperation.cpp
storage/ndb/src/ndbapi/NdbQueryOperationImpl.hpp
storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NDBAPIConst.java
storage/ndb/src/ndbjtie/com/mysql/ndbjtie/ndbapi/NdbInterpretedCode.java
storage/ndb/src/ndbjtie/jtie/test/unload/test/MyLoadUnloadTest.java
storage/ndb/src/ndbjtie/ndbapi_jtie.hpp
storage/ndb/src/ndbjtie/test/CMakeLists.txt
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.alt
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp
storage/ndb/src/ndbjtie/test/test/JTieTestBase.java
storage/ndb/src/ndbjtie/test/test/NdbJTieMultiLibTest.java
storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.cmd.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.sh.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.cmd.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.sh.in
storage/ndb/test/include/HugoTransactions.hpp
storage/ndb/test/include/NdbMgmd.hpp
storage/ndb/test/include/NdbTimer.hpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/ndbapi/testScan.cpp
storage/ndb/test/ndbapi/testSpj.cpp
storage/ndb/test/ndbapi/testUpgrade.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/daily-devel-tests.txt
storage/ndb/test/src/HugoTransactions.cpp
storage/ndb/test/tools/connect.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_condition_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2012-02-23 15:41:31 +0000
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2012-05-23 12:43:48 +0000
@@ -2422,3 +2422,11 @@ test_data@stripped 1
drop table escapetest;
set @@session.optimizer_switch = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
+#
+# Bug#14106592 DEBUG BUILD CRASH IN NDB_SERIALIZE_COND()
+#
+create table t1(a time) engine=ndbcluster;
+insert into t1 values ('00:00:00'),('01:01:01');
+select 1 from t1 where a >= geomfromtext('1');
+1
+drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_condition_pushdown.test'
--- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2012-02-23 15:41:31 +0000
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2012-05-23 12:43:48 +0000
@@ -2437,3 +2437,11 @@ drop table escapetest;
set @@session.optimizer_switch = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
+--echo #
+--echo # Bug#14106592 DEBUG BUILD CRASH IN NDB_SERIALIZE_COND()
+--echo #
+create table t1(a time) engine=ndbcluster;
+insert into t1 values ('00:00:00'),('01:01:01');
+select 1 from t1 where a >= geomfromtext('1');
+drop table t1;
+
=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc 2012-02-23 15:41:31 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2012-05-23 12:43:48 +0000
@@ -766,11 +766,9 @@ ndb_serialize_cond(const Item *item, voi
{
#ifndef DBUG_OFF
char buff[256];
- String str(buff,0, system_charset_info);
- //str.length(0);// Magnus
- Item_string *string_item= (Item_string *) item;
- DBUG_PRINT("info", ("value \"%s\"",
- string_item->val_str(&str)->ptr()));
+ String str(buff, 0, system_charset_info);
+ const_cast<Item*>(item)->print(&str, QT_ORDINARY);
+ DBUG_PRINT("info", ("value: '%s'", str.c_ptr_safe()));
#endif
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::STRING_ITEM;
@@ -1029,11 +1027,9 @@ ndb_serialize_cond(const Item *item, voi
{
#ifndef DBUG_OFF
char buff[256];
- String str(buff,0, system_charset_info);
- //str.length(0);// Magnus
- Item_string *string_item= (Item_string *) item;
- DBUG_PRINT("info", ("value \"%s\"",
- string_item->val_str(&str)->ptr()));
+ String str(buff, 0, system_charset_info);
+ const_cast<Item*>(item)->print(&str, QT_ORDINARY);
+ DBUG_PRINT("info", ("value: '%s'", str.c_ptr_safe()));
#endif
NDB_ITEM_QUALIFICATION q;
q.value_type= Item::STRING_ITEM;
=== modified file 'storage/ndb/src/common/util/SocketClient.cpp'
--- a/storage/ndb/src/common/util/SocketClient.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/SocketClient.cpp 2012-05-23 11:45:13 +0000
@@ -189,7 +189,7 @@ SocketClient::connect(const char *toaddr
}
done:
- if (my_socket_nonblock(m_sockfd, true) < 0)
+ if (my_socket_nonblock(m_sockfd, false) < 0)
{
my_socket_close(m_sockfd);
my_socket_invalidate(&m_sockfd);
=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp 2012-03-21 12:31:02 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp 2012-05-23 06:40:37 +0000
@@ -637,6 +637,17 @@ struct thr_jb_write_state
/* Number of signals inserted since last wakeup */
Uint32 m_pending_signals_wakeup;
+
+ /*
+ * Is this job buffer open for communication at all?
+ * Several threads are not expected to communicate, and thus does
+ * not allocate thr_job_buffer for exchange of signals.
+ * Don't access any job_buffers without ensuring 'is_open()==true'.
+ */
+ bool is_open() const
+ {
+ return (m_write_buffer != NULL);
+ }
};
/*
@@ -669,6 +680,17 @@ struct thr_jb_read_state
Uint32 m_write_index; // Last available thr_job_buffer.
+ /*
+ * Is this job buffer open for communication at all?
+ * Several threads are not expected to communicate, and thus does
+ * not allocate thr_job_buffer for exchange of signals.
+ * Don't access any job_buffers without ensuring 'is_open()==true'.
+ */
+ bool is_open() const
+ {
+ return (m_read_buffer != NULL);
+ }
+
bool is_empty() const
{
assert(m_read_index != m_write_index || m_read_pos <= m_read_end);
@@ -2949,6 +2971,7 @@ insert_signal(thr_job_queue *q, thr_job_
{
Uint32 write_pos = w->m_write_pos;
Uint32 datalen = sh->theLength;
+ assert(w->is_open());
assert(w->m_write_buffer == q->m_buffers[w->m_write_index]);
memcpy(w->m_write_buffer->m_data + write_pos, sh, sizeof(*sh));
write_pos += (sizeof(*sh) >> 2);
@@ -3021,19 +3044,22 @@ read_jbb_state(thr_data *selfptr, Uint32
const thr_job_queue_head *h = selfptr->m_in_queue_head;
for (Uint32 i = 0; i < count; i++,r++)
{
- Uint32 read_index = r->m_read_index;
-
- /**
- * Optimization: Only reload when possibly empty.
- * Avoid cache reload of shared thr_job_queue_head
- * Read head directly to avoid unnecessary cache
- * load of first cache line of m_in_queue entry.
- */
- if (r->m_write_index == read_index)
+ if (r->is_open())
{
- r->m_write_index = h[i].m_write_index;
- read_barrier_depends();
- r->m_read_end = q[i].m_buffers[read_index]->m_len;
+ Uint32 read_index = r->m_read_index;
+
+ /**
+ * Optimization: Only reload when possibly empty.
+ * Avoid cache reload of shared thr_job_queue_head
+ * Read head directly to avoid unnecessary cache
+ * load of first cache line of m_in_queue entry.
+ */
+ if (r->m_write_index == read_index)
+ {
+ r->m_write_index = h[i].m_write_index;
+ read_barrier_depends();
+ r->m_read_end = q[i].m_buffers[read_index]->m_len;
+ }
}
}
}
@@ -3739,7 +3765,7 @@ mt_job_thread_main(void *thr_arg)
/**
* prefill our thread local send buffers
- * up to THR_MINIMUM_SEND_BUFFERS (1Mb)
+ * up to THR_SEND_BUFFER_PRE_ALLOC (1Mb)
*
* and if this doesnt work pack buffers before start to execute signals
*/
@@ -4025,6 +4051,75 @@ sendprioa_STOP_FOR_CRASH(const struct th
}
/**
+ * Identify type of thread.
+ * Based on assumption that threads are allocated in the order:
+ * main, ldm, tc, recv, send
+ */
+static bool
+is_main_thread(unsigned thr_no)
+{
+ return thr_no < NUM_MAIN_THREADS;
+}
+
+static bool
+is_ldm_thread(unsigned thr_no)
+{
+ return thr_no >= NUM_MAIN_THREADS &&
+ thr_no < NUM_MAIN_THREADS+globalData.ndbMtLqhThreads;
+}
+
+static bool
+is_tc_thread(unsigned thr_no)
+{
+ unsigned tc_base = NUM_MAIN_THREADS+globalData.ndbMtLqhThreads;
+ return thr_no >= tc_base &&
+ thr_no < tc_base+globalData.ndbMtTcThreads;
+}
+
+static bool
+is_recv_thread(unsigned thr_no)
+{
+ unsigned recv_base = NUM_MAIN_THREADS+globalData.ndbMtLqhThreads+globalData.ndbMtTcThreads;
+ return thr_no >= recv_base &&
+ thr_no < recv_base+globalData.ndbMtReceiveThreads;
+}
+
+/**
+ * Implements the rules for which threads are allowed to have
+ * communication with each other.
+ * Also see compute_jb_pages() which has similar logic.
+ */
+static bool
+may_communicate(unsigned from, unsigned to)
+{
+ if (is_main_thread(from))
+ {
+ // Main threads communicates with all other threads
+ return true;
+ }
+ else if (is_ldm_thread(from))
+ {
+ // LQH threads can communicates with TC-, main- and itself
+ return is_main_thread(to) ||
+ is_tc_thread(to) ||
+ (to == from);
+ }
+ else if (is_tc_thread(from))
+ {
+ // TC threads can communicate with LQH-, main- and itself
+ return is_main_thread(to) ||
+ is_ldm_thread(to) ||
+ (to == from);
+ }
+ else
+ {
+ assert(is_recv_thread(from));
+ // Receive treads communicate with all, except other receivers
+ return !is_recv_thread(to);
+ }
+}
+
+/**
* init functions
*/
static
@@ -4072,7 +4167,8 @@ thr_init(struct thr_repository* rep, str
{
selfptr->m_in_queue_head[i].m_read_index = 0;
selfptr->m_in_queue_head[i].m_write_index = 0;
- buffer = seize_buffer(rep, thr_no, false);
+ buffer = may_communicate(i,thr_no)
+ ? seize_buffer(rep, thr_no, false) : NULL;
selfptr->m_in_queue[i].m_buffers[0] = buffer;
selfptr->m_read_states[i].m_read_index = 0;
selfptr->m_read_states[i].m_read_buffer = buffer;
@@ -4258,37 +4354,93 @@ mt_get_extra_send_buffer_pages(Uint32 cu
Uint32
compute_jb_pages(struct EmulatorData * ed)
{
- Uint32 cnt = NUM_MAIN_THREADS +
- globalData.ndbMtReceiveThreads + globalData.ndbMtTcThreads + globalData.ndbMtLqhThreads + 1;
+ Uint32 cnt = get_total_number_of_block_threads();
+ Uint32 num_receive_threads = globalData.ndbMtReceiveThreads;
+ Uint32 num_lqh_threads = globalData.ndbMtLqhThreads;
+ Uint32 num_tc_threads = globalData.ndbMtTcThreads;
+ Uint32 num_main_threads = NUM_MAIN_THREADS;
+
+ /**
+ * Number of pages each thread needs to communicate with another
+ * thread.
+ */
+ Uint32 job_queue_pages_per_thread = thr_job_queue::SIZE;
+ /**
+ * In 'perthread' we calculate number of pages required by
+ * all 'block threads' (excludes 'send-threads'). 'perthread'
+ * usage is independent of whether this thread will communicate
+ * with other 'block threads' or not.
+ */
Uint32 perthread = 0;
/**
- * Each thread can have thr_job_queue::SIZE pages in out-queues
- * to each other thread
+ * Each threads has its own job_queue for 'prio A' signals
*/
- perthread += cnt * (1 + thr_job_queue::SIZE);
+ perthread += job_queue_pages_per_thread;
/**
- * And thr_job_queue::SIZE prio A signals
+ * Each thread keeps a available free page in 'm_next_buffer'
+ * in case it is required by insert_signal() into JBA or JBB.
*/
- perthread += (1 + thr_job_queue::SIZE);
+ perthread += 1;
/**
- * And XXX time-queue signals
+ * Each thread keeps time-queued signals in 'struct thr_tq'
+ * thr_tq::PAGES are used to store these.
*/
- perthread += 32; // Say 1M for now
+ perthread += thr_tq::PAGES;
/**
- * Each thread also keeps an own cache with max THR_FREE_BUF_MAX
+ * Each thread has its own 'm_free_fifo[THR_FREE_BUF_MAX]' cache.
+ * As it is filled to MAX *before* a page is allocated, which consumes a page,
+ * it will never cache more than MAX-1 pages. Pages are also returned to global
+ * allocator as soon as MAX is reached.
*/
- perthread += THR_FREE_BUF_MAX;
+ perthread += THR_FREE_BUF_MAX-1;
/**
- * Multiply by no of threads
+ * Start by calculating the basic number of pages required for
+ * our 'cnt' block threads.
+ * (no inter-thread communication assumed so far)
*/
Uint32 tot = cnt * perthread;
+ /**
+ * We then start adding pages required for inter-thread communications:
+ *
+ * Receiver threads will be able to communicate with all other
+ * threads except other receive threads.
+ */
+ tot += num_receive_threads *
+ (cnt - num_receive_threads) *
+ job_queue_pages_per_thread;
+
+ /**
+ * LQH threads can communicate with TC threads and main threads.
+ * Cannot communicate with receive threads and other LQH threads,
+ * but it can communicate with itself.
+ */
+ tot += num_lqh_threads *
+ (num_tc_threads + num_main_threads + 1) *
+ job_queue_pages_per_thread;
+
+ /**
+ * TC threads can communicate with LQH threads and main threads.
+ * Cannot communicate with receive threads and other TC threads,
+ * but it can communicate with itself.
+ */
+ tot += num_tc_threads *
+ (num_lqh_threads + num_main_threads + 1) *
+ job_queue_pages_per_thread;
+
+ /**
+ * Main threads can communicate with all other threads
+ */
+ tot += num_main_threads *
+ cnt *
+ job_queue_pages_per_thread;
+
return tot;
}
@@ -4710,7 +4862,7 @@ FastScheduler::dumpSignalMemory(Uint32 t
const thr_job_queue *q = thr_ptr->m_in_queue + thr_no;
const thr_jb_read_state *r = thr_ptr->m_read_states + thr_no;
Uint32 read_pos = r->m_read_pos;
- if (read_pos > 0)
+ if (r->is_open() && read_pos > 0)
{
jbs[num_jbs].m_jb = q->m_buffers[r->m_read_index];
jbs[num_jbs].m_pos = 0;
=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh 2012-03-16 08:07:11 +0000
+++ b/support-files/mysql.spec.sh 2012-05-23 09:04:42 +0000
@@ -283,11 +283,13 @@ documentation and the manual for more in
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
Requires: %{distro_requires}
-Provides: MySQL-Cluster-server
+Provides: MySQL-Cluster-server msqlormysql mysql MySQL mysql-server MySQL-server
Obsoletes: MySQL-Cluster-server
Obsoletes: MySQL-Cluster-management MySQL-Cluster-storage
Obsoletes: MySQL-Cluster-extra MySQL-Cluster-tools
-Conflicts: MySQL mysql mysql-server MySQL-server
+Obsoletes: mysql MySQL mysql-server MySQL-server
+Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
+Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
%description -n MySQL-Cluster-server%{product_suffix}
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -1009,6 +1011,7 @@ echo "====="
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_error_reporter.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_index_stat.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_mgm.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_backup_file.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_schema_file.1*
@@ -1023,6 +1026,7 @@ echo "====="
%doc %attr(644, root, man) %{_mandir}/man8/ndb_mgmd.8*
%doc %attr(644, root, man) %{_mandir}/man8/ndbd.8*
%doc %attr(644, root, man) %{_mandir}/man8/ndbmtd.8*
+%doc %attr(644, root, man) %{_mandir}/man1/ndbinfo_select_all.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster-7.3-fk branch (pekka.nousiainen:3902 to3903) | Pekka Nousiainen | 25 May |