Bug #18851 ndbd --initial doesn't clean up logfiles and tablespaces
Submitted: 6 Apr 2006 14:26 Modified: 6 Apr 2006 14:44
Reporter: Kris Buytaert (Candidate Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.6 alpha OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[6 Apr 2006 14:26] Kris Buytaert
Description:
I`m not sure if this is a bug , or just meant to be but   

ndbd --initial on a mysql cluster node with disk storage enabled  does not erase the
datafiles.  

ACCESS1-DB-B:/var/lib/mysql/mysql-cluster # ndbd --initial
ACCESS1-DB-B:/var/lib/mysql/mysql-cluster # ls -al ndb_3_fs/
total 28738
drwxr-x---    3 mysql    mysql         136 Apr  6 16:08 .
drwxr-xr-x    3 mysql    mysql         384 Apr  6 16:12 ..
drwxr-x---    5 mysql    mysql         120 Apr  5 16:58 LCP
-rw-r--r--    1 mysql    mysql    12648448 Apr  5 18:05 datafile.dat
-rw-r--r--    1 mysql    mysql    16777216 Apr  5 19:59 undofile.dat

Hence wanting to start from scratch again I have to manually erase those files.

Even when doing a --initial on both my nodes none of the files dissapear.

How to repeat:
ACCESS1-DB-B:/var/lib/mysql/mysql-cluster # ndbd --initial
ACCESS1-DB-B:/var/lib/mysql/mysql-cluster # ls -al ndb_3_fs/
total 28738
drwxr-x---    3 mysql    mysql         136 Apr  6 16:08 .
drwxr-xr-x    3 mysql    mysql         384 Apr  6 16:12 ..
drwxr-x---    5 mysql    mysql         120 Apr  5 16:58 LCP
-rw-r--r--    1 mysql    mysql    12648448 Apr  5 18:05 datafile.dat
-rw-r--r--    1 mysql    mysql    16777216 Apr  5 19:59 undofile.dat

Suggested fix:
You might want modify the documentation so that it states that when using disk based storage those files don't dissapear or   make them dissapear , or point me to the documentation I`m overlooknig that explains why they don't dissapear :)
[6 Apr 2006 14:32] Jonas Oreland
Hi

This is intended behavior.
But I'm open to changing it...(some internal guys has also complained)

My reasoning for _not_ removing them is that I basically don't think that you should need
  to use "--initial" except for first time you start cluster.
  And that the decision to remove (potentially 32Gb or more...) data should be more
  manual and explicit.

Please share your opinion, and I'll either change behaviour or fix documenation
  (or wait for more feedback :))

/Jonas
[6 Apr 2006 14:36] Kris Buytaert
Maybe another ndbd parameter to also clean up those files  solves the confusion.
 --initial-disk  or similar,  or just update the docs to become more clear.
[6 Apr 2006 14:44] Jonathan Miller
http://bugs.mysql.com/bug.php?id=16352