Commit 59846f91 authored by unknown's avatar unknown

ndb dd -

  implement limitation with only on logfile group, since SR is really buggy with several


mysql-test/r/ndb_dd_ddl.result:
  Test that only 1 logfile group can be created
mysql-test/r/ndb_dd_dump.result:
  Test that only 1 logfile group can be created
mysql-test/t/ndb_dd_ddl.test:
  Test that only 1 logfile group can be created
mysql-test/t/ndb_dd_dump.test:
  Test that only 1 logfile group can be created
storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp:
  New error code for "only one logfile group" limitation
storage/ndb/src/kernel/blocks/lgman.cpp:
  New error code for "only one logfile group" limitation
storage/ndb/src/ndbapi/ndberror.c:
  New error code for "only one logfile group" limitation
parent 69ebe6c3
...@@ -7,6 +7,16 @@ ADD UNDOFILE 'undofile.dat' ...@@ -7,6 +7,16 @@ ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M UNDO_BUFFER_SIZE = 1M
ENGINE=NDB; ENGINE=NDB;
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile2.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Error 1506 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1 CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat' ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M INITIAL_SIZE 16M
......
...@@ -8,15 +8,6 @@ ALTER LOGFILE GROUP lg1 ...@@ -8,15 +8,6 @@ ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile_lg1_02.dat' ADD UNDOFILE 'undofile_lg1_02.dat'
INITIAL_SIZE = 4M INITIAL_SIZE = 4M
ENGINE NDB; ENGINE NDB;
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile_lg2_01.dat'
UNDO_BUFFER_SIZE = 1M
INITIAL_SIZE 2M
ENGINE NDB;
ALTER LOGFILE GROUP lg2
ADD UNDOFILE 'undofile_lg2_02.dat'
INITIAL_SIZE = 4M
ENGINE NDB;
CREATE TABLESPACE ts1 CREATE TABLESPACE ts1
ADD DATAFILE 'datafile_ts1_01.dat' ADD DATAFILE 'datafile_ts1_01.dat'
USE LOGFILE GROUP lg1 USE LOGFILE GROUP lg1
...@@ -34,7 +25,7 @@ INITIAL_SIZE 2M ...@@ -34,7 +25,7 @@ INITIAL_SIZE 2M
ENGINE NDB; ENGINE NDB;
CREATE TABLESPACE ts3 CREATE TABLESPACE ts3
ADD DATAFILE 'datafile_ts3_01.dat' ADD DATAFILE 'datafile_ts3_01.dat'
USE LOGFILE GROUP lg2 USE LOGFILE GROUP lg1
INITIAL_SIZE 4M INITIAL_SIZE 4M
ENGINE NDB; ENGINE NDB;
CREATE TABLE t1 CREATE TABLE t1
...@@ -173,7 +164,6 @@ DROP TABLESPACE ts1 ENGINE = NDB; ...@@ -173,7 +164,6 @@ DROP TABLESPACE ts1 ENGINE = NDB;
DROP TABLESPACE ts2 ENGINE = NDB; DROP TABLESPACE ts2 ENGINE = NDB;
DROP TABLESPACE ts3 ENGINE = NDB; DROP TABLESPACE ts3 ENGINE = NDB;
DROP LOGFILE GROUP lg1 ENGINE = NDB; DROP LOGFILE GROUP lg1 ENGINE = NDB;
DROP LOGFILE GROUP lg2 ENGINE = NDB;
SELECT DISTINCT SELECT DISTINCT
LOGFILE_GROUP_NAME, LOGFILE_GROUP_NAME,
FILE_NAME, FILE_NAME,
...@@ -184,8 +174,6 @@ FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME; ...@@ -184,8 +174,6 @@ FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
lg1 undofile_lg1_01.dat 1048576 2097152 ndbcluster lg1 undofile_lg1_01.dat 1048576 2097152 ndbcluster
lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
lg2 undofile_lg2_01.dat 1048576 2097152 ndbcluster
lg2 undofile_lg2_02.dat 1048576 4194304 ndbcluster
SELECT DISTINCT SELECT DISTINCT
TABLESPACE_NAME, TABLESPACE_NAME,
LOGFILE_GROUP_NAME, LOGFILE_GROUP_NAME,
...@@ -198,7 +186,7 @@ TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_NAME EXTENT_SIZE INITIAL_SIZE ENGINE ...@@ -198,7 +186,7 @@ TABLESPACE_NAME LOGFILE_GROUP_NAME FILE_NAME EXTENT_SIZE INITIAL_SIZE ENGINE
ts1 lg1 datafile_ts1_01.dat 1048576 2097152 ndbcluster ts1 lg1 datafile_ts1_01.dat 1048576 2097152 ndbcluster
ts1 lg1 datafile_ts1_02.dat 1048576 1048576 ndbcluster ts1 lg1 datafile_ts1_02.dat 1048576 1048576 ndbcluster
ts2 lg1 datafile_ts2_01.dat 1048576 2097152 ndbcluster ts2 lg1 datafile_ts2_01.dat 1048576 2097152 ndbcluster
ts3 lg2 datafile_ts3_01.dat 1048576 4194304 ndbcluster ts3 lg1 datafile_ts3_01.dat 1048576 4194304 ndbcluster
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
500 500
...@@ -227,4 +215,3 @@ DROP TABLESPACE ts1 ENGINE = NDB; ...@@ -227,4 +215,3 @@ DROP TABLESPACE ts1 ENGINE = NDB;
DROP TABLESPACE ts2 ENGINE = NDB; DROP TABLESPACE ts2 ENGINE = NDB;
DROP TABLESPACE ts3 ENGINE = NDB; DROP TABLESPACE ts3 ENGINE = NDB;
DROP LOGFILE GROUP lg1 ENGINE = NDB; DROP LOGFILE GROUP lg1 ENGINE = NDB;
DROP LOGFILE GROUP lg2 ENGINE = NDB;
...@@ -20,7 +20,10 @@ ...@@ -20,7 +20,10 @@
# the file name. I know this is not an issue for *nix systems but # the file name. I know this is not an issue for *nix systems but
# will be when we expand to Windows and Mac. Better put it in now. # will be when we expand to Windows and Mac. Better put it in now.
############################################ ############################################
#
# Jonas 2006-03-10
# Add verification that ndb currently is limited to 1 logfile group
#
-- source include/have_ndb.inc -- source include/have_ndb.inc
...@@ -41,6 +44,15 @@ INITIAL_SIZE 16M ...@@ -41,6 +44,15 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M UNDO_BUFFER_SIZE = 1M
ENGINE=NDB; ENGINE=NDB;
# Verify that one currently can create only 1 logfile group
--error ER_CREATE_FILEGROUP_FAILED
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile2.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE 1M
ENGINE NDB;
SHOW WARNINGS;
--error ER_CREATE_FILEGROUP_FAILED --error ER_CREATE_FILEGROUP_FAILED
CREATE LOGFILE GROUP lg1 CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat' ADD UNDOFILE 'undofile.dat'
......
...@@ -15,17 +15,6 @@ ADD UNDOFILE 'undofile_lg1_02.dat' ...@@ -15,17 +15,6 @@ ADD UNDOFILE 'undofile_lg1_02.dat'
INITIAL_SIZE = 4M INITIAL_SIZE = 4M
ENGINE NDB; ENGINE NDB;
CREATE LOGFILE GROUP lg2
ADD UNDOFILE 'undofile_lg2_01.dat'
UNDO_BUFFER_SIZE = 1M
INITIAL_SIZE 2M
ENGINE NDB;
ALTER LOGFILE GROUP lg2
ADD UNDOFILE 'undofile_lg2_02.dat'
INITIAL_SIZE = 4M
ENGINE NDB;
CREATE TABLESPACE ts1 CREATE TABLESPACE ts1
ADD DATAFILE 'datafile_ts1_01.dat' ADD DATAFILE 'datafile_ts1_01.dat'
USE LOGFILE GROUP lg1 USE LOGFILE GROUP lg1
...@@ -46,7 +35,7 @@ ENGINE NDB; ...@@ -46,7 +35,7 @@ ENGINE NDB;
CREATE TABLESPACE ts3 CREATE TABLESPACE ts3
ADD DATAFILE 'datafile_ts3_01.dat' ADD DATAFILE 'datafile_ts3_01.dat'
USE LOGFILE GROUP lg2 USE LOGFILE GROUP lg1
INITIAL_SIZE 4M INITIAL_SIZE 4M
ENGINE NDB; ENGINE NDB;
...@@ -204,7 +193,6 @@ DROP TABLESPACE ts2 ENGINE = NDB; ...@@ -204,7 +193,6 @@ DROP TABLESPACE ts2 ENGINE = NDB;
DROP TABLESPACE ts3 ENGINE = NDB; DROP TABLESPACE ts3 ENGINE = NDB;
DROP LOGFILE GROUP lg1 ENGINE = NDB; DROP LOGFILE GROUP lg1 ENGINE = NDB;
DROP LOGFILE GROUP lg2 ENGINE = NDB;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/ndb_dd_dump.sql
...@@ -254,6 +242,5 @@ DROP TABLESPACE ts2 ENGINE = NDB; ...@@ -254,6 +242,5 @@ DROP TABLESPACE ts2 ENGINE = NDB;
DROP TABLESPACE ts3 ENGINE = NDB; DROP TABLESPACE ts3 ENGINE = NDB;
DROP LOGFILE GROUP lg1 ENGINE = NDB; DROP LOGFILE GROUP lg1 ENGINE = NDB;
DROP LOGFILE GROUP lg2 ENGINE = NDB;
#End 5.1 test case #End 5.1 test case
...@@ -70,7 +70,8 @@ struct CreateFilegroupImplRef { ...@@ -70,7 +70,8 @@ struct CreateFilegroupImplRef {
NoError = 0, NoError = 0,
FilegroupAlreadyExists = 1502, FilegroupAlreadyExists = 1502,
OutOfFilegroupRecords = 1503, OutOfFilegroupRecords = 1503,
OutOfLogBufferMemory = 1504 OutOfLogBufferMemory = 1504,
OneLogfileGroupLimit = 1514
}; };
Uint32 senderData; Uint32 senderData;
......
...@@ -326,6 +326,13 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -326,6 +326,13 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){
break; break;
} }
if (!m_logfile_group_list.isEmpty())
{
jam();
err = CreateFilegroupImplRef::OneLogfileGroupLimit;
break;
}
if (!m_logfile_group_pool.seize(ptr)) if (!m_logfile_group_pool.seize(ptr))
{ {
jam(); jam();
...@@ -1035,10 +1042,8 @@ int ...@@ -1035,10 +1042,8 @@ int
Logfile_client::sync_lsn(Signal* signal, Logfile_client::sync_lsn(Signal* signal,
Uint64 lsn, Request* req, Uint32 flags) Uint64 lsn, Request* req, Uint32 flags)
{ {
Lgman::Logfile_group key;
key.m_logfile_group_id= m_logfile_group_id;
Ptr<Lgman::Logfile_group> ptr; Ptr<Lgman::Logfile_group> ptr;
if(m_lgman->m_logfile_group_hash.find(ptr, key)) if(m_lgman->m_logfile_group_list.first(ptr))
{ {
if(ptr.p->m_last_synced_lsn >= lsn) if(ptr.p->m_last_synced_lsn >= lsn)
{ {
......
...@@ -413,6 +413,7 @@ ErrorBundle ErrorCodes[] = { ...@@ -413,6 +413,7 @@ ErrorBundle ErrorCodes[] = {
{ 1511, DMEC, IE, "Out of memory" }, { 1511, DMEC, IE, "Out of memory" },
{ 1512, DMEC, SE, "File read error" }, { 1512, DMEC, SE, "File read error" },
{ 1513, DMEC, IE, "Filegroup not online" }, { 1513, DMEC, IE, "Filegroup not online" },
{ 1514, DMEC, SE, "Currently there is a limit of one logfile group" },
{ 773, DMEC, SE, "Out of string memory, please modify StringMemory config parameter" }, { 773, DMEC, SE, "Out of string memory, please modify StringMemory config parameter" },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment