Bug #56244 Documentation for ndb_table_no_logging should be explicit about its scope
Submitted: 25 Aug 2010 9:54 Modified: 26 Aug 2010 12:23
Reporter: Andrew Morgan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:MySQL Cluster 7.1 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[25 Aug 2010 9:54] Andrew Morgan
Description:
The system variable ndb_table_no_logging is a little unusual in that it doesn't actually turn the logging on and off in real-time, instead it indicates "if a new ndb table were created (or altered to set engine=ndb) at this point, should logging be enabled for it or not?

This unusual scope should be described in the documentation at  http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-system-variables.html#sysvar_ndb_tabl...

How to repeat:
mysql> create table tab1 (id int not null primary key);
Query OK, 0 rows affected (0.09 sec)

mysql> insert into tab1 values (1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> create table tab2 (id int not null primary key) engine=ndb;
100825 10:14:51 [Note] NDB Binlog: CREATE TABLE Event: REPL$clusterdb/tab2
Query OK, 0 rows affected (0.68 sec)

mysql> insert into tab2 values (1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> SET ndb_table_no_logging=1;
Query OK, 0 rows affected (0.00 sec)

mysql> alter table tab1 engine=ndb;
100825 10:15:44 [Note] NDB Binlog: RENAME Event: REPL$clusterdb/tab1
Query OK, 4 rows affected (1.17 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> alter table tab2 engine=ndb;
100825 10:16:00 [Note] NDB Binlog: RENAME Event: REPL$clusterdb/tab2
Query OK, 4 rows affected (1.98 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> create table tab3 (id int not null primary key) engine=ndb;
100825 10:16:22 [Note] NDB Binlog: CREATE TABLE Event: REPL$clusterdb/tab3
Query OK, 0 rows affected (0.83 sec)

mysql> insert into tab3 values (1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> SET ndb_table_no_logging=0;
Query OK, 0 rows affected (0.00 sec)

mysql> create table tab4 (id int not null primary key) engine=ndb;
100825 10:16:56 [Note] NDB Binlog: CREATE TABLE Event: REPL$clusterdb/tab4
Query OK, 0 rows affected (0.57 sec)

mysql> insert into tab4 values (1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql>
mysql> select * from tab1;
+----+
| id |
+----+
|  3 |
|  1 |
|  2 |
|  4 |
+----+
4 rows in set (0.00 sec)

mysql> select * from tab2;
+----+
| id |
+----+
|  3 |
|  1 |
|  2 |
|  4 |
+----+
4 rows in set (0.00 sec)

mysql> select * from tab3;
+----+
| id |
+----+
|  1 |
|  2 |
|  4 |
|  3 |
+----+
4 rows in set (0.00 sec)

mysql> select * from tab4;
+----+
| id |
+----+
|  3 |
|  1 |
|  2 |
|  4 |
+----+
4 rows in set (0.00 sec)

mysql> quit
Bye
[billy@ws2 my_cluster]$ mysqladmin -u root shutdown
100825 10:18:44 [Note] mysqld: Normal shutdown

100825 10:18:44 [Note] Event Scheduler: Purging the queue. 0 events
100825 10:18:44 [Note] Stopping Cluster Utility thread
100825 10:18:44 [Note] Stopping Cluster Binlog
100825 10:18:45  InnoDB: Starting shutdown...
100825 10:18:49  InnoDB: Shutdown completed; log sequence number 0 44233
100825 10:18:49 [Note] mysqld: Shutdown complete

[1]+  Done                    mysqld --defaults-file=conf/my.cnf
[billy@ws2 my_cluster]$ ndb_mgm -e shutdown
Connected to Management Server at: localhost:1186
2 NDB Cluster node(s) have shutdown.
Disconnecting to allow management server to shutdown.
[billy@ws2 my_cluster]$ ndb_mgmd -f conf/config.ini --configdir=/home/billy/my_cluster/conf/
2010-08-25 10:19:18 [MgmtSrvr] INFO     -- NDB Cluster Management Server. mysql-5.1.44 ndb-7.1.3
2010-08-25 10:19:18 [MgmtSrvr] INFO     -- Loaded config from '/home/billy/my_cluster/conf//ndb_1_config.bin.1'
[billy@ws2 my_cluster]$ ndbd -c localhost:1186                                  2010-08-25 10:19:23 [ndbd] INFO     -- Configuration fetched from 'localhost:1186', generation: 1
[billy@ws2 my_cluster]$ ndbd -c localhost:1186
2010-08-25 10:19:25 [ndbd] INFO     -- Configuration fetched from 'localhost:1186', generation: 1

[billy@ws2 my_cluster]$ mysqld --defaults-file=conf/my.cnf &
[1] 2103
[billy@ws2 my_cluster]$ 100825 10:19:53 [Note] Plugin 'FEDERATED' is disabled.
100825 10:19:53  InnoDB: Started; log sequence number 0 44233
100825 10:19:54 [Note] NDB: NodeID is 50, management server 'localhost:1186'
100825 10:19:54 [Note] NDB[0]: NodeID: 50, all storage nodes connected
100825 10:19:54 [Warning] NDB: server id set to zero will cause any other mysqld with bin log to log with wrong server id
100825 10:19:54 [Note] Starting Cluster Binlog Thread
100825 10:19:54 [Note] Event Scheduler: Loaded 0 events
100825 10:19:55 [Note] NDB Binlog: DISCOVER TABLE Event: REPL$mysql/ndb_schema
100825 10:19:55 [Note] NDB Binlog: logging ./mysql/ndb_schema (UPDATED,USE_WRITE)
100825 10:19:55 [Note] NDB Binlog: DISCOVER TABLE Event: REPL$mysql/ndb_apply_status
100825 10:19:55 [Note] NDB Binlog: logging ./mysql/ndb_apply_status (UPDATED,USE_WRITE)
2010-08-25 10:19:55 [NdbApi] INFO     -- Flushing incomplete GCI:s < 7906/16
2010-08-25 10:19:55 [NdbApi] INFO     -- Flushing incomplete GCI:s < 7906/16
100825 10:19:55 [Note] NDB Binlog: starting log at epoch 7906/16
100825 10:19:55 [Note] NDB Binlog: ndb tables writable
100825 10:19:55 [Note] mysqld: ready for connections.
Version: '5.1.44-ndb-7.1.3-cluster-gpl'  socket: '/tmp/mysql.sock'  port: 5000  MySQL Cluster Server (GPL)

[billy@ws2 my_cluster]$ mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.44-ndb-7.1.3-cluster-gpl MySQL Cluster Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use clusterdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from tab1;
Empty set (0.00 sec)

mysql> select * from tab2;
Empty set (0.00 sec)

mysql> select * from tab3;
Empty set (0.00 sec)

mysql> select * from tab4;
+----+
| id |
+----+
|  1 |
|  2 |
|  4 |
|  3 |
+----+
4 rows in set (0.00 sec)

Suggested fix:
Document the scope of the variable in http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-system-variables.html#sysvar_ndb_tabl...
[26 Aug 2010 12:23] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.