List:Cluster« Previous MessageNext Message »
From:Jon Stephens Date:May 17 2005 3:30pm
Subject:Re: Alter table clarification
View as plain text  
Hi Kris,

Kris Buytaert wrote:
> On Fri, 2005-05-06 at 09:51 +0200, Jonas Oreland wrote:
> 
> As a followup on this question.
> 
> I tried running an alter table before I read this thread :)
> 
> I did an altertable on node1,  when running a describe on node2 it
> didn't see the change.
> So I tried running the alter table on node 2 also.
> 
> I got 
> 
> ERROR 1296 (HY000): Got error 241 'Invalid schema object version' from
> ndbcluster
> 
> However after the error a desc on both nodes is equal and it seems like
> the alter table propagated this way.

This is correct and is intended behaviour. (Autodiscovery of schema changes 
tends to slow things down quite a bit, or so I've been told by one of the NDB 
developers.)

> Is there maybe any other correct way you can force the cluster to
> propagate the change ?

A "nicer" way to do this is to issue a FLUSH TABLES after making the change.

cheers

jon.

> 
> greetings
> 
> Kris
> 
> 
>>Hi Nathan,
>>
>>The problem with our current impl. of alter table is the following.
>>If using 2 mysqld's.
>>* One can start the the alter table. 
>>* But since it does not lock the table, the other can continue making
> insert/update/delete.
>>* The first mysqld can then miss some insert/update/deletes made by the second
> mysqld.
>>
>>And the new table (after the alter table) will be inconsistent.
>>So if you're only running one mysqld, your fine.
>>If you're using more than one, be careful when using alter table.
>>
>>/Jonas
>>
>>
>>>Folks,
>>>
>>>I would like to ask for a clarification regarding the ramifications of 
>>>ALTER TABLE commands against NDB tables.
>>>
>>>In chapter 16, section 8 of the reference manual, it seems pretty clear 
>>>that on-line ALTER commands are not supported:
>>>
>>>"It is not possible to make online schema changes such as those 
>>>accomplished using ALTER TABLE or CREATE INDEX."
>>>
>>>Yet a few bullet points above this it states:
>>>
>>>"ALTER TABLE is not fully locking when running multiple MySQL servers 
>>>(no distributed table lock)."
>>>
>>>I also found this bit from a few days ago on this list:
>>>
>>>"When you do an alter table, a new copy of the table is created and the
>>>is copied to that table, which is later renamed to the original, and the
>>>original table is removed."
>>>(http://lists.mysql.com/cluster/1864)
>>>
>>>I did a few experiments with alterations that seemed to work and 
>>>propagate fine. Please clarify for me what the limitations are on table 
>>>alterations. Other than this small bit of confusion, I have been quite 
>>>pleased with the NDB cluster engine!
>>>
>>>
>>>Cheers,
>>>
>>>Nathan
>>>
>>>-----------------------------------
>>>Nathan McCall
>>>Senior Software Engineer
>>>SunRocket, Inc.
>>>-----------------------------------
>>>
>>>
>>
>>
>>-- 
>>Jonas Oreland, Software Engineer
>>MySQL AB, www.mysql.com
>>


-- 
Jon Stephens  Technical Writer, MySQL Documentation Team
Brisbane, Australia
Voice: +61 (7) 3388-2228
Email: jon@stripped
MySQL AB  www.mysql.com

Jumpstart your cluster!
http://www.mysql.com/consulting/packaged/cluster.html
Thread
Alter table clarificationNathan McCall5 May
  • Re: Alter table clarificationJonas Oreland6 May
    • Re: Alter table clarificationKris Buytaert17 May
      • Re: Alter table clarificationJon Stephens17 May
        • Re: Alter table clarificationStewart Smith18 May
          • Re: Alter table clarificationJon Stephens18 May