It's actually the reverse problem.
Mysqld no longer has the table, no .frm file exists, but ndbd thinks it
is still around. Ndb_show_tables shows it is there, yet ndb_drop_table
can't remove it.
In terms of NDBAPI, Dictionary::getTable() will not retrieve the dead
table, and Dictionary::dropTable() does not drop it. The latter is
unsurprising, because the first action performed by dropTable() is to
call getTable() to retrieve its metadata.
Note that I haven't been using NDBAPI whatsoever on this cluster leading
up to the problem--I'm examining any tools available to attempt to fix
it.
> -----Original Message-----
> From: Tobias Asplund [mailto:tobias.asplund@stripped]
> Sent: Wednesday, July 01, 2009 5:33 AM
> To: Jeff Sturm
> Cc: cluster@stripped
> Subject: Re: Cannot drop or create NDB table
>
> Hi Jeff,
>
> My guess is that the table wasn't created properly (or disappeared
with
> the use of ndbd --initial on your datanodes) on the ndb side of
things,
> but MySQL still thinks it should be around.
>
> mysql> SHOW VARIABLES LIKE 'datadir';
>
> cd over to that directory and the subdirectory of your schema-name
where
> this table "should" be.
> You'll see a contest_entry.frm file there, most likely.
> If you move that file to some other location it will probably work.
> (Or remove it - or move and then remove once verified it works like
you
> want it to...)
>
> Cheers,
> Tobias
>
>
> Jeff Sturm wrote:
> > I have an NDB table (6.2.15) that appears to have been partially
> > created. My problem is getting rid of it so I can re-create
properly.
> >
> >
> >
> > In mysql, I see:
> >
> >
> >
> > mysql> create table contest_entry (id integer primary key);
> >
> > ERROR 1050 (42S01): Table 'contest_entry' already exists
> >
> >
> >
> > mysql> drop table contest_entry;
> >
> > ERROR 1051 (42S02): Unknown table 'contest_entry'
> >
> >
> >
> > Hmm. Trying from NDBAPI:
> >
> >
> >
> > [root@dbs02 ~]# ndb_show_tables | grep promodb | grep contest_entry
> >
> > 929 UserTable Online Yes promodb def
> > contest_entry
> >
> >
> >
> > So the table does exist, has id 929, is online, etc. However,
unlike
> > the other tables, it is lacking a TableEvent, and I still can't drop
it:
> >
> >
> >
> > [root@dbs02 ~]# ndb_drop_table -d promodb contest_entry
> >
> > Dropping table contest_entry...
> >
> > 723: No such table existed
> >
> >
> >
> > NDBT_ProgramExit: 1 - Failed
> >
> >
> >
> > I'd fiile a bug report if I had any idea how to reproduce this. So
> > instead I'll ask: What might cause this? How can I repair? Is a
full
> > shutdown likely to help, or do I have to resort to ndb_restore, or
> > worse?
> >
> >
> >
> > Grateful for any help,
> >
> >
> >
> > Jeff
> >
> >
> >
> >
> >
>